|
| 1 | +# set up your name |
| 2 | +esphome: |
| 3 | + name: "homething-proto" |
| 4 | + platform: ESP32 |
| 5 | + board: featheresp32 |
| 6 | + on_boot: |
| 7 | + priority: 600.0 |
| 8 | + then: |
| 9 | + - delay: 45s |
| 10 | + - if: |
| 11 | + condition: |
| 12 | + not: |
| 13 | + - wifi.connected: |
| 14 | + then: |
| 15 | + - switch.turn_on: sleep_toggle |
| 16 | + |
| 17 | +wifi: |
| 18 | + ssid: !secret wifi_ssid |
| 19 | + password: !secret wifi_password |
| 20 | + fast_connect: true |
| 21 | + id: wifi_id |
| 22 | + power_save_mode: HIGH |
| 23 | + ap: |
| 24 | + ssid: "${friendly_name} Fallback" |
| 25 | + password: !secret wifi_fallback_password |
| 26 | + |
| 27 | +external_components: |
| 28 | + - source: |
| 29 | + # type: git |
| 30 | + # url: https://github.com/landonr/homeThing |
| 31 | + # ref: main |
| 32 | + # refresh: 0s |
| 33 | + type: local |
| 34 | + path: components |
| 35 | + components: [homeThing] |
| 36 | + - source: |
| 37 | + # type: git |
| 38 | + # url: https://github.com/landonr/esphome-components |
| 39 | + # ref: main |
| 40 | + # refresh: 0s |
| 41 | + type: local |
| 42 | + path: ../local_components/components |
| 43 | + components: [ |
| 44 | + homeassistant_component, |
| 45 | + homeassistant_media_player, |
| 46 | + media_player_source, |
| 47 | + media_player_source_sonos, |
| 48 | + media_player_source_spotify, |
| 49 | + media_player_source_custom, |
| 50 | + homeassistant_cover |
| 51 | + ] |
| 52 | + |
| 53 | +packages: |
| 54 | + device_base: !include common/device_base.yaml |
| 55 | + ipod_control_backlight: !include common/ipod/lilygo_tdisplay_ipod_backlight.yaml |
| 56 | + ipod_control_battery: !include common/ipod/lilygo_tdisplay_ipod_battery.yaml |
| 57 | + ipod_control_binary_sensor: !include common/ipod/lilygo_tdisplay_ipod_binary_sensor.yaml |
| 58 | + ipod_control_rotary: !include common/ipod/lilygo_tdisplay_ipod_rotary.yaml |
| 59 | + ipod_control_sleep: !include common/ipod/lilygo_tdisplay_ipod_sleep.yaml |
| 60 | + home_media_player: !include homeConfig/media_player.yaml |
| 61 | + home_text_sensor: !include homeConfig/text_sensor.yaml |
| 62 | + home_light: !include homeConfig/light.yaml |
| 63 | + home_switch: !include homeConfig/switch.yaml |
| 64 | + fonts: !include common/fonts.yaml |
| 65 | + icon_fonts: !include common/icon_fonts.yaml |
| 66 | + |
| 67 | +substitutions: |
| 68 | + friendly_name: "homeThing proto" |
| 69 | + |
| 70 | +color: |
| 71 | + - id: my_primary_accent |
| 72 | + red_int: 75 |
| 73 | + green_int: 45 |
| 74 | + blue_int: 209 |
| 75 | + |
| 76 | +cover: |
| 77 | + - platform: homeassistant_cover |
| 78 | + entity_id: "cover.megadesk_cover" |
| 79 | + name: "Megadesk" |
| 80 | + id: cover_megadesk |
| 81 | + |
| 82 | +homeThing: |
| 83 | + id: homeThingMenu |
| 84 | + settings: |
| 85 | + sleep_after: 14400 |
| 86 | + sleep_switch: sleep_toggle |
| 87 | + backlight: backlight |
| 88 | + battery: |
| 89 | + battery_percent: battery_percent |
| 90 | + charging: charging |
| 91 | + media_player_group: media_group_component |
| 92 | + display: my_display |
| 93 | + on_redraw: |
| 94 | + then: |
| 95 | + component.update: my_display |
| 96 | + display_state: |
| 97 | + colors: |
| 98 | + accent_primary: my_primary_accent |
| 99 | + draw_battery_level: true |
| 100 | + font_small: small_font |
| 101 | + font_medium: medium_font |
| 102 | + font_large: large_font |
| 103 | + font_large_heavy: large_heavy_font |
| 104 | + font_material_large: material_font_large |
| 105 | + font_material_small: material_font_small |
| 106 | + font_logo: home_thing_logo |
| 107 | + screens: |
| 108 | + - name: Desk Screen |
| 109 | + entities: |
| 110 | + - id: cover_megadesk |
| 111 | + type: cover |
| 112 | + - type: command |
| 113 | + name: "desk nudge up" |
| 114 | + command: |
| 115 | + - homeassistant.service: |
| 116 | + service: button.press |
| 117 | + data: |
| 118 | + entity_id: "button.desk_position_nudge_up" |
| 119 | + - type: command |
| 120 | + name: "desk nudge down" |
| 121 | + command: |
| 122 | + - homeassistant.service: |
| 123 | + service: button.press |
| 124 | + data: |
| 125 | + entity_id: "button.desk_position_nudge_down" |
| 126 | + - id: light_desk_lamp |
| 127 | + type: light |
| 128 | + - name: Settings Screen |
| 129 | + show_version: True |
| 130 | + entities: |
| 131 | + - id: backlight |
| 132 | + type: light |
| 133 | + - id: "restart_switch" |
| 134 | + type: switch |
| 135 | + - id: wifi_ssid |
| 136 | + type: text_sensor |
| 137 | + - id: wifi_signal_percent |
| 138 | + type: sensor |
| 139 | + - id: wifi_ip |
| 140 | + type: text_sensor |
| 141 | + |
| 142 | +spi: |
| 143 | + clk_pin: GPIO18 |
| 144 | + mosi_pin: GPIO19 |
| 145 | + |
| 146 | +display: |
| 147 | + - platform: st7789v |
| 148 | + model: TTGO_TDisplay_135x240 |
| 149 | + id: my_display |
| 150 | + cs_pin: GPIO5 |
| 151 | + dc_pin: GPIO16 |
| 152 | + reset_pin: GPIO23 |
| 153 | + rotation: 90 |
| 154 | + update_interval: 10s |
| 155 | + lambda: |- |
| 156 | + id(homeThingMenu)->draw_menu_screen(); |
| 157 | + return; |
| 158 | +
|
| 159 | +text_sensor: |
| 160 | + - platform: wifi_info |
| 161 | + ip_address: |
| 162 | + name: IP Address |
| 163 | + internal: True |
| 164 | + id: wifi_ip |
| 165 | + ssid: |
| 166 | + name: SSID |
| 167 | + internal: True |
| 168 | + id: wifi_ssid |
| 169 | + |
| 170 | +sensor: |
| 171 | + - platform: wifi_signal # Reports the WiFi signal strength/RSSI in dB |
| 172 | + name: "WiFi Signal dB" |
| 173 | + id: wifi_signal_db |
| 174 | + update_interval: 60s |
| 175 | + entity_category: "diagnostic" |
| 176 | + internal: True |
| 177 | + |
| 178 | + - platform: copy # Reports the WiFi signal strength in % |
| 179 | + source_id: wifi_signal_db |
| 180 | + name: "WiFi Signal %" |
| 181 | + id: wifi_signal_percent |
| 182 | + internal: True |
| 183 | + filters: |
| 184 | + - lambda: return min(max(2 * (x + 100.0), 0.0), 100.0); |
| 185 | + unit_of_measurement: "Signal %" |
| 186 | + entity_category: "diagnostic" |
0 commit comments