Last active
December 30, 2025 21:25
-
-
Save wujku/25c0f501e588df4d066fd5aabb476910 to your computer and use it in GitHub Desktop.
ESPHome Home Assistant HD44780 Display
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| esphome: | |
| name: heat_display | |
| on_boot: | |
| priority: 200 | |
| then: | |
| - wait_until: | |
| condition: | |
| wifi.connected: | |
| timeout: 5s | |
| esp8266: | |
| board: esp12e | |
| logger: | |
| api: | |
| ota: | |
| - platform: esphome | |
| password: "xxxx" | |
| wifi: | |
| ssid: "WiFi SSID" | |
| password: "xxxx" | |
| # Enable fallback hotspot (captive portal) in case wifi connection fails | |
| ap: | |
| ssid: "Heat Display Fallback Hotspot" | |
| password: "xxxx" | |
| captive_portal: | |
| i2c: | |
| sda: GPIO4 | |
| scl: GPIO5 | |
| scan: true | |
| frequency: 200kHz | |
| text_sensor: | |
| - platform: wifi_info | |
| ip_address: | |
| id: ip_addr | |
| sensor: | |
| - platform: homeassistant | |
| id: salon_temp | |
| entity_id: sensor.czujnik_salon_temperatura_2 | |
| internal: true | |
| on_value: | |
| then: | |
| - lambda: |- | |
| static float prev = NAN; | |
| float curr = id(salon_temp).state; | |
| if (!isnan(prev)) { | |
| if (curr > prev + 0.1) id(salon_temp_trend) = 1; | |
| else if (curr < prev - 0.1) id(salon_temp_trend) = -1; | |
| else id(salon_temp_trend) = 0; | |
| } | |
| prev = curr; | |
| - platform: homeassistant | |
| id: salon_hum | |
| entity_id: sensor.czujnik_salon_wilgotnosc_2 | |
| internal: true | |
| on_value: | |
| then: | |
| - lambda: |- | |
| static float prev = NAN; | |
| float curr = id(salon_hum).state; | |
| if (!isnan(prev)) { | |
| if (curr > prev + 0.5) id(salon_hum_trend) = 1; | |
| else if (curr < prev - 0.5) id(salon_hum_trend) = -1; | |
| else id(salon_hum_trend) = 0; | |
| } | |
| prev = curr; | |
| - platform: homeassistant | |
| id: piec_co | |
| entity_id: sensor.co | |
| internal: true | |
| on_value: | |
| then: | |
| - lambda: |- | |
| static float prev = NAN; | |
| float curr = id(piec_co).state; | |
| if (!isnan(prev)) { | |
| if (curr > prev + 0.1) id(piec_co_trend) = 1; | |
| else if (curr < prev - 0.1) id(piec_co_trend) = -1; | |
| else id(piec_co_trend) = 0; | |
| } | |
| prev = curr; | |
| - platform: homeassistant | |
| id: piec_cwu | |
| entity_id: sensor.cwu | |
| internal: true | |
| on_value: | |
| then: | |
| - lambda: |- | |
| static float prev = NAN; | |
| float curr = id(piec_cwu).state; | |
| if (!isnan(prev)) { | |
| if (curr > prev + 0.1) id(piec_cwu_trend) = 1; | |
| else if (curr < prev - 0.1) id(piec_cwu_trend) = -1; | |
| else id(piec_cwu_trend) = 0; | |
| } | |
| prev = curr; | |
| - platform: homeassistant | |
| id: osuszacz_power | |
| entity_id: sensor.ikea_of_sweden_inspelning_smart_plug_moc | |
| internal: true | |
| - platform: homeassistant | |
| id: biuro_temp | |
| entity_id: sensor.czujnik_sonoff_biuro_temperatura_2 | |
| internal: true | |
| on_value: | |
| then: | |
| - lambda: |- | |
| static float prev = NAN; | |
| float curr = id(biuro_temp).state; | |
| if (!isnan(prev)) { | |
| if (curr > prev + 0.1) id(biuro_temp_trend) = 1; | |
| else if (curr < prev - 0.1) id(biuro_temp_trend) = -1; | |
| else id(biuro_temp_trend) = 0; | |
| } | |
| prev = curr; | |
| - platform: homeassistant | |
| id: biuro_hum | |
| entity_id: sensor.czujnik_sonoff_biuro_wilgotnosc_2 | |
| internal: true | |
| on_value: | |
| then: | |
| - lambda: |- | |
| static float prev = NAN; | |
| float curr = id(biuro_hum).state; | |
| if (!isnan(prev)) { | |
| if (curr > prev + 0.1) id(biuro_hum_trend) = 1; | |
| else if (curr < prev - 0.1) id(biuro_hum_trend) = -1; | |
| else id(biuro_hum_trend) = 0; | |
| } | |
| prev = curr; | |
| - platform: homeassistant | |
| id: lazienka_temp | |
| entity_id: sensor.czujnik_lazienka_temperatura | |
| internal: true | |
| on_value: | |
| then: | |
| - lambda: |- | |
| static float prev = NAN; | |
| float curr = id(lazienka_temp).state; | |
| if (!isnan(prev)) { | |
| if (curr > prev + 0.1) id(lazienka_temp_trend) = 1; | |
| else if (curr < prev - 0.1) id(lazienka_temp_trend) = -1; | |
| else id(lazienka_temp_trend) = 0; | |
| } | |
| prev = curr; | |
| - platform: homeassistant | |
| id: lazienka_hum | |
| entity_id: sensor.czujnik_lazienka_wilgotnosc | |
| internal: true | |
| on_value: | |
| then: | |
| - lambda: |- | |
| static float prev = NAN; | |
| float curr = id(lazienka_hum).state; | |
| if (!isnan(prev)) { | |
| if (curr > prev + 0.1) id(lazienka_hum_trend) = 1; | |
| else if (curr < prev - 0.1) id(lazienka_hum_trend) = -1; | |
| else id(lazienka_hum_trend) = 0; | |
| } | |
| prev = curr; | |
| - platform: wifi_signal | |
| id: wifi_rssi | |
| update_interval: 10s | |
| globals: | |
| - id: screen | |
| type: int | |
| restore_value: no | |
| initial_value: '0' | |
| # Trendy dla temperatury | |
| - id: salon_temp_trend | |
| type: int | |
| initial_value: '0' | |
| - id: biuro_temp_trend | |
| type: int | |
| initial_value: '0' | |
| - id: lazienka_temp_trend | |
| type: int | |
| initial_value: '0' | |
| # Trendy dla wilgotności | |
| - id: salon_hum_trend | |
| type: int | |
| initial_value: '0' | |
| - id: biuro_hum_trend | |
| type: int | |
| initial_value: '0' | |
| - id: lazienka_hum_trend | |
| type: int | |
| initial_value: '0' | |
| # Trendy dla kotłowni | |
| - id: piec_co_trend | |
| type: int | |
| initial_value: '0' | |
| - id: piec_cwu_trend | |
| type: int | |
| initial_value: '0' | |
| interval: | |
| - interval: 5s | |
| then: | |
| - lambda: |- | |
| id(screen) = (id(screen) + 1) % 2; | |
| display: | |
| - platform: lcd_pcf8574 | |
| dimensions: 20x4 | |
| address: 0x27 | |
| update_interval: 1s | |
| user_characters: | |
| # Arrow up | |
| - position: 0 | |
| data: | |
| - 0b00100 | |
| - 0b01110 | |
| - 0b11111 | |
| - 0b00100 | |
| - 0b00100 | |
| - 0b00100 | |
| - 0b00100 | |
| - 0b00000 | |
| # Arrow down | |
| - position: 1 | |
| data: | |
| - 0b00100 | |
| - 0b00100 | |
| - 0b00100 | |
| - 0b00100 | |
| - 0b11111 | |
| - 0b01110 | |
| - 0b00100 | |
| - 0b00000 | |
| - position: 2 | |
| data: | |
| - 0b00100 | |
| - 0b01000 | |
| - 0b11111 | |
| - 0b01001 | |
| - 0b00101 | |
| - 0b11111 | |
| - 0b00010 | |
| - 0b00100 | |
| - position: 3 | |
| data: | |
| - 0b00100 | |
| - 0b00100 | |
| - 0b01010 | |
| - 0b01010 | |
| - 0b10001 | |
| - 0b10001 | |
| - 0b10001 | |
| - 0b01110 | |
| lambda: |- | |
| it.clear(); | |
| switch (id(screen)) { | |
| // ===== INFO ===== | |
| case 0: | |
| it.print(0, 0, "SALON"); | |
| it.print(0, 1, "OFFICE"); | |
| it.print(0, 2, "BATH"); | |
| it.print(0, 3, "DRYER"); | |
| // Example: | |
| // "SALON 20.5C^ 100%v" | |
| if (!isnan(id(salon_temp).state) && !isnan(id(salon_hum).state)) { | |
| it.printf(9, 0, "%.1fC %3.0f%%", | |
| id(salon_temp).state, | |
| id(salon_hum).state); | |
| if (id(salon_temp_trend) == 1) it.print(14, 0, "\x08"); | |
| else if (id(salon_temp_trend) == -1) it.print(14, 0, "\x01"); | |
| if (id(salon_hum_trend) == 1) it.print(19, 0, "\x08"); | |
| else if (id(salon_hum_trend) == -1) it.print(19, 0, "\x01"); | |
| it.printf(9, 3, "%dW", (int)id(osuszacz_power).state); | |
| } else { | |
| it.print(9, 0, "Czekam..."); | |
| } | |
| if (!isnan(id(biuro_temp).state) && !isnan(id(biuro_hum).state)) { | |
| it.printf(9, 1, "%.1fC %3.0f%%", | |
| id(biuro_temp).state, | |
| id(biuro_hum).state); | |
| if (id(biuro_temp_trend) == 1) it.print(14, 1, "\x08"); | |
| else if (id(biuro_temp_trend) == -1) it.print(14, 1, "\x01"); | |
| if (id(biuro_hum_trend) == 1) it.print(19, 1, "\x08"); | |
| else if (id(biuro_hum_trend) == -1) it.print(19, 1, "\x01"); | |
| } else { | |
| it.print(9, 1, "Czekam..."); | |
| } | |
| if (!isnan(id(lazienka_temp).state) && !isnan(id(lazienka_hum).state)) { | |
| it.printf(9, 2, "%.1fC %3.0f%%", | |
| id(lazienka_temp).state, | |
| id(lazienka_hum).state); | |
| if (id(lazienka_temp_trend) == 1) it.print(14, 2, "\x08"); | |
| else if (id(lazienka_temp_trend) == -1) it.print(14, 2, "\x01"); | |
| if (id(lazienka_hum_trend) == 1) it.print(19, 2, "\x08"); | |
| else if (id(lazienka_hum_trend) == -1) it.print(19, 2, "\x01"); | |
| } else { | |
| it.print(9, 2, "Czekam..."); | |
| } | |
| break; | |
| // ===== CO ===== | |
| case 1: | |
| it.print(0, 0, "KOTLOWNIA"); | |
| it.print(0, 2, "\x02 CO:"); | |
| it.print(0, 3, "\x03 CWU:"); | |
| if (!isnan(id(piec_co).state) && !isnan(id(piec_cwu).state)) { | |
| it.printf(9, 2, "%.1fC", id(piec_co).state); | |
| it.printf(9, 3, "%.1fC", id(piec_cwu).state); | |
| if (id(piec_co_trend) == 1) it.print(14, 2, "\x08"); | |
| else if (id(piec_co_trend) == -1) it.print(14, 2, "\x01"); | |
| if (id(piec_cwu_trend) == 1) it.print(14, 3, "\x08"); | |
| else if (id(piec_cwu_trend) == -1) it.print(14, 3, "\x01"); | |
| } else { | |
| it.print(9, 2, "Czekam..."); | |
| it.print(9, 3, "Czekam..."); | |
| } | |
| break; | |
| // ===== SYS ===== | |
| case 2: | |
| it.printf(0, 1, "WiFi RSSI: %d dBm", (int)id(wifi_rssi).state); | |
| it.printf(0, 2, "IP: %s", id(ip_addr).state.c_str()); | |
| break; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment