On my display I want to show if a motion sensor has been tripped.
I beleive that your code for display who is home would help me.
Would you mind sharing.
Thank you.
Hello @carltonb
Sure, I have text_sensors defined like this :
text_sensor:
- platform: homeassistant
entity_id: device_tracker.galaxy_s21_5g
id: tim
name: Tim
Where device_tracker.galaxy_s21_5g is my phone from the unifi wifi integration.
Later in the lamba section I have :
// Tim //
if (id(tim).state == "home") {
it.printf(150, 15, id(icon_font_30), "\U000F0643");}
//Dog walk//
if ((id(tim).state == "not_home") && (HourOfDay <9) ){
it.printf(150,15, id(icon_font_30), "\U000F0A44");}
//Shopping//
if ((id(tim).state == "not_home") && (HourOfDay >9 && HourOfDay < 14)) {
it.printf(150, 15, id(icon_font_30), "\U000F0111");}
//Cycling//
if ((id(tim).state == "not_home") && ((HourOfDay >14) && (HourOfDay <15) )){
it.printf(150,15, id(icon_font_30), "\U000F00A3");}
//Walking//
if ((id(tim).state == "not_home") && ((HourOfDay >15) && (HourOfDay <19) )){
it.printf(150,15, id(icon_font_30), "\U000F0583");}
Hope that helps
I think for use case you could have an input boolean called sensor_tripped, add that in as a text_sensor then display thinks in the lambda section depending whether its true or false (You probably want to reset the boolean at some point too - overnight ?)
Thank you.
It put me on the right path.
Next one
The battery icon is work in progress and is only a placeholder.
The two rectangles are graphs one for air pressure, one for power.
The trashcan is driven from a calendar and shows a trashcan for garbage collection day, a carrot for bio waste collection day and a parcel icon for cartboard and paper collection day.
There are little icons around the room icons. Next to the sofa is a lightbulb wich indicates that the light is on in that room. There is also a fire icon for heatings and wind icons for open windows. Next to the humidity of living-room (sofa) and bedroom (bed) are crossed out water drops if the humidifier is empty in that room.
Hi,
just started a small project. On the 4.2 inch e-ink display i need to have status of the closing of the balcony door and the lights in the dressing room and bathroom.
I have a problem with refreshing the display. I would like it to refresh automatically when the status of the light/door sensor changes. Is it possible to refresh the display from the code? Use interval refreshing isnt good option. Should i use automation of sensor and component.display?
Light sensor based ESPEasy and MQTT., door sensor is z-wave binary.
I;m using Home Assistant from 2 weeks, in the past i was using Domoticz. For doing Panel and sensor, a used Arduino - it was more universal.
Thanks.
text_sensor:
- platform: homeassistant
name: "garderoba_swiatlo"
id: gard_light
entity_id: switch.swiatlo_garderoba
internal: true
font:
- file: 'config/fonts/roboto/Roboto-Medium.ttf'
id: font1
size: 24
spi:
clk_pin: D5
mosi_pin: D7
display:
- platform: waveshare_epaper
id: eink
cs_pin: D8
dc_pin: D2
busy_pin: D1
reset_pin: D4
model: 4.20in
update_interval: 300s
lambda: |-
it.printf(10, 10, id(font1), "Temperatura : %.1fc", id(panel_temp).state);
it.printf(10, 40, id(font1), "Wilgotnosc : %.1f ", id(panel_hum).state);
std::string gard_light_val = to_string(id(gard_light).state);
std::string gard_light_val_prev;
it.printf(10, 70, id(font1), " Garderoba swiatlo: %s",id(gard_light).state.c_str());
if(gard_light_val != gard_light_val_prev) {
gard_light_val_prev = gard_light_val;
some command for display refresh; }
Arek
You can use component.update
:
id(eink).update();
Thank you, i did it, and works great:
binary_sensor:
- platform: homeassistant
device_class: motion
id: drzwi_balkon
entity_id: binary_sensor.door_window_sensor_door_window
internal: true
on_state:
then:
- component.update: eink
Hello,
I’d like to create an e-paper clock (with some optional extra info like weather) that will auto-correct its time via HA’s RPi Zero (similar to the NTP protocol). Several questions:
- Can ESPHome be used with some sort of
sleep(1s)
-cycle to emulate clock and check/correct to the exact time, queried on the HA, once an hour or once day? - Are there partial refresh e-paper displays that would allow to display time in seconds resolution, not just minutes?
- I see that most people here use WiFi for the link between ESPHome and HA/RPi… which consumes a lot of power… Can BlueTooth be used instead?
Thank you!
is it possible to share the code?
Its super, What type of Displej and case
hello,
have problems with my first attempt. Display shows: nan°C
for temperatur outside. whats wrong?
.....
sensor:
- platform: homeassistant
entity_id: sensor.moon
id: moon_stato
internal: true
- platform: wifi_signal
name: "WiFi Signal Sensor"
id: wifisignal
update_interval: 60s
- platform: homeassistant
id: temp_aussen
entity_id: sensor.hofladen_temperatur_temperature
text_sensor:
- platform: homeassistant
id: moon_icon
entity_id: sensor.moon
spi:
clk_pin: 14
mosi_pin: 13 #DIN
display:
- platform: waveshare_epaper
id: epaperdisplay
cs_pin: 15
dc_pin: 12
update_interval: 120s
busy_pin: 16
reset_pin: 4
model: 4.20in
lambda: |-
/* V Linie */
it.line(120, 0, 120, 300);
/* H Linie */
it.line(120, 75, 400, 75);
it.line(120, 150, 400, 150);
it.line(120, 225, 400, 225);
/* outside*/
it.printf(200,40, id(roboto_bold_27), TextAlign::BASELINE_CENTER, "%2.1fºC", id(temp_aussen).state);
You need to enable the HA API, add this :
# Enable Home Assistant API
api:
i had it in. the code above is shorted…
here my complete code
esphome:
name: pool-data
friendly_name: Pool_Data
esp32:
board: esp32dev
framework:
type: arduino
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Epaper-Display Fallback Hotspot"
password: "*********"
captive_portal:
api:
ota:
password: "**********"
font:
- file: 'fonts/Roboto-Medium.ttf'
id: roboto_med_17
size: 17
- file: 'fonts/Roboto-Regular.ttf'
id: roboto_reg_12
size: 12
- file: 'fonts/Roboto-Regular.ttf'
id: roboto_reg_15
size: 15
- file: 'fonts/Roboto-Regular.ttf'
id: roboto_reg_20
size: 20
glyphs:
['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D',
'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',
'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', ' ', 'a', 'b', 'c', 'd', 'e',
'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's',
't', 'u', 'v', 'w', 'x', 'y', 'z', 'å', 'ä', 'ö', 'à', 'è', 'ì', 'ò',
'ù']
- file: 'fonts/Roboto-Bold.ttf'
id: roboto_bold_27
size: 27
glyphs:
['&', '@', '!', ',', '.', '"', '%', '(', ')', '+', '-', '_', ':', '°', '0',
'1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E',
'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S',
'T', 'U', 'V', 'W', 'X', 'Y', 'Z', ' ', 'a', 'b', 'c', 'd', 'e', 'f',
'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't',
'u', 'v', 'w', 'x', 'y', 'z','å', 'ä', 'ö', '/','º','µ','³']
- file: 'fonts/Roboto-Bold.ttf'
id: roboto_bold_35
size: 35
glyphs:
['&', '@', '!', ',', '.', '"', '%', '(', ')', '+', '-', '_', ':', '°', '0',
'1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E',
'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S',
'T', 'U', 'V', 'W', 'X', 'Y', 'Z', ' ', 'a', 'b', 'c', 'd', 'e', 'f',
'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't',
'u', 'v', 'w', 'x', 'y', 'z','å', 'ä', 'ö', '/','º','µ','³']
- file: 'fonts/materialdesignicons-webfont.ttf'
id: weather_font_80
size: 80
glyphs: [
# Weather
"\U000F0590", # mdi-weather-cloudy
"\U000F0594", # mdi-weather-night
"\U000F0591", # mdi-weather-fog
"\U000F0592", # mdi-weather-hail
"\U000F0593", # mdi-weather-lightning
"\U000F067E", # mdi-weather-lightning-rainy
"\U000F0595", # mdi-weather-partly-cloudy
"\U000F0596", # mdi-weather-pouring
"\U000F0597", # mdi-weather-rainy
"\U000F0598", # mdi-weather-snowy
"\U000F067F", # mdi-weather-snowy-rainy
"\U000F0599", # mdi-weather-sunny
"\U000F059B", # mdi-weather-sunset-down
"\U000F059C", # mdi-weather-sunset-up
"\U000F059D", # mdi-weather-windy
"\U000F059E", # mdi-weather-windy-variant
]
- file: 'fonts/materialdesignicons-webfont.ttf'
id: weather_font_40
size: 40
glyphs: [
# Weather
"\U000F0590", # mdi-weather-cloudy
"\U000F0594", # mdi-weather-night
"\U000F0591", # mdi-weather-fog
"\U000F0592", # mdi-weather-hail
"\U000F0593", # mdi-weather-lightning
"\U000F067E", # mdi-weather-lightning-rainy
"\U000F0595", # mdi-weather-partly-cloudy
"\U000F0596", # mdi-weather-pouring
"\U000F0597", # mdi-weather-rainy
"\U000F0598", # mdi-weather-snowy
"\U000F067F", # mdi-weather-snowy-rainy
"\U000F0599", # mdi-weather-sunny
"\U000F059B", # mdi-weather-sunset-down
"\U000F059C", # mdi-weather-sunset-up
"\U000F059D", # mdi-weather-windy
"\U000F059E", # mdi-weather-windy-variant
]
- file: 'fonts/materialdesignicons-webfont.ttf'
id: wifi_font_30
size: 30
glyphs: [
# Wifi
"\U000F092F", # mdi-wifi-strength-outline
"\U000F091F", # mdi-wifi-strength-1
"\U000F0922", # mdi-wifi-strength-2
"\U000F0925", # mdi-wifi-strength-3
"\U000F0928", # mdi-wifi-strength-4
]
- file: 'fonts/materialdesignicons-webfont.ttf'
id: weather_font_30
size: 30
glyphs: [
# Sun
"\U000F059A", # mdi-weather-sunset
# Moon
"\U000F0F64", # mdi-moon-new
"\U000F0F67", # mdi-moon-waxing-crescent
"\U000F0F61", # mdi-moon-first-quarter
"\U000F0F68", # mdi-moon-waxing-gibbous
"\U000F0F62", # mdi-moon-full
"\U000F0F66", # mdi-moon-waning-gibbous
"\U000F0F63", # mdi-moon-last-quarter
"\U000F0F65", # mdi-moon-waning-crescent
# Rooms
"\U000F09A0", # mdi-shower
"\U000F09A1", # mdi-shower-head
"\U000F04B9", # mdi-sofa
"\U000F0C99", # mdi-microwave
"\U000F0FD1", # mdi-bed-king-outline
"\U000F106E", # mdi-bed-single-outline
"\U000F0322", # mdi-laptop
"\U000F07F4", # mdi-television-classic
]
time:
- platform: homeassistant
id: homeassistant_time
timezone: Europe/Rome
on_time:
# Every 1 minutes
- seconds: 0
then:
- component.update: epaperdisplay
sensor:
- platform: homeassistant
entity_id: sensor.moon
id: moon_stato
internal: true
- platform: wifi_signal
name: "WiFi Signal Sensor"
id: wifisignal
update_interval: 60s
- platform: homeassistant
id: temp_aussen
entity_id: sensor.foxess_ambient_temperature
text_sensor:
- platform: homeassistant
id: moon_icon
entity_id: sensor.moon
spi:
clk_pin: 14
mosi_pin: 13 #DIN
display:
- platform: waveshare_epaper
id: epaperdisplay
cs_pin: 15
dc_pin: 12
update_interval: 120s
busy_pin: 16
reset_pin: 4
model: 4.20in
lambda: |-
/* V Linie */
it.line(120, 0, 120, 300);
/* H Linie */
it.line(120, 75, 400, 75);
it.line(120, 150, 400, 150);
it.line(120, 225, 400, 225);
/* Uhr */
it.strftime(60, 40 , id(roboto_bold_35), TextAlign::BASELINE_CENTER , "%H:%M", id(homeassistant_time).now());
/* Aussentemperatur */
it.printf(200,40, id(roboto_bold_27), TextAlign::BASELINE_CENTER, "%.1f", id(temp_aussen).state);
/* WIFI SIGNAL */
if(id(wifisignal).has_state()) {
int wifi_x = 60;
int wifi_y = 80;
if (id(wifisignal).state >= -50) {
// Excellent
it.print(wifi_x, wifi_y, id(wifi_font_30), TextAlign::BASELINE_CENTER, "\U000F0928");
ESP_LOGI("WiFi", "Exellent");
} else if (id(wifisignal).state >= -60) {
// Good
it.print(wifi_x, wifi_y, id(wifi_font_30), TextAlign::BASELINE_CENTER, "\U000F0925");
ESP_LOGI("WiFi", "Good");
} else if (id(wifisignal).state >= -75) {
// Fair
it.print(wifi_x, wifi_y, id(wifi_font_30), TextAlign::BASELINE_CENTER, "\U000F0922");
ESP_LOGI("WiFi", "Fair");
} else if (id(wifisignal).state >= -100) {
// Weak
it.print(wifi_x, wifi_y, id(wifi_font_30), TextAlign::BASELINE_CENTER, "\U000F091F");
ESP_LOGI("WiFi", "Weak");
} else {
// Unlikely working signal
it.print(wifi_x, wifi_y, id(wifi_font_30), TextAlign::BASELINE_CENTER, "\U000F092F");
ESP_LOGI("WiFi", "Unlikely");
}
}
LOG:
INFO ESPHome 2023.7.1
INFO Reading configuration /config/esphome/epaper-display.yaml...
WARNING GPIO15 is a Strapping PIN and should be avoided.
Attaching external pullup/down resistors to strapping pins can cause unexpected failures.
See https://esphome.io/guides/faq.html#why-am-i-getting-a-warning-about-strapping-pins
WARNING GPIO12 is a Strapping PIN and should be avoided.
Attaching external pullup/down resistors to strapping pins can cause unexpected failures.
See https://esphome.io/guides/faq.html#why-am-i-getting-a-warning-about-strapping-pins
WARNING GPIO4 is a Strapping PIN and should be avoided.
Attaching external pullup/down resistors to strapping pins can cause unexpected failures.
See https://esphome.io/guides/faq.html#why-am-i-getting-a-warning-about-strapping-pins
INFO Starting log output from pool-data.local using esphome API
INFO Successfully connected to pool-data.local
[10:44:27][I][app:102]: ESPHome version 2023.7.1 compiled on Aug 14 2023, 10:42:46
[10:44:27][C][wifi:543]: WiFi:
[10:44:27][C][wifi:379]: Local MAC: A8:42:E3:CE:4A:94
[10:44:27][C][wifi:380]: SSID: [redacted]
[10:44:27][C][wifi:381]: IP Address: 192.168.1.159
[10:44:27][C][wifi:383]: BSSID: [redacted]
[10:44:27][C][wifi:384]: Hostname: 'pool-data'
[10:44:27][C][wifi:386]: Signal strength: -66 dB ▂▄▆█
[10:44:27][C][wifi:390]: Channel: 11
[10:44:27][C][wifi:391]: Subnet: 255.255.255.0
[10:44:27][C][wifi:392]: Gateway: 192.168.1.1
[10:44:27][C][wifi:393]: DNS1: 192.168.1.9
[10:44:27][C][wifi:394]: DNS2: 0.0.0.0
[10:44:27][C][logger:301]: Logger:
[10:44:27][C][logger:302]: Level: DEBUG
[10:44:27][C][logger:303]: Log Baud Rate: 115200
[10:44:27][C][logger:305]: Hardware UART: UART0
[10:44:27][C][spi:125]: SPI bus:
[10:44:27][C][spi:126]: CLK Pin: GPIO14
[10:44:27][C][spi:128]: MOSI Pin: GPIO13
[10:44:27][C][spi:130]: Using HW SPI: YES
[10:44:27][C][homeassistant.time:010]: Home Assistant Time:
[10:44:27][C][homeassistant.time:011]: Timezone: 'CET-1CEST,M3.5.0,M10.5.0/3'
[10:44:27][C][waveshare_epaper:1020]: Waveshare E-Paper
[10:44:27][C][waveshare_epaper:1020]: Rotations: 0 °
[10:44:27][C][waveshare_epaper:1020]: Dimensions: 400px x 300px
[10:44:27][C][waveshare_epaper:1021]: Model: 4.2in
[10:44:27][C][waveshare_epaper:1022]: Reset Pin: GPIO4
[10:44:27][C][waveshare_epaper:1023]: DC Pin: GPIO12
[10:44:27][C][waveshare_epaper:1024]: Busy Pin: GPIO16
[10:44:27][C][waveshare_epaper:1025]: Update Interval: 120.0s
[10:44:27][C][captive_portal:088]: Captive Portal:
[10:44:27][C][mdns:112]: mDNS:
[10:44:27][C][mdns:113]: Hostname: pool-data
[10:44:27][C][ota:093]: Over-The-Air Updates:
[10:44:27][C][ota:094]: Address: pool-data.local:3232
[10:44:27][C][ota:097]: Using Password.
[10:44:27][C][api:138]: API Server:
[10:44:27][C][api:139]: Address: pool-data.local:6053
[10:44:27][C][api:143]: Using noise encryption: NO
[10:44:27][C][wifi_signal.sensor:009]: WiFi Signal 'WiFi Signal Sensor'
[10:44:27][C][wifi_signal.sensor:009]: Device Class: 'signal_strength'
[10:44:27][C][wifi_signal.sensor:009]: State Class: 'measurement'
[10:44:27][C][wifi_signal.sensor:009]: Unit of Measurement: 'dBm'
[10:44:27][C][wifi_signal.sensor:009]: Accuracy Decimals: 0
[10:44:27][C][homeassistant.sensor:030]: Homeassistant Sensor 'moon_stato'
[10:44:27][C][homeassistant.sensor:030]: State Class: ''
[10:44:27][C][homeassistant.sensor:030]: Unit of Measurement: ''
[10:44:27][C][homeassistant.sensor:030]: Accuracy Decimals: 1
[10:44:27][C][homeassistant.sensor:031]: Entity ID: 'sensor.moon'
[10:44:27][C][homeassistant.sensor:030]: Homeassistant Sensor 'temp_aussen'
[10:44:27][C][homeassistant.sensor:030]: State Class: ''
[10:44:27][C][homeassistant.sensor:030]: Unit of Measurement: ''
[10:44:27][C][homeassistant.sensor:030]: Accuracy Decimals: 1
[10:44:27][C][homeassistant.sensor:031]: Entity ID: 'sensor.foxess_ambient_temperature'
[10:44:27][C][homeassistant.text_sensor:023]: Homeassistant Text Sensor 'moon_icon'
[10:44:27][C][homeassistant.text_sensor:024]: Entity ID: 'sensor.moon'
[10:44:57][D][sensor:094]: 'WiFi Signal Sensor': Sending state -65.00000 dBm with 0 decimals of accuracy
[10:45:00][I][WiFi:233]: Fair
[10:45:00][W][component:204]: Component time took a long time for an operation (0.14 s).
[10:45:00][W][component:205]: Components should block for at most 20-30ms.
[10:45:53][I][WiFi:233]: Fair
[10:45:53][W][component:204]: Component waveshare_epaper.display took a long time for an operation (0.14 s).
[10:45:53][W][component:205]: Components should block for at most 20-30ms.
[10:45:57][D][sensor:094]: 'WiFi Signal Sensor': Sending state -63.00000 dBm with 0 decimals of accuracy
[10:46:00][I][WiFi:233]: Fair
[10:46:00][W][component:204]: Component time took a long time for an operation (0.14 s).
[10:46:00][W][component:205]: Components should block for at most 20-30ms.
I may have missed stuff, but what print statement generates the ‘nan’?
it.printf(200,40, id(roboto_bold_27), TextAlign::BASELINE_CENTER, "%2.1fºC", id(temp_aussen).state);
i switched to a ESP8266. now i get this in my LOG
WARNING display.local: Connection error occurred: EOF received
complete LOG
INFO ESPHome 2023.8.0b2
INFO Reading configuration /config/esphome/display.yaml...
INFO Starting log output from display.local using esphome API
WARNING display.local: Connection error occurred: EOF received
WARNING Can't connect to ESPHome API for display.local: Connection closed (APIConnectionError)
INFO Trying to connect to display.local in the background
WARNING display.local: Connection error occurred: [Errno 104] Connection reset by peer
WARNING display.local: Connection error occurred: EOF received
INFO Successfully connected to display.local
[07:47:25][I][app:102]: ESPHome version 2023.8.0b2 compiled on Aug 15 2023, 07:42:11
[07:47:26][C][wifi:543]: WiFi:
[07:47:26][C][wifi:394]: DNS2: 0.0.0.0
[07:47:26][C][logger:301]: Logger:
[07:47:26][C][logger:305]: Hardware UART: UART0
[07:47:26][C][spi:125]: SPI bus:
[07:47:26][C][homeassistant.time:010]: Home Assistant Time:
[07:47:26][C][homeassistant.time:011]: Timezone: 'CET-1CEST,M3.5.0,M10.5.0/3'
[07:47:26][C][waveshare_epaper:1021]: Waveshare E-Paper
[07:47:26][C][waveshare_epaper:1021]: Dimensions: 400px x 300px
[07:47:26][C][waveshare_epaper:1024]: DC Pin: GPIO12
[07:47:26][C][waveshare_epaper:1026]: Update Interval: 120.0s
[07:47:26][C][captive_portal:088]: Captive Portal:
[07:47:26][C][mdns:112]: mDNS:
[07:47:26][C][mdns:113]: Hostname: display
[07:47:26][C][ota:093]: Over-The-Air Updates:
[07:47:26][C][api:138]: API Server:
[07:47:26][C][wifi_signal.sensor:009]: WiFi Signal 'WiFi Signal Sensor'
[07:47:26][C][wifi_signal.sensor:009]: State Class: 'measurement'
[07:47:26][C][wifi_signal.sensor:009]: Accuracy Decimals: 0
[07:47:26][C][homeassistant.sensor:030]: Homeassistant Sensor 'moon_stato'
[07:47:26][C][homeassistant.sensor:030]: Accuracy Decimals: 1
[07:47:26][C][homeassistant.sensor:030]: Homeassistant Sensor 'temp_aussen'
[07:47:26][C][homeassistant.sensor:030]: Unit of Measurement: ''
[07:47:26][C][homeassistant.sensor:031]: Entity ID: 'sensor.foxess_ambient_temperature'
[07:47:26][C][homeassistant.text_sensor:023]: Homeassistant Text Sensor 'moon_icon'
[07:47:56][D][sensor:093]: 'WiFi Signal Sensor': Sending state -58.00000 dBm with 0 decimals of accuracy
[07:48:00][I][WiFi:231]: Good
[07:48:01][W][component:204]: Component time took a long time for an operation (0.16 s).
[07:48:01][W][component:205]: Components should block for at most 20-30ms.
[07:48:23][D][api:102]: Accepted 192.168.1.8
[07:48:48][I][WiFi:231]: Good
[07:48:48][W][component:204]: Component waveshare_epaper.display took a long time for an operation (0.16 s).
[07:48:48][W][component:205]: Components should block for at most 20-30ms.
[07:48:59][D][sensor:093]: 'WiFi Signal Sensor': Sending state -56.00000 dBm with 0 decimals of accuracy
[07:49:00][I][WiFi:231]: Good
[07:49:01][W][component:204]: Component time took a long time for an operation (0.16 s).
[07:49:01][W][component:205]: Components should block for at most 20-30ms.
[07:49:23][D][api:102]: Accepted 192.168.1.8
WARNING display.local: Connection error occurred: EOF received
INFO Processing unexpected disconnect from ESPHome API for display.local
WARNING Disconnected from API
WARNING display.local: Connection error occurred: EOF received
WARNING Can't connect to ESPHome API for display.local: Connection closed (APIConnectionError)
INFO Trying to connect to display.local in the background
WARNING display.local: Connection error occurred: EOF received
WARNING display.local: Connection error occurred: EOF received
WARNING display.local: Connection error occurred: EOF received
WARNING display.local: Connection error occurred: [Errno 104] Connection reset by peer
complete YAML:
esphome:
name: display
friendly_name: display
esp8266:
board: esp01_1m
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: "xxxxx"
ota:
password: "xxxxx"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Display Fallback Hotspot"
password: "xxxxx"
captive_portal:
font:
- file: 'fonts/Roboto-Medium.ttf'
id: roboto_med_17
size: 17
- file: 'fonts/Roboto-Regular.ttf'
id: roboto_reg_12
size: 12
- file: 'fonts/Roboto-Regular.ttf'
id: roboto_reg_15
size: 15
- file: 'fonts/Roboto-Regular.ttf'
id: roboto_reg_20
size: 20
glyphs:
['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D',
'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',
'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', ' ', 'a', 'b', 'c', 'd', 'e',
'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's',
't', 'u', 'v', 'w', 'x', 'y', 'z', 'å', 'ä', 'ö', 'à', 'è', 'ì', 'ò',
'ù']
- file: 'fonts/Roboto-Bold.ttf'
id: roboto_bold_27
size: 27
glyphs:
['&', '@', '!', ',', '.', '"', '%', '(', ')', '+', '-', '_', ':', '°', '0',
'1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E',
'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S',
'T', 'U', 'V', 'W', 'X', 'Y', 'Z', ' ', 'a', 'b', 'c', 'd', 'e', 'f',
'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't',
'u', 'v', 'w', 'x', 'y', 'z','å', 'ä', 'ö', '/','º','µ','³']
- file: 'fonts/Roboto-Bold.ttf'
id: roboto_bold_35
size: 35
glyphs:
['&', '@', '!', ',', '.', '"', '%', '(', ')', '+', '-', '_', ':', '°', '0',
'1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E',
'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S',
'T', 'U', 'V', 'W', 'X', 'Y', 'Z', ' ', 'a', 'b', 'c', 'd', 'e', 'f',
'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't',
'u', 'v', 'w', 'x', 'y', 'z','å', 'ä', 'ö', '/','º','µ','³']
- file: 'fonts/materialdesignicons-webfont.ttf'
id: weather_font_80
size: 80
glyphs: [
# Weather
"\U000F0590", # mdi-weather-cloudy
"\U000F0594", # mdi-weather-night
"\U000F0591", # mdi-weather-fog
"\U000F0592", # mdi-weather-hail
"\U000F0593", # mdi-weather-lightning
"\U000F067E", # mdi-weather-lightning-rainy
"\U000F0595", # mdi-weather-partly-cloudy
"\U000F0596", # mdi-weather-pouring
"\U000F0597", # mdi-weather-rainy
"\U000F0598", # mdi-weather-snowy
"\U000F067F", # mdi-weather-snowy-rainy
"\U000F0599", # mdi-weather-sunny
"\U000F059B", # mdi-weather-sunset-down
"\U000F059C", # mdi-weather-sunset-up
"\U000F059D", # mdi-weather-windy
"\U000F059E", # mdi-weather-windy-variant
]
- file: 'fonts/materialdesignicons-webfont.ttf'
id: weather_font_40
size: 40
glyphs: [
# Weather
"\U000F0590", # mdi-weather-cloudy
"\U000F0594", # mdi-weather-night
"\U000F0591", # mdi-weather-fog
"\U000F0592", # mdi-weather-hail
"\U000F0593", # mdi-weather-lightning
"\U000F067E", # mdi-weather-lightning-rainy
"\U000F0595", # mdi-weather-partly-cloudy
"\U000F0596", # mdi-weather-pouring
"\U000F0597", # mdi-weather-rainy
"\U000F0598", # mdi-weather-snowy
"\U000F067F", # mdi-weather-snowy-rainy
"\U000F0599", # mdi-weather-sunny
"\U000F059B", # mdi-weather-sunset-down
"\U000F059C", # mdi-weather-sunset-up
"\U000F059D", # mdi-weather-windy
"\U000F059E", # mdi-weather-windy-variant
]
- file: 'fonts/materialdesignicons-webfont.ttf'
id: wifi_font_30
size: 30
glyphs: [
# Wifi
"\U000F092F", # mdi-wifi-strength-outline
"\U000F091F", # mdi-wifi-strength-1
"\U000F0922", # mdi-wifi-strength-2
"\U000F0925", # mdi-wifi-strength-3
"\U000F0928", # mdi-wifi-strength-4
]
- file: 'fonts/materialdesignicons-webfont.ttf'
id: weather_font_30
size: 30
glyphs: [
# Sun
"\U000F059A", # mdi-weather-sunset
# Moon
"\U000F0F64", # mdi-moon-new
"\U000F0F67", # mdi-moon-waxing-crescent
"\U000F0F61", # mdi-moon-first-quarter
"\U000F0F68", # mdi-moon-waxing-gibbous
"\U000F0F62", # mdi-moon-full
"\U000F0F66", # mdi-moon-waning-gibbous
"\U000F0F63", # mdi-moon-last-quarter
"\U000F0F65", # mdi-moon-waning-crescent
# Rooms
"\U000F09A0", # mdi-shower
"\U000F09A1", # mdi-shower-head
"\U000F04B9", # mdi-sofa
"\U000F0C99", # mdi-microwave
"\U000F0FD1", # mdi-bed-king-outline
"\U000F106E", # mdi-bed-single-outline
"\U000F0322", # mdi-laptop
"\U000F07F4", # mdi-television-classic
]
time:
- platform: homeassistant
id: homeassistant_time
timezone: Europe/Rome
on_time:
# Every 1 minutes
- seconds: 0
then:
- component.update: epaperdisplay
sensor:
- platform: homeassistant
entity_id: sensor.moon
id: moon_stato
internal: true
- platform: wifi_signal
name: "WiFi Signal Sensor"
id: wifisignal
update_interval: 60s
- platform: homeassistant
id: temp_aussen
entity_id: sensor.foxess_ambient_temperature
text_sensor:
- platform: homeassistant
id: moon_icon
entity_id: sensor.moon
spi:
clk_pin: 14
mosi_pin: 13 #DIN
display:
- platform: waveshare_epaper
id: epaperdisplay
cs_pin: 15
dc_pin: 12
update_interval: 120s
busy_pin: 16
reset_pin: 4
model: 4.20in
lambda: |-
/* V Linie */
it.line(120, 0, 120, 300);
/* H Linie */
it.line(120, 75, 400, 75);
it.line(120, 150, 400, 150);
it.line(120, 225, 400, 225);
/* Uhr */
it.strftime(60, 40 , id(roboto_bold_35), TextAlign::BASELINE_CENTER , "%H:%M", id(homeassistant_time).now());
/* Aussentemperatur */
it.printf(200,40, id(roboto_bold_27), TextAlign::BASELINE_CENTER, "%.1f", id(temp_aussen).state);
/* WIFI SIGNAL */
if(id(wifisignal).has_state()) {
int wifi_x = 60;
int wifi_y = 80;
if (id(wifisignal).state >= -50) {
// Excellent
it.print(wifi_x, wifi_y, id(wifi_font_30), TextAlign::BASELINE_CENTER, "\U000F0928");
ESP_LOGI("WiFi", "Exellent");
} else if (id(wifisignal).state >= -60) {
// Good
it.print(wifi_x, wifi_y, id(wifi_font_30), TextAlign::BASELINE_CENTER, "\U000F0925");
ESP_LOGI("WiFi", "Good");
} else if (id(wifisignal).state >= -75) {
// Fair
it.print(wifi_x, wifi_y, id(wifi_font_30), TextAlign::BASELINE_CENTER, "\U000F0922");
ESP_LOGI("WiFi", "Fair");
} else if (id(wifisignal).state >= -100) {
// Weak
it.print(wifi_x, wifi_y, id(wifi_font_30), TextAlign::BASELINE_CENTER, "\U000F091F");
ESP_LOGI("WiFi", "Weak");
} else {
// Unlikely working signal
it.print(wifi_x, wifi_y, id(wifi_font_30), TextAlign::BASELINE_CENTER, "\U000F092F");
ESP_LOGI("WiFi", "Unlikely");
}
}