2023-05-27 16:52:05 +02:00
|
|
|
substitutions:
|
2021-10-08 15:58:24 +02:00
|
|
|
name: epaperframe
|
2023-05-27 16:52:05 +02:00
|
|
|
friendly_name: "Info-Dashboard"
|
|
|
|
|
|
|
|
esphome:
|
|
|
|
name: ${name}
|
|
|
|
friendly_name: ${friendly_name}
|
|
|
|
name_add_mac_suffix: false
|
|
|
|
project:
|
|
|
|
name: dashboard.epaper
|
|
|
|
version: "1.0"
|
|
|
|
min_version: 2022.4.0
|
|
|
|
|
2021-10-08 15:58:24 +02:00
|
|
|
on_boot:
|
|
|
|
priority: -10
|
|
|
|
then:
|
|
|
|
- delay: 10s
|
2022-02-20 23:54:28 +01:00
|
|
|
- display.page.show: power # temporary for power page dev
|
2021-10-08 15:58:24 +02:00
|
|
|
- component.update: epaper
|
|
|
|
|
2023-05-27 16:52:05 +02:00
|
|
|
esp32:
|
|
|
|
board: nodemcu-32s
|
|
|
|
framework:
|
|
|
|
type: arduino
|
|
|
|
|
2021-10-08 15:58:24 +02:00
|
|
|
wifi:
|
|
|
|
ssid: "Voltage-legacy"
|
|
|
|
password: !secret voltage_legacy_psk
|
2021-12-31 01:03:51 +01:00
|
|
|
use_address: epaperframe.home
|
2021-10-08 15:58:24 +02:00
|
|
|
power_save_mode: high
|
|
|
|
fast_connect: on
|
|
|
|
|
|
|
|
# Enable fallback hotspot (captive portal) in case wifi connection fails
|
|
|
|
ap:
|
|
|
|
ssid: "Epaperframe Fallback Hotspot"
|
|
|
|
password: !secret fallback_psk
|
|
|
|
|
|
|
|
captive_portal:
|
|
|
|
|
|
|
|
# Enable logging
|
|
|
|
logger:
|
|
|
|
|
|
|
|
# Enable Home Assistant API
|
|
|
|
api:
|
2022-02-20 23:54:28 +01:00
|
|
|
encryption:
|
|
|
|
key: !secret apikey
|
2021-10-08 15:58:24 +02:00
|
|
|
|
|
|
|
ota:
|
|
|
|
password: !secret ota
|
|
|
|
|
2022-04-04 21:16:22 +02:00
|
|
|
# Power key of li-ion charger
|
|
|
|
output:
|
|
|
|
- platform: gpio
|
|
|
|
pin:
|
|
|
|
number: GPIO15
|
|
|
|
inverted: true
|
|
|
|
mode:
|
|
|
|
output: true
|
|
|
|
id: power_key
|
|
|
|
|
2021-10-08 15:58:24 +02:00
|
|
|
# Refresh screen on button click
|
|
|
|
binary_sensor:
|
|
|
|
- platform: gpio
|
|
|
|
pin:
|
|
|
|
number: GPIO18
|
|
|
|
mode: INPUT_PULLUP
|
|
|
|
inverted: True
|
|
|
|
name: "Refresh screen"
|
|
|
|
internal: True
|
2022-02-02 23:43:34 +01:00
|
|
|
on_multi_click:
|
|
|
|
- timing:
|
|
|
|
- ON for at most 1s
|
|
|
|
- OFF for at most 0.3s
|
|
|
|
- ON for at most 1s
|
|
|
|
- OFF for at least 0.2s
|
|
|
|
then:
|
|
|
|
- logger.log:
|
|
|
|
level: INFO
|
|
|
|
format: 'Button doubleclick, rendering next page!'
|
|
|
|
- display.page.show_next: epaper
|
|
|
|
- component.update: epaper
|
|
|
|
- timing:
|
|
|
|
- ON for at most 1s
|
|
|
|
- OFF for at least 0.5s
|
|
|
|
then:
|
|
|
|
- logger.log:
|
|
|
|
level: INFO
|
|
|
|
format: 'Button click, refreshing screen!'
|
|
|
|
- component.update: epaper
|
2021-12-02 15:23:28 +01:00
|
|
|
|
2022-04-09 19:37:25 +02:00
|
|
|
# HA pushbutton configuration
|
|
|
|
button:
|
|
|
|
- platform: template
|
|
|
|
name: Refresh screen
|
|
|
|
id: refresh_button
|
|
|
|
icon: "mdi:refresh"
|
|
|
|
on_press:
|
|
|
|
- logger.log:
|
|
|
|
level: INFO
|
|
|
|
format: 'HA Button click, refreshing screen!'
|
|
|
|
- component.update: epaper
|
|
|
|
- platform: template
|
|
|
|
name: Next screen
|
|
|
|
id: next_button
|
|
|
|
icon: "mdi:skip-next"
|
|
|
|
on_press:
|
|
|
|
- logger.log:
|
|
|
|
level: INFO
|
|
|
|
format: 'HA Button click, rendering next page!'
|
|
|
|
- display.page.show_next: epaper
|
|
|
|
- component.update: epaper
|
|
|
|
|
2021-10-08 15:58:24 +02:00
|
|
|
sensor:
|
|
|
|
# WiFi signal strength
|
|
|
|
- platform: wifi_signal
|
|
|
|
name: "WiFi Signalstärke"
|
|
|
|
id: wifisignal
|
|
|
|
update_interval: 60s
|
2021-12-31 01:03:51 +01:00
|
|
|
|
2021-10-08 15:58:24 +02:00
|
|
|
- platform: homeassistant
|
2023-12-25 00:51:42 +01:00
|
|
|
entity_id: sensor.livingroom_wohnzimmer_feinstaub_pm_2_5_m
|
2021-10-08 15:58:24 +02:00
|
|
|
id: pm25_livingroom
|
|
|
|
|
|
|
|
- platform: homeassistant
|
|
|
|
entity_id: sensor.wohnzimmer_temperatur
|
|
|
|
id: temp_livingroom
|
2021-12-31 01:03:51 +01:00
|
|
|
|
2021-10-08 15:58:24 +02:00
|
|
|
- platform: homeassistant
|
|
|
|
entity_id: sensor.wohnzimmer_luftfeuchtigkeit
|
|
|
|
id: humid_livingroom
|
2021-10-09 02:55:13 +02:00
|
|
|
|
|
|
|
- platform: homeassistant
|
|
|
|
entity_id: sensor.wohnzimmer_co2
|
|
|
|
id: co2_livingroom
|
2021-10-09 04:36:33 +02:00
|
|
|
|
|
|
|
- platform: homeassistant
|
2023-12-25 00:51:42 +01:00
|
|
|
entity_id: sensor.sleepingroom_feinstaub_pm_2_5_m
|
2021-10-09 04:36:33 +02:00
|
|
|
id: pm25_sleepingroom
|
|
|
|
|
|
|
|
- platform: homeassistant
|
|
|
|
entity_id: sensor.schlafzimmer_temperatur
|
|
|
|
id: temp_sleepingroom
|
2021-12-31 01:03:51 +01:00
|
|
|
|
2021-10-09 04:36:33 +02:00
|
|
|
- platform: homeassistant
|
|
|
|
entity_id: sensor.schlafzimmer_luftfeuchtigkeit
|
|
|
|
id: humid_sleepingroom
|
|
|
|
|
|
|
|
- platform: homeassistant
|
|
|
|
entity_id: sensor.schlafzimmer_co2
|
|
|
|
id: co2_sleepingroom
|
2021-12-31 01:03:51 +01:00
|
|
|
|
2021-10-08 15:58:24 +02:00
|
|
|
- platform: homeassistant
|
2023-12-25 00:51:42 +01:00
|
|
|
entity_id: sensor.aussentemperatur
|
2021-10-08 15:58:24 +02:00
|
|
|
id: temp_outdoor
|
2021-12-31 01:03:51 +01:00
|
|
|
|
2021-10-08 15:58:24 +02:00
|
|
|
- platform: homeassistant
|
2023-12-25 00:51:42 +01:00
|
|
|
entity_id: sensor.aussenluftfeuchtigkeit
|
2021-10-08 15:58:24 +02:00
|
|
|
id: humid_outdoor
|
2021-12-31 01:03:51 +01:00
|
|
|
|
2021-10-08 15:58:24 +02:00
|
|
|
- platform: homeassistant
|
2021-12-31 01:03:51 +01:00
|
|
|
entity_id: sensor.luftdruck
|
2021-10-08 15:58:24 +02:00
|
|
|
id: airpressure
|
2021-10-08 16:51:59 +02:00
|
|
|
|
2021-12-31 01:03:51 +01:00
|
|
|
- platform: homeassistant
|
|
|
|
entity_id: sensor.serveraum_temperatur
|
|
|
|
id: temp_serverroom
|
2022-02-20 23:54:28 +01:00
|
|
|
|
|
|
|
- platform: homeassistant
|
2023-05-08 18:15:16 +02:00
|
|
|
entity_id: sensor.netzleistung
|
2022-02-20 23:54:28 +01:00
|
|
|
id: power_total
|
|
|
|
|
|
|
|
- platform: homeassistant
|
|
|
|
entity_id: sensor.serverraum_power
|
|
|
|
id: power_serverroom
|
2022-04-09 21:44:35 +02:00
|
|
|
|
|
|
|
- platform: homeassistant
|
|
|
|
entity_id: sensor.schreibtisch_power
|
|
|
|
id: desk_livingroom
|
|
|
|
|
|
|
|
- platform: homeassistant
|
|
|
|
entity_id: sensor.wohnzimmer_heimkino_power
|
|
|
|
id: media_livingroom
|
|
|
|
|
2022-04-09 23:55:48 +02:00
|
|
|
- platform: homeassistant
|
|
|
|
entity_id: sensor.schlafzimmer_bett_power
|
|
|
|
id: bedlight_sleepingroom
|
|
|
|
|
|
|
|
- platform: homeassistant
|
|
|
|
entity_id: sensor.schlafzimmer_heimkino_power
|
|
|
|
id: media_sleepingroom
|
2022-11-05 23:47:51 +01:00
|
|
|
|
|
|
|
- platform: homeassistant
|
|
|
|
entity_id: sensor.radioaktive_strahlungsleistung
|
|
|
|
id: radiation
|
2022-04-09 23:55:48 +02:00
|
|
|
|
2021-10-08 15:58:24 +02:00
|
|
|
text_sensor:
|
|
|
|
- platform: homeassistant
|
2022-02-20 16:45:59 +01:00
|
|
|
name: "Sun Rising ESP"
|
|
|
|
entity_id: sensor.sun_rising_template
|
|
|
|
id: sun_rising
|
|
|
|
internal: true
|
|
|
|
|
2021-10-09 00:24:20 +02:00
|
|
|
- platform: homeassistant
|
2022-02-20 16:45:59 +01:00
|
|
|
name: "Sun Setting ESP"
|
|
|
|
entity_id: sensor.sun_setting_template
|
|
|
|
id: sun_setting
|
|
|
|
internal: true
|
2021-10-08 15:58:24 +02:00
|
|
|
|
2021-10-08 17:27:03 +02:00
|
|
|
- platform: homeassistant
|
|
|
|
entity_id: sensor.moon
|
|
|
|
id: moonphase
|
|
|
|
|
2021-10-09 22:10:56 +02:00
|
|
|
- platform: homeassistant
|
|
|
|
entity_id: weather.zuhause
|
|
|
|
id: weather
|
|
|
|
|
2021-12-31 21:48:27 +01:00
|
|
|
- platform: homeassistant
|
|
|
|
entity_id: sensor.schlafzimmer_co2_warnstufe
|
|
|
|
id: szco2
|
|
|
|
|
|
|
|
- platform: homeassistant
|
|
|
|
entity_id: sensor.schlafzimmer_feinstaub_warnstufe
|
|
|
|
id: szpm
|
|
|
|
|
|
|
|
- platform: homeassistant
|
|
|
|
entity_id: sensor.wohnzimmer_co2_warnstufe
|
|
|
|
id: wzco2
|
|
|
|
|
|
|
|
- platform: homeassistant
|
|
|
|
entity_id: sensor.wohnzimmer_feinstaub_warnstufe
|
|
|
|
id: wzpm
|
|
|
|
|
2022-02-22 09:51:51 +01:00
|
|
|
graph:
|
|
|
|
- id: line_power_graph
|
|
|
|
sensor: power_total
|
|
|
|
duration: 2h
|
|
|
|
width: 235
|
|
|
|
height: 100
|
|
|
|
|
2021-10-08 15:58:24 +02:00
|
|
|
time:
|
|
|
|
- platform: homeassistant
|
|
|
|
id: homeassistant_time
|
2021-10-09 04:36:33 +02:00
|
|
|
on_time:
|
2022-04-04 21:16:22 +02:00
|
|
|
# Every 10 seconds
|
|
|
|
- seconds: /10
|
|
|
|
then:
|
|
|
|
- logger.log:
|
|
|
|
level: INFO
|
|
|
|
format: 'Power button press'
|
|
|
|
- output.turn_on: power_key
|
|
|
|
- delay: 0.5s
|
|
|
|
- output.turn_off: power_key
|
2022-04-09 21:44:35 +02:00
|
|
|
# Every 10 minutes
|
2021-10-09 04:36:33 +02:00
|
|
|
- seconds: 0
|
|
|
|
minutes: /10
|
|
|
|
then:
|
|
|
|
- logger.log:
|
|
|
|
level: INFO
|
|
|
|
format: 'Timer based screen refresh'
|
|
|
|
- component.update: epaper
|
2021-10-08 15:58:24 +02:00
|
|
|
|
|
|
|
# Font definitions
|
|
|
|
font:
|
|
|
|
- file: 'fonts/Roboto-Medium.ttf'
|
|
|
|
id: roboto_med_30
|
|
|
|
size: 30
|
|
|
|
|
|
|
|
- file: 'fonts/Roboto-Regular.ttf'
|
|
|
|
id: footer_font
|
|
|
|
size: 15
|
|
|
|
glyphs:
|
2021-12-31 21:48:27 +01:00
|
|
|
['&', '@', '!', ',', '.', '"', '%', '(', ')', '+', '-', '_', ':', '°',
|
2021-10-08 15:58:24 +02:00
|
|
|
'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',
|
2021-12-31 21:48:27 +01:00
|
|
|
'u', 'v', 'w', 'x', 'y', 'z', 'Ä', 'ä', 'ö', '/', 'º', 'µ', '³', 'ß',
|
|
|
|
'Ü', 'ü', 'Ö', '0']
|
2021-10-08 15:58:24 +02:00
|
|
|
|
|
|
|
- file: 'fonts/Roboto-Regular.ttf'
|
2021-10-09 14:22:19 +02:00
|
|
|
id: sensor_unit
|
2021-10-08 15:58:24 +02:00
|
|
|
size: 20
|
|
|
|
glyphs:
|
2021-12-31 21:48:27 +01:00
|
|
|
['&', '@', '!', ',', '.', '"', '%', '(', ')', '+', '-', '_', ':', '°',
|
2021-10-08 15:58:24 +02:00
|
|
|
'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',
|
2021-12-31 21:48:27 +01:00
|
|
|
'u', 'v', 'w', 'x', 'y', 'z', 'Ä', 'ä', 'ö', '/', 'º', 'µ', '³', 'ß',
|
|
|
|
'Ü', 'ü', 'Ö', '0']
|
2021-12-31 01:03:51 +01:00
|
|
|
|
2021-10-08 15:58:24 +02:00
|
|
|
- file: 'fonts/Roboto-Medium.ttf'
|
|
|
|
id: sub_sensor_font
|
|
|
|
size: 30
|
|
|
|
glyphs:
|
2021-12-31 21:48:27 +01:00
|
|
|
['&', '@', '!', ',', '.', '"', '%', '(', ')', '+', '-', '_', ':', '°',
|
2021-10-08 15:58:24 +02:00
|
|
|
'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',
|
2021-12-31 21:48:27 +01:00
|
|
|
'u', 'v', 'w', 'x', 'y', 'z', 'Ä', 'ä', 'ö', '/', 'º', 'µ', '³', 'ß',
|
|
|
|
'Ü', 'ü', 'Ö', '0']
|
2021-12-31 01:03:51 +01:00
|
|
|
|
2021-10-08 15:58:24 +02:00
|
|
|
- file: 'fonts/Roboto-Bold.ttf'
|
|
|
|
id: big_sensor_font
|
2021-10-09 02:55:13 +02:00
|
|
|
size: 50
|
2021-12-31 21:48:27 +01:00
|
|
|
glyphs:
|
|
|
|
['&', '@', '!', ',', '.', '"', '%', '(', ')', '+', '-', '_', ':', '°',
|
|
|
|
'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', 'Ä', 'ä', 'ö', '/', 'º', 'µ', '³', 'ß',
|
|
|
|
'Ü', 'ü', 'Ö', '0']
|
2021-12-31 01:03:51 +01:00
|
|
|
|
2021-10-08 15:58:24 +02:00
|
|
|
- file: 'fonts/materialdesignicons-webfont.ttf'
|
|
|
|
id: mdi_small
|
|
|
|
size: 31
|
|
|
|
glyphs: [
|
2021-10-09 02:55:13 +02:00
|
|
|
'', # mdi-thermometer
|
2021-10-08 15:58:24 +02:00
|
|
|
'', # mdi-water-percent
|
2021-10-09 03:02:02 +02:00
|
|
|
'', # mdi-molecule (pm2.5)
|
2021-10-08 15:58:24 +02:00
|
|
|
'', # mdi-co2
|
|
|
|
'', # mdi-gauge (air pressure)
|
|
|
|
'', # mdi-weather-sunny
|
|
|
|
'', # mdi-weather-sunset-down
|
2022-02-20 23:54:28 +01:00
|
|
|
'', # mdi-weather-sunset-up
|
|
|
|
'', # mdi-lightning-bolt
|
2022-02-21 00:43:36 +01:00
|
|
|
'', # mdi-transmission-tower
|
|
|
|
'', # mdi-power-plug
|
|
|
|
'', # mdi-desk
|
2022-11-05 23:47:51 +01:00
|
|
|
'', # mdi-television
|
|
|
|
'' # mdi-radiation
|
2021-10-09 22:10:56 +02:00
|
|
|
]
|
|
|
|
|
|
|
|
- file: 'fonts/materialdesignicons-webfont.ttf'
|
|
|
|
id: mdi_weather
|
|
|
|
size: 80
|
|
|
|
glyphs: [
|
2021-10-08 15:58:24 +02:00
|
|
|
'', # mdi-moon-first-quarter
|
|
|
|
'', # mdi-moon-full
|
|
|
|
'', # mdi-moon-last-quarter
|
|
|
|
'', # mdi-moon-new
|
|
|
|
'', # mdi-moon-waning-crescent
|
|
|
|
'', # mdi-moon-waning-gibbous
|
|
|
|
'', # mdi-moon-waxing-crescent
|
2021-10-09 22:10:56 +02:00
|
|
|
'', # mdi-moon-waxing-gibbous
|
|
|
|
'', # mdi-weather-night
|
|
|
|
'', # mdi-weather-cloudy
|
|
|
|
'', # mdi-weather-fog
|
|
|
|
'', # mdi-weather-hail
|
|
|
|
'', # mdi-weather-lightning
|
|
|
|
'', # mdi-weather-lightning-rainy
|
|
|
|
'', # mdi-weather-partly-cloudy
|
|
|
|
'', # mdi-weather-pouring
|
|
|
|
'', # mdi-weather-rainy
|
|
|
|
'', # mdi-weather-snowy
|
|
|
|
'', # mdi-weather-snowy-rainy
|
|
|
|
'', # mdi-weather-sunny
|
|
|
|
'', # mdi-weather-windy
|
|
|
|
'', # mdi-weather-windy-variant
|
|
|
|
'' # mdi-weather-exceptional
|
2021-10-08 15:58:24 +02:00
|
|
|
]
|
|
|
|
|
|
|
|
- file: 'fonts/materialdesignicons-webfont.ttf'
|
|
|
|
id: mdi_wifi
|
|
|
|
size: 20
|
|
|
|
glyphs: [
|
2021-10-09 02:55:13 +02:00
|
|
|
# WiFi
|
2021-10-08 15:58:24 +02:00
|
|
|
'', # mdi-wifi-strength-alert-outline
|
|
|
|
'', # mdi-wifi-strength-1
|
|
|
|
'', # mdi-wifi-strength-2
|
|
|
|
'', # mdi-wifi-strength-3
|
|
|
|
'' # mdi-wifi-strength-4
|
|
|
|
]
|
|
|
|
|
|
|
|
- file: 'fonts/materialdesignicons-webfont.ttf'
|
|
|
|
id: mdi_med
|
2021-12-31 21:48:27 +01:00
|
|
|
size: 60
|
2021-10-08 15:58:24 +02:00
|
|
|
glyphs: [
|
|
|
|
'' # mdi-alert
|
|
|
|
]
|
|
|
|
|
2021-12-02 15:23:28 +01:00
|
|
|
image:
|
2022-02-20 16:38:45 +01:00
|
|
|
- file: "epaperframe/C1024_logo_flat_bw.png"
|
2021-12-02 15:23:28 +01:00
|
|
|
id: c1024_logo
|
|
|
|
type: binary
|
2022-02-20 19:23:45 +01:00
|
|
|
resize: 77x40
|
2021-12-02 15:23:28 +01:00
|
|
|
|
2021-10-08 15:58:24 +02:00
|
|
|
spi:
|
|
|
|
clk_pin: 23
|
2022-02-02 23:43:34 +01:00
|
|
|
mosi_pin: 22
|
2021-10-08 15:58:24 +02:00
|
|
|
|
|
|
|
display:
|
|
|
|
- platform: waveshare_epaper
|
|
|
|
id: epaper
|
2022-02-02 23:43:34 +01:00
|
|
|
cs_pin: 19
|
|
|
|
dc_pin: 21
|
|
|
|
busy_pin: 16
|
|
|
|
reset_pin: 17
|
2021-10-08 15:58:24 +02:00
|
|
|
model: 7.50in
|
|
|
|
# full_update_every: 30 # not supported on this display
|
|
|
|
update_interval: never
|
2021-12-02 15:23:28 +01:00
|
|
|
pages:
|
|
|
|
- id: environment
|
|
|
|
lambda: |-
|
2021-12-31 01:03:51 +01:00
|
|
|
|
2021-12-02 15:23:28 +01:00
|
|
|
float outdoor_temp = id(temp_outdoor).state;
|
|
|
|
int outdoor_humid = int(id(humid_outdoor).state);
|
|
|
|
float air_pressure = id(airpressure).state;
|
2022-11-05 23:47:51 +01:00
|
|
|
float outdoor_radiation = id(radiation).state;
|
2021-12-02 15:23:28 +01:00
|
|
|
float livingroom_temp = id(temp_livingroom).state;
|
|
|
|
int livingroom_humid = int(id(humid_livingroom).state);
|
|
|
|
int livingroom_pm25 = int(id(pm25_livingroom).state);
|
|
|
|
float livingroom_co2 = id(co2_livingroom).state;
|
|
|
|
float sleepingroom_temp = id(temp_sleepingroom).state;
|
|
|
|
int sleepingroom_humid = int(id(humid_sleepingroom).state);
|
|
|
|
int sleepingroom_pm25 = int(id(pm25_sleepingroom).state);
|
|
|
|
float sleepingroom_co2 = id(co2_sleepingroom).state;
|
|
|
|
float serverroom_temp = id(temp_serverroom).state;
|
|
|
|
int offsetX = 0;
|
|
|
|
int offsetY = 0;
|
|
|
|
|
|
|
|
/* OUTSIDE */
|
|
|
|
it.print(10, 10, id(sensor_unit), "Umwelt");
|
|
|
|
/*
|
2022-02-20 23:54:28 +01:00
|
|
|
Draw the outline of a rectangle with the top left at [86,21],
|
|
|
|
a width of 297 and a height of 3
|
2021-12-02 15:23:28 +01:00
|
|
|
*/
|
|
|
|
it.filled_rectangle(86, 21, 297, 3);
|
|
|
|
|
2022-02-20 19:23:45 +01:00
|
|
|
/* C1024 logo */
|
|
|
|
it.image(10 , 37, id(c1024_logo));
|
|
|
|
|
2022-12-09 07:56:25 +01:00
|
|
|
it.print(10, 130, id(mdi_small), TextAlign::BASELINE_LEFT, ""); // air pressure icon
|
2022-11-05 23:47:51 +01:00
|
|
|
it.print(375, 80, id(mdi_small), TextAlign::BASELINE_CENTER, ""); // thermometer icon
|
2022-12-09 07:56:25 +01:00
|
|
|
it.print(375, 130, id(mdi_small), TextAlign::BASELINE_CENTER, ""); // water percent icon
|
2022-11-05 23:47:51 +01:00
|
|
|
it.print(95, 80, id(mdi_small), TextAlign::BASELINE_LEFT, ""); // radioactive icon
|
|
|
|
|
|
|
|
if(outdoor_radiation > 0 && outdoor_radiation < 100) {
|
|
|
|
it.printf(200, 80, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, "%2.2f", outdoor_radiation);
|
|
|
|
it.print(205, 80, id(sensor_unit), TextAlign::BASELINE_LEFT, "µS/h");
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
it.print(200, 80, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, " - ");
|
|
|
|
it.print(205, 80, id(sensor_unit), TextAlign::BASELINE_LEFT, "µS/h");
|
|
|
|
}
|
2021-12-02 15:23:28 +01:00
|
|
|
|
|
|
|
if(outdoor_temp > -100 && outdoor_temp < 100) {
|
2022-11-05 23:47:51 +01:00
|
|
|
it.printf(357, 80, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, "%2.1fºC", outdoor_temp);
|
2021-12-02 15:23:28 +01:00
|
|
|
}
|
|
|
|
else {
|
2022-11-05 23:47:51 +01:00
|
|
|
it.print(357, 80, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, " - ºC");
|
2021-12-02 15:23:28 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if(outdoor_humid >=0 && outdoor_humid <= 100) {
|
2022-12-09 07:56:25 +01:00
|
|
|
it.printf(357, 130, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, "%3d%%", outdoor_humid);
|
2021-12-02 15:23:28 +01:00
|
|
|
}
|
|
|
|
else {
|
2022-12-09 07:56:25 +01:00
|
|
|
it.print(357, 130, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, " - %");
|
2021-12-02 15:23:28 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if(air_pressure < 1200 && air_pressure >=800) {
|
2022-12-09 07:56:25 +01:00
|
|
|
it.printf(220, 130, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "%4.1f", air_pressure);
|
|
|
|
it.print(225, 130, id(sensor_unit), TextAlign::BASELINE_LEFT, "hPa");
|
2021-12-02 15:23:28 +01:00
|
|
|
}
|
|
|
|
else {
|
2022-12-09 07:56:25 +01:00
|
|
|
it.print(220, 130, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "- ");
|
|
|
|
it.print(225, 130, id(sensor_unit), TextAlign::BASELINE_LEFT, "hPa");
|
2021-12-31 01:03:51 +01:00
|
|
|
}
|
2021-12-02 15:23:28 +01:00
|
|
|
|
|
|
|
|
|
|
|
/* Livingroom */
|
|
|
|
offsetY = 127;
|
|
|
|
it.print(10, 10 + offsetY, id(sensor_unit), "Wohnzimmer");
|
|
|
|
it.filled_rectangle(136, 21 + offsetY, 247, 3);
|
2022-12-09 07:56:25 +01:00
|
|
|
it.print(10, 125 + offsetY, id(mdi_small), TextAlign::BASELINE_LEFT, ""); // PM2.5
|
2021-12-02 15:23:28 +01:00
|
|
|
it.print(375, 75 + offsetY, id(mdi_small), TextAlign::BASELINE_CENTER, ""); // thermometer
|
2022-12-09 07:56:25 +01:00
|
|
|
it.print(375, 125 + offsetY, id(mdi_small), TextAlign::BASELINE_CENTER, ""); // water percent
|
2021-12-02 15:23:28 +01:00
|
|
|
it.print(10, 75 + offsetY, id(mdi_small), TextAlign::BASELINE_LEFT, ""); // CO2
|
2021-12-31 01:03:51 +01:00
|
|
|
|
2021-12-02 15:23:28 +01:00
|
|
|
|
|
|
|
if(livingroom_temp > -100 && livingroom_temp < 100) {
|
|
|
|
it.printf(357, 75 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, "%2.1fºC", livingroom_temp);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
it.print(357, 75 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, " - ºC");
|
|
|
|
}
|
|
|
|
|
|
|
|
if(livingroom_humid >=0 && livingroom_humid <= 100) {
|
2022-12-09 07:56:25 +01:00
|
|
|
it.printf(357, 125 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, "%3d%%", livingroom_humid);
|
2021-12-02 15:23:28 +01:00
|
|
|
}
|
|
|
|
else {
|
2022-12-09 07:56:25 +01:00
|
|
|
it.print(357, 125 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, " - %");
|
2021-12-02 15:23:28 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if(livingroom_co2 >=380 && livingroom_co2 <= 20000) {
|
2022-04-09 19:57:19 +02:00
|
|
|
it.printf(170, 75 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "%4.0f", livingroom_co2);
|
|
|
|
it.print(175, 50 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "ppm");
|
2021-12-02 15:23:28 +01:00
|
|
|
}
|
|
|
|
else {
|
2022-04-09 19:57:19 +02:00
|
|
|
it.print(170, 75 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "- ");
|
|
|
|
it.print(175, 50 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "ppm³");
|
2021-12-02 15:23:28 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if(livingroom_pm25 < 255 && livingroom_pm25 >=0) {
|
2022-12-09 07:56:25 +01:00
|
|
|
it.printf(220, 125 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "%3d", livingroom_pm25);
|
|
|
|
it.print(225, 125 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "µg/m³");
|
2021-12-02 15:23:28 +01:00
|
|
|
}
|
|
|
|
else {
|
2022-12-09 07:56:25 +01:00
|
|
|
it.print(220, 125 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "- ");
|
|
|
|
it.print(225, 125 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "µg/m³");
|
2021-12-02 15:23:28 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Sleepingroom */
|
|
|
|
offsetY = 247;
|
|
|
|
it.print(10, 10 + offsetY, id(sensor_unit), "Schlafzimmer");
|
|
|
|
it.filled_rectangle(144, 21 + offsetY, 239, 3);
|
2022-12-09 07:56:25 +01:00
|
|
|
it.print(10, 124 + offsetY, id(mdi_small), TextAlign::BASELINE_LEFT, ""); // PM2.5
|
2021-12-02 15:23:28 +01:00
|
|
|
it.print(375, 75 + offsetY, id(mdi_small), TextAlign::BASELINE_CENTER, ""); // thermometer
|
2022-12-09 07:56:25 +01:00
|
|
|
it.print(375, 124 + offsetY, id(mdi_small), TextAlign::BASELINE_CENTER, ""); // water percent
|
2021-12-02 15:23:28 +01:00
|
|
|
it.print(10, 75 + offsetY, id(mdi_small), TextAlign::BASELINE_LEFT, ""); // CO2
|
2021-12-31 01:03:51 +01:00
|
|
|
|
2021-12-02 15:23:28 +01:00
|
|
|
|
|
|
|
if(sleepingroom_temp > -100 && sleepingroom_temp < 100) {
|
|
|
|
it.printf(357, 75 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, "%2.1fºC", sleepingroom_temp);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
it.print(357, 75 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, " - ºC");
|
|
|
|
}
|
|
|
|
|
|
|
|
if(sleepingroom_humid >=0 && sleepingroom_humid <= 100) {
|
2022-12-09 07:56:25 +01:00
|
|
|
it.printf(357, 125 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, "%3d%%", sleepingroom_humid);
|
2021-12-02 15:23:28 +01:00
|
|
|
}
|
|
|
|
else {
|
2022-12-09 07:56:25 +01:00
|
|
|
it.print(357, 125 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, " - %");
|
2021-12-02 15:23:28 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if(sleepingroom_co2 >=380 && sleepingroom_co2 <= 20000) {
|
2022-04-09 19:57:19 +02:00
|
|
|
it.printf(170, 75 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "%4.0f", sleepingroom_co2);
|
|
|
|
it.print(175, 50 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "ppm");
|
2021-12-02 15:23:28 +01:00
|
|
|
}
|
|
|
|
else {
|
2022-04-09 19:57:19 +02:00
|
|
|
it.print(170, 75 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "- ");
|
|
|
|
it.print(175, 50 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "ppm³");
|
2021-12-02 15:23:28 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if(sleepingroom_pm25 < 255 && sleepingroom_pm25 >=0) {
|
2022-12-09 07:56:25 +01:00
|
|
|
it.printf(220, 125 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "%3d", sleepingroom_pm25);
|
|
|
|
it.print(225, 125 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "µg/m³");
|
2021-12-02 15:23:28 +01:00
|
|
|
}
|
|
|
|
else {
|
2022-12-09 07:56:25 +01:00
|
|
|
it.print(220, 125 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "- ");
|
|
|
|
it.print(225, 125 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "µg/m³");
|
2021-12-31 01:03:51 +01:00
|
|
|
}
|
2021-12-02 15:23:28 +01:00
|
|
|
|
|
|
|
/* Weather */
|
|
|
|
offsetX = 390;
|
|
|
|
it.print(10 + offsetX, 10, id(sensor_unit), "Wetter");
|
|
|
|
it.filled_rectangle(80 + offsetX, 21, 155, 3);
|
|
|
|
|
|
|
|
/* Current weather */
|
|
|
|
if(id(weather).has_state()) {
|
|
|
|
int x = 227 + offsetX;
|
|
|
|
int y = 116;
|
|
|
|
if (id(weather).state == "clear-night") {
|
|
|
|
// clear night
|
|
|
|
it.print(x, y, id(mdi_weather), TextAlign::BASELINE_RIGHT, "");
|
|
|
|
ESP_LOGI("Weather", "clear night");
|
|
|
|
} else if (id(weather).state == "cloudy") {
|
|
|
|
// cloudy
|
|
|
|
it.print(x, y, id(mdi_weather), TextAlign::BASELINE_RIGHT, "");
|
|
|
|
ESP_LOGI("Weather", "cloudy");
|
|
|
|
} else if (id(weather).state == "fog") {
|
|
|
|
// fog
|
|
|
|
it.print(x, y, id(mdi_weather), TextAlign::BASELINE_RIGHT, "");
|
|
|
|
ESP_LOGI("Weather", "fog");
|
|
|
|
} else if (id(weather).state == "hail") {
|
|
|
|
// hail
|
|
|
|
it.print(x, y, id(mdi_weather), TextAlign::BASELINE_RIGHT, "");
|
|
|
|
ESP_LOGI("Weather", "hail");
|
|
|
|
} else if (id(weather).state == "lightning") {
|
|
|
|
// lightning
|
|
|
|
it.print(x, y, id(mdi_weather), TextAlign::BASELINE_RIGHT, "");
|
|
|
|
ESP_LOGI("Weather", "lightning");
|
|
|
|
} else if (id(weather).state == "lightning-rainy") {
|
|
|
|
// lightning-rainy
|
|
|
|
it.print(x, y, id(mdi_weather), TextAlign::BASELINE_RIGHT, "");
|
|
|
|
ESP_LOGI("Weather", "lightning-rainy");
|
|
|
|
} else if (id(weather).state == "partlycloudy") {
|
|
|
|
// partly cloudy
|
|
|
|
it.print(x, y, id(mdi_weather), TextAlign::BASELINE_RIGHT, "");
|
|
|
|
ESP_LOGI("Weather", "partlycloudy");
|
|
|
|
} else if (id(weather).state == "pouring") {
|
|
|
|
// pouring
|
|
|
|
it.print(x, y, id(mdi_weather), TextAlign::BASELINE_RIGHT, "");
|
|
|
|
ESP_LOGI("Weather", "pouring");
|
|
|
|
} else if (id(weather).state == "rainy") {
|
|
|
|
// rainy
|
|
|
|
it.print(x, y, id(mdi_weather), TextAlign::BASELINE_RIGHT, "");
|
|
|
|
ESP_LOGI("Weather", "rainy");
|
|
|
|
} else if (id(weather).state == "snowy") {
|
|
|
|
// snowy
|
|
|
|
it.print(x, y, id(mdi_weather), TextAlign::BASELINE_RIGHT, "");
|
|
|
|
ESP_LOGI("Weather", "snowy");
|
|
|
|
} else if (id(weather).state == "snowy-rainy") {
|
|
|
|
// snowy-rainy
|
|
|
|
it.print(x, y, id(mdi_weather), TextAlign::BASELINE_RIGHT, "");
|
|
|
|
ESP_LOGI("Weather", "snowy-rainy");
|
|
|
|
} else if (id(weather).state == "sunny") {
|
|
|
|
// sunny
|
|
|
|
it.print(x, y, id(mdi_weather), TextAlign::BASELINE_RIGHT, "");
|
|
|
|
ESP_LOGI("Weather", "sunny");
|
|
|
|
} else if (id(weather).state == "windy") {
|
|
|
|
// windy
|
|
|
|
it.print(x, y, id(mdi_weather), TextAlign::BASELINE_RIGHT, "");
|
|
|
|
ESP_LOGI("Weather", "windy");
|
|
|
|
} else if (id(weather).state == "windy-variant") {
|
|
|
|
// windy variant
|
|
|
|
it.print(x, y, id(mdi_weather), TextAlign::BASELINE_RIGHT, "");
|
|
|
|
ESP_LOGI("Weather", "windy variant");
|
|
|
|
} else if (id(weather).state == "exceptional") {
|
|
|
|
// exceptional
|
|
|
|
it.print(x, y, id(mdi_weather), TextAlign::BASELINE_RIGHT, "");
|
|
|
|
ESP_LOGI("Weather", "exceptional");
|
|
|
|
} else {
|
|
|
|
// N/A
|
|
|
|
it.print(x, y, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "-");
|
|
|
|
ESP_LOGE("Weather", "No data");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Moon phase display */
|
|
|
|
if(id(moonphase).has_state()) {
|
|
|
|
int x = 10 + offsetX;
|
2021-12-31 21:48:27 +01:00
|
|
|
int y = 116;
|
2021-12-02 15:23:28 +01:00
|
|
|
if (id(moonphase).state == "new_moon") {
|
|
|
|
// new moon
|
|
|
|
it.print(x, y, id(mdi_weather), TextAlign::BASELINE_LEFT, "");
|
|
|
|
ESP_LOGI("Moonphase", "new moon");
|
|
|
|
} else if (id(moonphase).state == "waxing_crescent") {
|
|
|
|
// waxing crescent
|
|
|
|
it.print(x, y, id(mdi_weather), TextAlign::BASELINE_LEFT, "");
|
|
|
|
ESP_LOGI("Moonphase", "waxing crescent");
|
|
|
|
} else if (id(moonphase).state == "first_quarter") {
|
|
|
|
// first_quarter
|
|
|
|
it.print(x, y, id(mdi_weather), TextAlign::BASELINE_LEFT, "");
|
|
|
|
ESP_LOGI("Moonphase", "first quarter");
|
|
|
|
} else if (id(moonphase).state == "waxing_gibbous") {
|
|
|
|
// waxing gibbous
|
|
|
|
it.print(x, y, id(mdi_weather), TextAlign::BASELINE_LEFT, "");
|
|
|
|
ESP_LOGI("Moonphase", "waxing gibbous");
|
|
|
|
} else if (id(moonphase).state == "full_moon") {
|
|
|
|
// full moon
|
|
|
|
it.print(x, y, id(mdi_weather), TextAlign::BASELINE_LEFT, "");
|
|
|
|
ESP_LOGI("Moonphase", "full moon");
|
|
|
|
} else if (id(moonphase).state == "waning_gibbous") {
|
|
|
|
// waning gibbous
|
|
|
|
it.print(x, y, id(mdi_weather), TextAlign::BASELINE_LEFT, "");
|
|
|
|
ESP_LOGI("Moonphase", "waning gibbous");
|
|
|
|
} else if (id(moonphase).state == "last_quarter") {
|
|
|
|
// last quarter
|
|
|
|
it.print(x, y, id(mdi_weather), TextAlign::BASELINE_LEFT, "");
|
|
|
|
ESP_LOGI("Moonphase", "last quarter");
|
|
|
|
} else if (id(moonphase).state == "waning_crescent") {
|
|
|
|
// waning crescent
|
|
|
|
it.print(x, y, id(mdi_weather), TextAlign::BASELINE_LEFT, "");
|
|
|
|
ESP_LOGI("Moonphase", "waning crescent");
|
|
|
|
} else {
|
|
|
|
// N/A
|
|
|
|
it.print(x, y, id(big_sensor_font), TextAlign::BASELINE_LEFT, "-");
|
|
|
|
ESP_LOGE("Moonphase", "No data");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-12-31 21:48:27 +01:00
|
|
|
/* Warnings */
|
|
|
|
if(id(szco2).state == "rot" || id(szpm).state == "rot" || id(wzco2).state == "rot" || id(wzpm).state == "rot") {
|
|
|
|
it.print(10 + offsetX, 200, id(mdi_med), TextAlign::BASELINE_LEFT, "");
|
|
|
|
it.print(80 + offsetX, 200, id(big_sensor_font), TextAlign::BASELINE_LEFT, "Lüften!");
|
|
|
|
}
|
|
|
|
|
2022-02-20 16:45:59 +01:00
|
|
|
it.print(10 + offsetX, 250, id(mdi_small), TextAlign::BASELINE_LEFT, ""); // sun-up
|
|
|
|
it.printf(50 + offsetX, 250, id(sensor_unit), TextAlign::BASELINE_LEFT, "%s", id(sun_rising).state.c_str());
|
|
|
|
it.print(135 + offsetX, 250, id(mdi_small), TextAlign::BASELINE_LEFT, ""); // sun-down
|
|
|
|
it.printf(175 + offsetX, 250, id(sensor_unit), TextAlign::BASELINE_LEFT, "%s", id(sun_setting).state.c_str());
|
2021-12-02 15:23:28 +01:00
|
|
|
|
|
|
|
/* Serverroom */
|
|
|
|
offsetY = 247;
|
|
|
|
it.print(10 + offsetX, 10 + offsetY, id(sensor_unit), "Serverraum");
|
|
|
|
it.filled_rectangle(125 + offsetX, 21 + offsetY, 110, 3);
|
|
|
|
|
2021-12-31 01:03:51 +01:00
|
|
|
it.print(227 + offsetX, 110 + offsetY, id(mdi_small), TextAlign::BASELINE_CENTER, ""); // thermometer
|
2021-12-02 15:23:28 +01:00
|
|
|
|
|
|
|
if(serverroom_temp > -100 && serverroom_temp < 100) {
|
2021-12-31 01:03:51 +01:00
|
|
|
it.printf(207 + offsetX, 110 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, "ºC");
|
|
|
|
it.printf(170 + offsetX, 110 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "%2.1f", serverroom_temp);
|
2021-12-02 15:23:28 +01:00
|
|
|
}
|
|
|
|
else {
|
2021-12-31 01:03:51 +01:00
|
|
|
it.print(207 + offsetX, 110 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, " - ºC");
|
2021-12-02 15:23:28 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* FOOTER */
|
|
|
|
it.strftime(614, 380, id(footer_font), TextAlign::BASELINE_RIGHT , "Aktualisiert um %d.%m.%Y %H:%M", id(homeassistant_time).now());
|
2021-12-31 01:03:51 +01:00
|
|
|
|
2021-12-02 15:23:28 +01:00
|
|
|
/* WiFi Signal Strenght */
|
|
|
|
if(id(wifisignal).has_state()) {
|
|
|
|
int x = 630;
|
|
|
|
int y = 384;
|
|
|
|
if (id(wifisignal).state >= -50) {
|
2022-02-21 00:43:36 +01:00
|
|
|
// Excellent
|
2021-12-02 15:23:28 +01:00
|
|
|
it.print(x, y, id(mdi_wifi), TextAlign::BASELINE_CENTER, "");
|
|
|
|
ESP_LOGI("WiFi", "Excellent");
|
|
|
|
} else if (id(wifisignal).state >= -60) {
|
2022-02-21 00:43:36 +01:00
|
|
|
// Good
|
2021-12-02 15:23:28 +01:00
|
|
|
it.print(x, y, id(mdi_wifi), TextAlign::BASELINE_CENTER, "");
|
|
|
|
ESP_LOGI("WiFi", "Good");
|
|
|
|
} else if (id(wifisignal).state >= -75) {
|
2022-02-21 00:43:36 +01:00
|
|
|
// Fair
|
2021-12-02 15:23:28 +01:00
|
|
|
it.print(x, y, id(mdi_wifi), TextAlign::BASELINE_CENTER, "");
|
|
|
|
ESP_LOGI("WiFi", "Fair");
|
|
|
|
} else if (id(wifisignal).state >= -100) {
|
2022-02-21 00:43:36 +01:00
|
|
|
// Weak
|
2021-12-02 15:23:28 +01:00
|
|
|
it.print(x, y, id(mdi_wifi), TextAlign::BASELINE_CENTER, "");
|
|
|
|
ESP_LOGI("WiFi", "Weak");
|
|
|
|
} else {
|
2022-02-21 00:43:36 +01:00
|
|
|
// Unlikely working signal
|
2021-12-02 15:23:28 +01:00
|
|
|
it.print(x, y, id(mdi_wifi), TextAlign::BASELINE_CENTER, "");
|
|
|
|
ESP_LOGI("WiFi", "Unlikely");
|
|
|
|
}
|
|
|
|
}
|
2022-02-20 23:54:28 +01:00
|
|
|
- id: power
|
2021-12-02 15:23:28 +01:00
|
|
|
lambda: |-
|
|
|
|
|
2022-02-20 23:54:28 +01:00
|
|
|
float total_power = id(power_total).state;
|
|
|
|
float serverroom_power = id(power_serverroom).state;
|
2022-04-09 21:44:35 +02:00
|
|
|
float livingroom_desk = id(desk_livingroom).state;
|
|
|
|
float livingroom_media = id(media_livingroom).state;
|
2022-04-09 23:55:48 +02:00
|
|
|
float sleepingroom = id(media_sleepingroom).state + id(bedlight_sleepingroom).state;
|
2022-02-20 23:54:28 +01:00
|
|
|
int offsetX = 0;
|
|
|
|
int offsetY = 0;
|
|
|
|
|
|
|
|
/* BASEMENT */
|
|
|
|
it.print(10, 10, id(sensor_unit), "Keller");
|
|
|
|
/*
|
|
|
|
Draw the outline of a rectangle with the top left at [86,21],
|
|
|
|
a width of 297 and a height of 3
|
|
|
|
*/
|
2022-02-22 09:51:51 +01:00
|
|
|
it.filled_rectangle(76, 21, 307, 3);
|
2022-02-20 23:54:28 +01:00
|
|
|
|
|
|
|
/* C1024 logo */
|
|
|
|
it.image(10 , 37, id(c1024_logo));
|
|
|
|
|
|
|
|
/* Livingroom */
|
|
|
|
offsetY = 127;
|
|
|
|
it.print(10, 10 + offsetY, id(sensor_unit), "Wohnzimmer");
|
|
|
|
it.filled_rectangle(136, 21 + offsetY, 247, 3);
|
2022-04-09 21:44:35 +02:00
|
|
|
|
|
|
|
it.print(375, 75 + offsetY, id(mdi_small), TextAlign::BASELINE_CENTER, ""); // power-plug
|
|
|
|
it.print(375, 115 + offsetY, id(mdi_small), TextAlign::BASELINE_CENTER, ""); // power-plug
|
2022-02-20 23:54:28 +01:00
|
|
|
|
2022-04-09 23:55:48 +02:00
|
|
|
it.print(20, 75 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_LEFT, "Schreibtisch");
|
2022-04-09 21:44:35 +02:00
|
|
|
if(livingroom_desk >= 0) {
|
2022-04-09 23:55:48 +02:00
|
|
|
it.printf(357, 75 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, "%2.1f W", livingroom_desk);
|
2022-02-20 23:54:28 +01:00
|
|
|
}
|
|
|
|
else {
|
2022-04-09 21:44:35 +02:00
|
|
|
it.print(357, 75 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, " - W");
|
2022-02-20 23:54:28 +01:00
|
|
|
}
|
|
|
|
|
2022-04-09 23:55:48 +02:00
|
|
|
it.print(20, 115 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_LEFT, "Heimkino");
|
2022-04-09 21:44:35 +02:00
|
|
|
if(livingroom_media >= 0) {
|
2022-04-09 23:55:48 +02:00
|
|
|
it.printf(357, 115 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, "%2.1f W", livingroom_media);
|
2022-02-20 23:54:28 +01:00
|
|
|
}
|
|
|
|
else {
|
2022-04-09 21:44:35 +02:00
|
|
|
it.print(357, 115 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, " - W");
|
2022-02-20 23:54:28 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Sleepingroom */
|
|
|
|
offsetY = 247;
|
|
|
|
it.print(10, 10 + offsetY, id(sensor_unit), "Schlafzimmer");
|
|
|
|
it.filled_rectangle(144, 21 + offsetY, 239, 3);
|
|
|
|
|
2022-04-09 23:55:48 +02:00
|
|
|
it.print(375, 115 + offsetY, id(mdi_small), TextAlign::BASELINE_CENTER, ""); // power-plug
|
2022-02-20 23:54:28 +01:00
|
|
|
|
2022-04-09 23:55:48 +02:00
|
|
|
// it.print(20, 115 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_LEFT, "Heimkino");
|
|
|
|
if(sleepingroom >= 0) {
|
|
|
|
it.printf(357, 115 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, "%2.1f W", sleepingroom);
|
2022-02-20 23:54:28 +01:00
|
|
|
}
|
|
|
|
else {
|
2022-04-09 23:55:48 +02:00
|
|
|
it.print(357, 115 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, " - W");
|
2022-02-20 23:54:28 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* LINEPOWER */
|
|
|
|
offsetX = 390;
|
|
|
|
offsetY = 65;
|
|
|
|
it.print(10 + offsetX, 10, id(sensor_unit), "Gesamt");
|
|
|
|
it.filled_rectangle(90 + offsetX, 21, 155, 3);
|
|
|
|
|
|
|
|
it.print(227 + offsetX, 20 + offsetY, id(mdi_small), TextAlign::BASELINE_CENTER, ""); // transmission-tower
|
|
|
|
|
2022-04-09 21:44:35 +02:00
|
|
|
if(total_power >= 0) {
|
2022-02-20 23:54:28 +01:00
|
|
|
it.printf(207 + offsetX, 20 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, "W");
|
|
|
|
it.printf(170 + offsetX, 20 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "%2.1f", total_power);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
it.print(207 + offsetX, 20 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, " - W");
|
|
|
|
}
|
|
|
|
|
2022-02-22 09:51:51 +01:00
|
|
|
it.graph(10 + offsetX, 30 + offsetY, id(line_power_graph));
|
|
|
|
|
2022-02-20 23:54:28 +01:00
|
|
|
/* Serverroom */
|
|
|
|
offsetY = 247;
|
|
|
|
it.print(10 + offsetX, 10 + offsetY, id(sensor_unit), "Serverraum");
|
|
|
|
it.filled_rectangle(125 + offsetX, 21 + offsetY, 110, 3);
|
|
|
|
|
2022-02-21 00:43:36 +01:00
|
|
|
it.print(227 + offsetX, 110 + offsetY, id(mdi_small), TextAlign::BASELINE_CENTER, ""); // power-plug
|
2022-02-20 23:54:28 +01:00
|
|
|
|
2022-04-09 21:44:35 +02:00
|
|
|
if(serverroom_power >= 0) {
|
2022-02-20 23:54:28 +01:00
|
|
|
it.printf(207 + offsetX, 110 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, "W");
|
|
|
|
it.printf(170 + offsetX, 110 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "%2.1f", serverroom_power);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
it.print(207 + offsetX, 110 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, " - W");
|
|
|
|
}
|
|
|
|
|
|
|
|
/* FOOTER */
|
|
|
|
it.strftime(614, 380, id(footer_font), TextAlign::BASELINE_RIGHT , "Aktualisiert um %d.%m.%Y %H:%M", id(homeassistant_time).now());
|
|
|
|
|
|
|
|
/* WiFi Signal Strenght */
|
|
|
|
if(id(wifisignal).has_state()) {
|
|
|
|
int x = 630;
|
|
|
|
int y = 384;
|
|
|
|
if (id(wifisignal).state >= -50) {
|
2022-02-21 00:43:36 +01:00
|
|
|
// Excellent
|
2022-02-20 23:54:28 +01:00
|
|
|
it.print(x, y, id(mdi_wifi), TextAlign::BASELINE_CENTER, "");
|
|
|
|
ESP_LOGI("WiFi", "Excellent");
|
|
|
|
} else if (id(wifisignal).state >= -60) {
|
2022-02-21 00:43:36 +01:00
|
|
|
// Good
|
2022-02-20 23:54:28 +01:00
|
|
|
it.print(x, y, id(mdi_wifi), TextAlign::BASELINE_CENTER, "");
|
|
|
|
ESP_LOGI("WiFi", "Good");
|
|
|
|
} else if (id(wifisignal).state >= -75) {
|
2022-02-21 00:43:36 +01:00
|
|
|
// Fair
|
2022-02-20 23:54:28 +01:00
|
|
|
it.print(x, y, id(mdi_wifi), TextAlign::BASELINE_CENTER, "");
|
|
|
|
ESP_LOGI("WiFi", "Fair");
|
|
|
|
} else if (id(wifisignal).state >= -100) {
|
2022-02-21 00:43:36 +01:00
|
|
|
// Weak
|
2022-02-20 23:54:28 +01:00
|
|
|
it.print(x, y, id(mdi_wifi), TextAlign::BASELINE_CENTER, "");
|
|
|
|
ESP_LOGI("WiFi", "Weak");
|
|
|
|
} else {
|
2022-02-21 00:43:36 +01:00
|
|
|
// Unlikely working signal
|
2022-02-20 23:54:28 +01:00
|
|
|
it.print(x, y, id(mdi_wifi), TextAlign::BASELINE_CENTER, "");
|
|
|
|
ESP_LOGI("WiFi", "Unlikely");
|
|
|
|
}
|
|
|
|
}
|