Initial
This commit is contained in:
116
remote.yaml
Normal file
116
remote.yaml
Normal file
@@ -0,0 +1,116 @@
|
||||
esphome:
|
||||
name: esphome-web-85b510
|
||||
friendly_name: Remote1
|
||||
|
||||
esp32:
|
||||
board: esp32dev
|
||||
framework:
|
||||
type: arduino
|
||||
|
||||
# Enable logging
|
||||
logger:
|
||||
|
||||
# Enable Home Assistant API
|
||||
api:
|
||||
encryption:
|
||||
key: "3Lh3TouUn44kbjr0uuTBcjS+6lWIMVpRkBRd2jTQ3xk="
|
||||
|
||||
ota:
|
||||
|
||||
|
||||
wifi:
|
||||
ssid: !secret wifi_ssid
|
||||
password: !secret wifi_password
|
||||
|
||||
# Enable fallback hotspot (captive portal) in case wifi connection fails
|
||||
ap:
|
||||
ssid: "Esphome-Web-85B510"
|
||||
password: "HAU9GRUYgULI"
|
||||
|
||||
captive_portal:
|
||||
|
||||
color:
|
||||
- id: my_red
|
||||
red: 100%
|
||||
green: 0%
|
||||
blue: 0%
|
||||
- id: my_yellow
|
||||
red: 100%
|
||||
green: 100%
|
||||
blue: 0%
|
||||
- id: my_green
|
||||
red: 0%
|
||||
green: 100%
|
||||
blue: 0%
|
||||
- id: my_blue
|
||||
red: 0%
|
||||
green: 0%
|
||||
blue: 100%
|
||||
- id: my_gray
|
||||
red: 50%
|
||||
green: 50%
|
||||
blue: 50%
|
||||
|
||||
font:
|
||||
- file: "Helvetica.ttf"
|
||||
id: helvetica_48
|
||||
size: 48
|
||||
- file: "Helvetica.ttf"
|
||||
id: helvetica_24
|
||||
size: 24
|
||||
- file: "Helvetica.ttf"
|
||||
id: helvetica_12
|
||||
size: 12
|
||||
|
||||
binary_sensor:
|
||||
- platform: status
|
||||
name: "Node Status"
|
||||
id: system_status
|
||||
|
||||
# Allow dimmable control of the backlight (pin GPIO4)
|
||||
output:
|
||||
- platform: ledc
|
||||
pin: GPIO4
|
||||
id: gpio4
|
||||
|
||||
light:
|
||||
- platform: monochromatic
|
||||
output: gpio4
|
||||
name: "Backlight"
|
||||
|
||||
time:
|
||||
- platform: homeassistant
|
||||
id: esptime
|
||||
|
||||
spi:
|
||||
clk_pin: GPIO5
|
||||
mosi_pin: GPIO23
|
||||
|
||||
display:
|
||||
- platform: st7789v
|
||||
cs_pin: GPIO5
|
||||
dc_pin: GPIO9
|
||||
reset_pin: GPIO1
|
||||
model: Custom
|
||||
height: 320
|
||||
width: 240
|
||||
offset_height: 0
|
||||
offset_width: 0
|
||||
rotation: 270
|
||||
lambda: |-
|
||||
it.rectangle(0, 0, it.get_width(), it.get_height(), id(my_blue));
|
||||
it.rectangle(0, 20, it.get_width(), it.get_height(), id(my_blue)); // header bar
|
||||
|
||||
it.strftime((240 / 2), (140 / 3) * 1 + 5, id(helvetica_24), id(my_gray), TextAlign::CENTER, "%Y-%m-%d", id(esptime).now());
|
||||
it.strftime((240 / 2), (140 / 3) * 2 + 5, id(helvetica_48), id(my_gray), TextAlign::CENTER, "%H:%M:%S", id(esptime).now());
|
||||
it.print(5, 5, id(helvetica_12), id(my_yellow), TextAlign::TOP_LEFT, "ESPHome");
|
||||
|
||||
// Comment out the above lines to see the image without text overlaid
|
||||
// it.image(0, 0, id(my_image));
|
||||
|
||||
if (id(system_status).state) {
|
||||
it.print(235, 5, id(helvetica_12), id(my_green), TextAlign::TOP_RIGHT, "Online");
|
||||
}
|
||||
else {
|
||||
it.print(235, 5, id(helvetica_12), id(my_red), TextAlign::TOP_RIGHT, "Offline");
|
||||
}
|
||||
Reference in New Issue
Block a user