Compare commits
25 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d23c6a23a3 | |||
| 166cc3efd5 | |||
| e358c2cffe | |||
| 5d4e8ef40c | |||
| 8dc781a6b1 | |||
| 6c91cc2d59 | |||
| ba2a56a15b | |||
| 9e7684e294 | |||
| 818b06f3d7 | |||
| 99bb2594e2 | |||
| 9104cd8fdc | |||
| 96b88624d9 | |||
| c1ba3012d4 | |||
| e77d9ee8d2 | |||
| bf49633fac | |||
| 99579a30f7 | |||
| 250bfa94bd | |||
| c342efc08f | |||
| 13e58355da | |||
| ee814c4afe | |||
| 6149a9e994 | |||
| 3b7c30634e | |||
| 38da2cebdd | |||
| 3da69c19ab | |||
| 35e7f81224 |
+1
-1
@@ -1 +1 @@
|
|||||||
2026.7.1
|
2026.7.2
|
||||||
+81
-105
@@ -139,10 +139,6 @@
|
|||||||
trigger: time
|
trigger: time
|
||||||
conditions: []
|
conditions: []
|
||||||
actions:
|
actions:
|
||||||
- action: notify.mobile_app_apollo
|
|
||||||
data:
|
|
||||||
message: Lodere es, Lustknabe.
|
|
||||||
title: 420!
|
|
||||||
- data:
|
- data:
|
||||||
title: 420!
|
title: 420!
|
||||||
message: Lodere es, Lustknabe.
|
message: Lodere es, Lustknabe.
|
||||||
@@ -183,6 +179,10 @@
|
|||||||
topic: awtrix_desk/notify
|
topic: awtrix_desk/notify
|
||||||
payload: '{"text": "420, lodere es, Lustknabe!"}'
|
payload: '{"text": "420, lodere es, Lustknabe!"}'
|
||||||
action: mqtt.publish
|
action: mqtt.publish
|
||||||
|
- action: notify.mobile_app_apollo
|
||||||
|
data:
|
||||||
|
message: Lodere es, Lustknabe.
|
||||||
|
title: 420!
|
||||||
mode: single
|
mode: single
|
||||||
- id: '1623911524804'
|
- id: '1623911524804'
|
||||||
alias: TV Anti-Reflexion (undo)
|
alias: TV Anti-Reflexion (undo)
|
||||||
@@ -227,28 +227,28 @@
|
|||||||
action: light.turn_on
|
action: light.turn_on
|
||||||
- data:
|
- data:
|
||||||
cache: true
|
cache: true
|
||||||
media_player_entity_id: media_player.home_assistant_voice_0a7c6b
|
media_player_entity_id: media_player.home_assistant_voice_0a7c6b_media_player
|
||||||
message: Ab ins Bett, Schlafenszeit.
|
message: Ab ins Bett, Schlafenszeit.
|
||||||
target:
|
target:
|
||||||
entity_id: tts.piper
|
entity_id: tts.piper
|
||||||
action: tts.speak
|
|
||||||
enabled: true
|
enabled: true
|
||||||
|
action: tts.speak
|
||||||
- data:
|
- data:
|
||||||
cache: true
|
cache: true
|
||||||
media_player_entity_id: media_player.home_assistant_voice_09c0e7_media_player_2
|
media_player_entity_id: media_player.home_assistant_voice_09c0e7_media_player
|
||||||
message: Ab ins Bett, Schlafenszeit.
|
message: Ab ins Bett, Schlafenszeit.
|
||||||
target:
|
target:
|
||||||
entity_id: tts.piper
|
entity_id: tts.piper
|
||||||
action: tts.speak
|
|
||||||
enabled: true
|
enabled: true
|
||||||
|
action: tts.speak
|
||||||
- data:
|
- data:
|
||||||
cache: true
|
cache: true
|
||||||
media_player_entity_id: media_player.m5stack_atom_echo
|
media_player_entity_id: media_player.m5stack_atom_echo
|
||||||
message: Ab ins Bett, Schlafenszeit.
|
message: Ab ins Bett, Schlafenszeit.
|
||||||
target:
|
target:
|
||||||
entity_id: tts.piper
|
entity_id: tts.piper
|
||||||
action: tts.speak
|
|
||||||
enabled: true
|
enabled: true
|
||||||
|
action: tts.speak
|
||||||
mode: single
|
mode: single
|
||||||
- id: '1623954512941'
|
- id: '1623954512941'
|
||||||
alias: Licht im Schlafzimmer zum Aufwachen einschalten
|
alias: Licht im Schlafzimmer zum Aufwachen einschalten
|
||||||
@@ -278,8 +278,10 @@
|
|||||||
alias: 'Anruf: Beim Klingeln grün blinken'
|
alias: 'Anruf: Beim Klingeln grün blinken'
|
||||||
description: ''
|
description: ''
|
||||||
triggers:
|
triggers:
|
||||||
- entity_id: sensor.fritz_box_7490_call_monitor_dem_commander1024_seine_cloud
|
- entity_id:
|
||||||
to: ringing
|
- sensor.fritz_box_7690_anrufmonitor_dem_commander1024_seine_cloud
|
||||||
|
to:
|
||||||
|
- ringing
|
||||||
trigger: state
|
trigger: state
|
||||||
- entity_id:
|
- entity_id:
|
||||||
- sensor.le2123_phone_state_2
|
- sensor.le2123_phone_state_2
|
||||||
@@ -301,8 +303,8 @@
|
|||||||
- 0
|
- 0
|
||||||
target:
|
target:
|
||||||
entity_id:
|
entity_id:
|
||||||
- light.awtrix_desk_indicator_1
|
- light.awtrix_b8658c_indicator_1
|
||||||
- light.awtrix_kitchen_indicator_1
|
- light.awtrix_528bd4_indicator_1
|
||||||
action: light.turn_on
|
action: light.turn_on
|
||||||
- data:
|
- data:
|
||||||
scene_id: wled_last_state
|
scene_id: wled_last_state
|
||||||
@@ -335,16 +337,18 @@
|
|||||||
- data: {}
|
- data: {}
|
||||||
target:
|
target:
|
||||||
entity_id:
|
entity_id:
|
||||||
- light.awtrix_desk_indicator_1
|
- light.awtrix_b8658c_indicator_1
|
||||||
- light.awtrix_kitchen_indicator_1
|
- light.awtrix_528bd4_indicator_1
|
||||||
action: light.turn_off
|
action: light.turn_off
|
||||||
mode: single
|
mode: single
|
||||||
- id: '1625481640348'
|
- id: '1625481640348'
|
||||||
alias: 'Anruf: Beim Telefonieren Musik pausieren'
|
alias: 'Anruf: Beim Telefonieren Musik pausieren'
|
||||||
description: ''
|
description: ''
|
||||||
triggers:
|
triggers:
|
||||||
- entity_id: sensor.fritz_box_7490_call_monitor_telefonbuch
|
- entity_id:
|
||||||
to: talking
|
- sensor.fritz_box_7690_anrufmonitor_dem_commander1024_seine_cloud
|
||||||
|
to:
|
||||||
|
- talking
|
||||||
trigger: state
|
trigger: state
|
||||||
- entity_id:
|
- entity_id:
|
||||||
- sensor.le2123_phone_state_2
|
- sensor.le2123_phone_state_2
|
||||||
@@ -362,9 +366,8 @@
|
|||||||
- data:
|
- data:
|
||||||
scene_id: media_last_state
|
scene_id: media_last_state
|
||||||
snapshot_entities:
|
snapshot_entities:
|
||||||
- media_player.wohnzimmer_main
|
- media_player.wohnzimmer
|
||||||
- media_player.lg_webos_smart_tv
|
- media_player.lg_webos_smart_tv
|
||||||
- media_player.ccze
|
|
||||||
- media_player.spotify_marcus_scholz
|
- media_player.spotify_marcus_scholz
|
||||||
- media_player.xboxonex
|
- media_player.xboxonex
|
||||||
action: scene.create
|
action: scene.create
|
||||||
@@ -385,7 +388,7 @@
|
|||||||
trigger: state
|
trigger: state
|
||||||
- target:
|
- target:
|
||||||
entity_id:
|
entity_id:
|
||||||
- scene.media_last_state
|
- scene.wled_last_state
|
||||||
action: scene.turn_on
|
action: scene.turn_on
|
||||||
data: {}
|
data: {}
|
||||||
mode: single
|
mode: single
|
||||||
@@ -615,12 +618,33 @@
|
|||||||
action: notify.mobile_app_le2123
|
action: notify.mobile_app_le2123
|
||||||
- data:
|
- data:
|
||||||
cache: true
|
cache: true
|
||||||
media_player_entity_id: media_player.raspiaudio_muse_luxe
|
media_player_entity_id: media_player.home_assistant_voice_0a7c6b_media_player
|
||||||
message: '{{message}}
|
message: '{{message}}
|
||||||
|
|
||||||
'
|
'
|
||||||
target:
|
target:
|
||||||
entity_id: tts.piper
|
entity_id: tts.piper
|
||||||
|
enabled: true
|
||||||
|
action: tts.speak
|
||||||
|
- data:
|
||||||
|
cache: true
|
||||||
|
media_player_entity_id: media_player.home_assistant_voice_09c0e7_media_player
|
||||||
|
message: '{{message}}
|
||||||
|
|
||||||
|
'
|
||||||
|
target:
|
||||||
|
entity_id: tts.piper
|
||||||
|
enabled: true
|
||||||
|
action: tts.speak
|
||||||
|
- data:
|
||||||
|
cache: true
|
||||||
|
media_player_entity_id: media_player.m5stack_atom_echo
|
||||||
|
message: '{{message}}
|
||||||
|
|
||||||
|
'
|
||||||
|
target:
|
||||||
|
entity_id: tts.piper
|
||||||
|
enabled: true
|
||||||
action: tts.speak
|
action: tts.speak
|
||||||
variables:
|
variables:
|
||||||
message: 'Die Außentemperatur ist mit {{states(''sensor.aussentemperatur'')}}
|
message: 'Die Außentemperatur ist mit {{states(''sensor.aussentemperatur'')}}
|
||||||
@@ -665,12 +689,33 @@
|
|||||||
action: notify.mobile_app_le2123
|
action: notify.mobile_app_le2123
|
||||||
- data:
|
- data:
|
||||||
cache: true
|
cache: true
|
||||||
media_player_entity_id: media_player.raspiaudio_muse_luxe
|
media_player_entity_id: media_player.home_assistant_voice_0a7c6b_media_player
|
||||||
message: '{{message}}
|
message: '{{message}}
|
||||||
|
|
||||||
'
|
'
|
||||||
target:
|
target:
|
||||||
entity_id: tts.piper
|
entity_id: tts.piper
|
||||||
|
enabled: true
|
||||||
|
action: tts.speak
|
||||||
|
- data:
|
||||||
|
cache: true
|
||||||
|
media_player_entity_id: media_player.home_assistant_voice_09c0e7_media_player
|
||||||
|
message: '{{message}}
|
||||||
|
|
||||||
|
'
|
||||||
|
target:
|
||||||
|
entity_id: tts.piper
|
||||||
|
enabled: true
|
||||||
|
action: tts.speak
|
||||||
|
- data:
|
||||||
|
cache: true
|
||||||
|
media_player_entity_id: media_player.m5stack_atom_echo
|
||||||
|
message: '{{message}}
|
||||||
|
|
||||||
|
'
|
||||||
|
target:
|
||||||
|
entity_id: tts.piper
|
||||||
|
enabled: true
|
||||||
action: tts.speak
|
action: tts.speak
|
||||||
mode: single
|
mode: single
|
||||||
variables:
|
variables:
|
||||||
@@ -1393,91 +1438,22 @@
|
|||||||
device_id: 6d1be741876624a70ab5b01b54c6fd6f
|
device_id: 6d1be741876624a70ab5b01b54c6fd6f
|
||||||
entity_id: 621e4377a089b7f5d92c7c9f2cc171a1
|
entity_id: 621e4377a089b7f5d92c7c9f2cc171a1
|
||||||
domain: switch
|
domain: switch
|
||||||
- id: '1773000000001'
|
|
||||||
alias: epaperframe - Kalender Events laden
|
- id: epaper_daily_demotivational_quote
|
||||||
description: Ruft alle Events von calendar.privat und calendar.tkrz_kalender für heute und morgen ab und schreibt sie in input_text-Helfer.
|
alias: Epaper tägliches Demotivationszitat
|
||||||
|
description: Wählt täglich ein festes Zitat aus der lokalen Zitatbibliothek aus.
|
||||||
triggers:
|
triggers:
|
||||||
# Täglich um 00:01 neu holen
|
- trigger: homeassistant
|
||||||
|
event: start
|
||||||
- trigger: time
|
- trigger: time
|
||||||
at: '00:01:00'
|
at: "00:00:00"
|
||||||
id: daily
|
conditions: []
|
||||||
actions:
|
actions:
|
||||||
# ── Events für heute (00:00 bis 23:59) holen ──
|
- action: input_select.select_option
|
||||||
- action: calendar.get_events
|
|
||||||
target:
|
target:
|
||||||
entity_id:
|
entity_id: input_select.epaper_demotivationszitat
|
||||||
- calendar.privat
|
|
||||||
- calendar.tkrz_kalender
|
|
||||||
data:
|
data:
|
||||||
start_date_time: "{{ now().replace(hour=0, minute=0, second=0) }}"
|
option: >-
|
||||||
end_date_time: "{{ (now().replace(hour=0, minute=0, second=0) + timedelta(days=1)) }}"
|
{% set quotes = state_attr('input_select.epaper_demotivationszitat', 'options') %}
|
||||||
response_variable: today_evts
|
{{ quotes[(now().strftime('%j') | int - 1) % (quotes | count)] }}
|
||||||
|
mode: single
|
||||||
# ── Events für morgen (00:00 bis 23:59) holen ──
|
|
||||||
- action: calendar.get_events
|
|
||||||
target:
|
|
||||||
entity_id:
|
|
||||||
- calendar.privat
|
|
||||||
- calendar.tkrz_kalender
|
|
||||||
data:
|
|
||||||
start_date_time: "{{ (now() + timedelta(days=1)).replace(hour=0, minute=0, second=0) }}"
|
|
||||||
end_date_time: "{{ (now() + timedelta(days=1)).replace(hour=0, minute=0, second=0) + timedelta(days=1) }}"
|
|
||||||
response_variable: tomorrow_evts
|
|
||||||
|
|
||||||
# ── input_text Helfer schreiben ──
|
|
||||||
- action: input_text.set_value
|
|
||||||
target:
|
|
||||||
entity_id: input_text.kalender_heute_privat
|
|
||||||
data:
|
|
||||||
value: >-
|
|
||||||
{%- set evts = today_evts['calendar.privat']['events'] if 'calendar.privat' in today_evts else [] -%}
|
|
||||||
{%- set items = [] -%}
|
|
||||||
{%- for e in evts[:5] -%}
|
|
||||||
{%- set s = (e['summary'] | default('', true) | string)[:40] if e is mapping and 'summary' in e else '-' -%}
|
|
||||||
{%- set st = e['start'] if e is mapping and 'start' in e else '' -%}
|
|
||||||
{%- set hhmm = st[11:16] if st|length >= 16 else '??' -%}
|
|
||||||
{%- set items = items + [hhmm ~ ' - ' ~ s] -%}
|
|
||||||
{%- endfor -%}
|
|
||||||
{{ items | join('│') if items else '-' }}
|
|
||||||
- action: input_text.set_value
|
|
||||||
target:
|
|
||||||
entity_id: input_text.kalender_heute_arbeit
|
|
||||||
data:
|
|
||||||
value: >-
|
|
||||||
{%- set evts = today_evts['calendar.tkrz_kalender']['events'] if 'calendar.tkrz_kalender' in today_evts else [] -%}
|
|
||||||
{%- set items = [] -%}
|
|
||||||
{%- for e in evts[:5] -%}
|
|
||||||
{%- set s = (e['summary'] | default('', true) | string)[:40] if e is mapping and 'summary' in e else '-' -%}
|
|
||||||
{%- set st = e['start'] if e is mapping and 'start' in e else '' -%}
|
|
||||||
{%- set hhmm = st[11:16] if st|length >= 16 else '??' -%}
|
|
||||||
{%- set items = items + [hhmm ~ ' - ' ~ s] -%}
|
|
||||||
{%- endfor -%}
|
|
||||||
{{ items | join('│') if items else '-' }}
|
|
||||||
- action: input_text.set_value
|
|
||||||
target:
|
|
||||||
entity_id: input_text.kalender_morgen_privat
|
|
||||||
data:
|
|
||||||
value: >-
|
|
||||||
{%- set evts = tomorrow_evts['calendar.privat']['events'] if 'calendar.privat' in tomorrow_evts else [] -%}
|
|
||||||
{%- set items = [] -%}
|
|
||||||
{%- for e in evts[:5] -%}
|
|
||||||
{%- set s = (e['summary'] | default('', true) | string)[:40] if e is mapping and 'summary' in e else '-' -%}
|
|
||||||
{%- set st = e['start'] if e is mapping and 'start' in e else '' -%}
|
|
||||||
{%- set hhmm = st[11:16] if st|length >= 16 else '??' -%}
|
|
||||||
{%- set items = items + [hhmm ~ ' - ' ~ s] -%}
|
|
||||||
{%- endfor -%}
|
|
||||||
{{ items | join('│') if items else '-' }}
|
|
||||||
- action: input_text.set_value
|
|
||||||
target:
|
|
||||||
entity_id: input_text.kalender_morgen_arbeit
|
|
||||||
data:
|
|
||||||
value: >-
|
|
||||||
{%- set evts = tomorrow_evts['calendar.tkrz_kalender']['events'] if 'calendar.tkrz_kalender' in tomorrow_evts else [] -%}
|
|
||||||
{%- set items = [] -%}
|
|
||||||
{%- for e in evts[:5] -%}
|
|
||||||
{%- set s = (e['summary'] | default('', true) | string)[:40] if e is mapping and 'summary' in e else '-' -%}
|
|
||||||
{%- set st = e['start'] if e is mapping and 'start' in e else '' -%}
|
|
||||||
{%- set hhmm = st[11:16] if st|length >= 16 else '??' -%}
|
|
||||||
{%- set items = items + [hhmm ~ ' - ' ~ s] -%}
|
|
||||||
{%- endfor -%}
|
|
||||||
{{ items | join('│') if items else '-' }}
|
|
||||||
|
|||||||
+6
-3
@@ -35,6 +35,12 @@ utility_meter: !include utility_meters.yaml
|
|||||||
mqtt: !include mqtt.yaml
|
mqtt: !include mqtt.yaml
|
||||||
mqtt_statestream: !include mqtt_statestream.yaml
|
mqtt_statestream: !include mqtt_statestream.yaml
|
||||||
|
|
||||||
|
# Calendar data is normalised in a sandboxed script before ESPHome receives it.
|
||||||
|
python_script:
|
||||||
|
|
||||||
|
# Home Assistant-managed e-paper quote library
|
||||||
|
input_select: !include input_select.yaml
|
||||||
|
|
||||||
# Template sensors
|
# Template sensors
|
||||||
template: !include template.yaml
|
template: !include template.yaml
|
||||||
|
|
||||||
@@ -49,9 +55,6 @@ sql:
|
|||||||
# calendar integration
|
# calendar integration
|
||||||
calendar: !include calendars.yaml
|
calendar: !include calendars.yaml
|
||||||
|
|
||||||
# Helpers for epaperframe calendar display
|
|
||||||
input_text: !include text_helpers.yaml
|
|
||||||
|
|
||||||
# DB-recorder configuration
|
# DB-recorder configuration
|
||||||
recorder: !include recorder.yaml
|
recorder: !include recorder.yaml
|
||||||
|
|
||||||
|
|||||||
+247
-235
@@ -1,7 +1,10 @@
|
|||||||
|
# Device identity shared by ESPHome and Home Assistant.
|
||||||
substitutions:
|
substitutions:
|
||||||
name: epaperframe
|
name: epaperframe
|
||||||
friendly_name: "Info-Dashboard"
|
friendly_name: "Info-Dashboard"
|
||||||
|
|
||||||
|
# Startup selects the default page only after Home Assistant has had time to
|
||||||
|
# provide the sensor states needed by its display lambda.
|
||||||
esphome:
|
esphome:
|
||||||
name: ${name}
|
name: ${name}
|
||||||
friendly_name: ${friendly_name}
|
friendly_name: ${friendly_name}
|
||||||
@@ -18,18 +21,19 @@ esphome:
|
|||||||
- display.page.show: calendar # temporary for power page dev
|
- display.page.show: calendar # temporary for power page dev
|
||||||
- component.update: epaper
|
- component.update: epaper
|
||||||
|
|
||||||
|
# ESP32 target and ESP-IDF build settings for the hardware revision in use.
|
||||||
esp32:
|
esp32:
|
||||||
board: nodemcu-32s
|
board: nodemcu-32s
|
||||||
framework:
|
framework:
|
||||||
type: esp-idf
|
type: esp-idf
|
||||||
|
advanced:
|
||||||
|
minimum_chip_revision: "3.0"
|
||||||
|
|
||||||
network:
|
# Network access is required for Home Assistant state delivery and OTA updates.
|
||||||
enable_ipv6: true
|
|
||||||
|
|
||||||
wifi:
|
wifi:
|
||||||
ssid: "Voltage-legacy"
|
ssid: "Voltage-legacy"
|
||||||
password: !secret voltage_legacy_psk
|
password: !secret voltage_legacy_psk
|
||||||
# use_address: epaperframe.home
|
use_address: epaperframe.home
|
||||||
power_save_mode: high
|
power_save_mode: high
|
||||||
fast_connect: on
|
fast_connect: on
|
||||||
min_auth_mode: WPA2
|
min_auth_mode: WPA2
|
||||||
@@ -49,6 +53,16 @@ api:
|
|||||||
encryption:
|
encryption:
|
||||||
key: !secret apikey
|
key: !secret apikey
|
||||||
|
|
||||||
|
# Include ArduinoJson support for the compact calendar event feed.
|
||||||
|
json:
|
||||||
|
|
||||||
|
# Prevent refreshes when Home Assistant republishes unchanged calendar data.
|
||||||
|
globals:
|
||||||
|
- id: last_rendered_calendar_entries
|
||||||
|
type: std::string
|
||||||
|
restore_value: no
|
||||||
|
initial_value: '""'
|
||||||
|
|
||||||
ota:
|
ota:
|
||||||
platform: esphome
|
platform: esphome
|
||||||
password: !secret ota
|
password: !secret ota
|
||||||
@@ -115,6 +129,7 @@ button:
|
|||||||
- display.page.show_next: epaper
|
- display.page.show_next: epaper
|
||||||
- component.update: epaper
|
- component.update: epaper
|
||||||
|
|
||||||
|
# Numeric telemetry received from Home Assistant for the environment dashboard.
|
||||||
sensor:
|
sensor:
|
||||||
# WiFi signal strength
|
# WiFi signal strength
|
||||||
- platform: wifi_signal
|
- platform: wifi_signal
|
||||||
@@ -186,34 +201,13 @@ sensor:
|
|||||||
entity_id: sensor.serverroom_serveraum_temperatur
|
entity_id: sensor.serverroom_serveraum_temperatur
|
||||||
id: temp_serverroom
|
id: temp_serverroom
|
||||||
|
|
||||||
- platform: homeassistant
|
|
||||||
entity_id: sensor.netzleistung
|
|
||||||
id: power_total
|
|
||||||
|
|
||||||
- platform: homeassistant
|
|
||||||
entity_id: sensor.serverraum_power
|
|
||||||
id: power_serverroom
|
|
||||||
|
|
||||||
- platform: homeassistant
|
|
||||||
entity_id: sensor.schreibtisch_power
|
|
||||||
id: desk_livingroom
|
|
||||||
|
|
||||||
- platform: homeassistant
|
|
||||||
entity_id: sensor.wohnzimmer_heimkino_power
|
|
||||||
id: media_livingroom
|
|
||||||
|
|
||||||
- platform: homeassistant
|
|
||||||
entity_id: sensor.schlafzimmer_bett_power
|
|
||||||
id: bedlight_sleepingroom
|
|
||||||
|
|
||||||
- platform: homeassistant
|
|
||||||
entity_id: sensor.schlafzimmer_heimkino_power
|
|
||||||
id: media_sleepingroom
|
|
||||||
|
|
||||||
- platform: homeassistant
|
- platform: homeassistant
|
||||||
entity_id: sensor.radioaktive_strahlungsleistung
|
entity_id: sensor.radioaktive_strahlungsleistung
|
||||||
id: radiation
|
id: radiation
|
||||||
|
|
||||||
|
# Textual Home Assistant state, including the compact calendar payload and quote.
|
||||||
text_sensor:
|
text_sensor:
|
||||||
- platform: homeassistant
|
- platform: homeassistant
|
||||||
name: "Sun Rising ESP"
|
name: "Sun Rising ESP"
|
||||||
@@ -237,34 +231,34 @@ text_sensor:
|
|||||||
entity_id: weather.zuhause
|
entity_id: weather.zuhause
|
||||||
id: weather
|
id: weather
|
||||||
|
|
||||||
# ── Kalender-Ereignisse (from HA input_text helpers) ──
|
# Display-ready JSON produced by the Home Assistant calendar template sensor.
|
||||||
- platform: homeassistant
|
- platform: homeassistant
|
||||||
entity_id: sensor.kalender_heute_privat
|
entity_id: sensor.epaper_kalenderdaten
|
||||||
id: kalender_heute_privat
|
attribute: entries
|
||||||
internal: true
|
id: calendar_entries
|
||||||
|
# Refresh the e-paper only for changed agenda data while the calendar page
|
||||||
|
# is visible; Home Assistant may otherwise republish identical JSON.
|
||||||
|
on_value:
|
||||||
|
then:
|
||||||
|
- if:
|
||||||
|
condition:
|
||||||
|
and:
|
||||||
|
- display.is_displaying_page: calendar
|
||||||
|
- lambda: return x != id(last_rendered_calendar_entries);
|
||||||
|
then:
|
||||||
|
- lambda: id(last_rendered_calendar_entries) = x;
|
||||||
|
- component.update: epaper
|
||||||
|
|
||||||
|
|
||||||
|
# Home Assistant selects one quote per day from its local quote library.
|
||||||
- platform: homeassistant
|
- platform: homeassistant
|
||||||
entity_id: sensor.kalender_heute_arbeit
|
entity_id: sensor.epaper_demotivationszitat
|
||||||
id: kalender_heute_arbeit
|
id: demotivational_quote
|
||||||
internal: true
|
|
||||||
|
|
||||||
- platform: homeassistant
|
|
||||||
entity_id: sensor.kalender_morgen_privat
|
|
||||||
id: kalender_morgen_privat
|
|
||||||
internal: true
|
|
||||||
|
|
||||||
- platform: homeassistant
|
|
||||||
entity_id: sensor.kalender_morgen_arbeit
|
|
||||||
id: kalender_morgen_arbeit
|
|
||||||
internal: true
|
|
||||||
|
|
||||||
graph:
|
|
||||||
- id: line_power_graph
|
|
||||||
sensor: power_total
|
|
||||||
duration: 2h
|
|
||||||
width: 235
|
|
||||||
height: 100
|
|
||||||
|
|
||||||
|
# Time drives panel power maintenance, the environment refresh cadence, and the
|
||||||
|
# midnight redraw that advances the calendar and daily quote.
|
||||||
time:
|
time:
|
||||||
- platform: homeassistant
|
- platform: homeassistant
|
||||||
id: homeassistant_time
|
id: homeassistant_time
|
||||||
@@ -278,21 +272,41 @@ time:
|
|||||||
- output.turn_on: power_key
|
- output.turn_on: power_key
|
||||||
- delay: 0.5s
|
- delay: 0.5s
|
||||||
- output.turn_off: power_key
|
- output.turn_off: power_key
|
||||||
# Every 10 minutes
|
# Environmental readings need their regular refresh. Calendar updates are
|
||||||
|
# instead triggered by changed event data while that page is active.
|
||||||
- seconds: 0
|
- seconds: 0
|
||||||
minutes: /10
|
minutes: /10
|
||||||
|
then:
|
||||||
|
- if:
|
||||||
|
condition:
|
||||||
|
display.is_displaying_page: environment
|
||||||
|
then:
|
||||||
|
- logger.log:
|
||||||
|
level: INFO
|
||||||
|
format: "Timer based environment screen refresh"
|
||||||
|
- component.update: epaper
|
||||||
|
- seconds: 10
|
||||||
|
minutes: 0
|
||||||
|
hours: 0
|
||||||
then:
|
then:
|
||||||
- logger.log:
|
- logger.log:
|
||||||
level: INFO
|
level: INFO
|
||||||
format: "Timer based screen refresh"
|
format: "Update screen on new day"
|
||||||
- component.update: epaper
|
- component.update: epaper
|
||||||
|
|
||||||
|
# Visual assets used by both 1-bit e-paper pages.
|
||||||
# Font definitions
|
# Font definitions
|
||||||
font:
|
font:
|
||||||
- file: "fonts/Roboto-Medium.ttf"
|
- file: "fonts/Roboto-Medium.ttf"
|
||||||
id: roboto_med_30
|
id: roboto_med_30
|
||||||
size: 30
|
size: 30
|
||||||
|
|
||||||
|
# Small, digits-only font used to emphasize the current date in the month grid.
|
||||||
|
- file: "fonts/Roboto-Bold.ttf"
|
||||||
|
id: calendar_day_bold
|
||||||
|
size: 15
|
||||||
|
glyphs: ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
|
||||||
|
|
||||||
- file: "fonts/Roboto-Regular.ttf"
|
- file: "fonts/Roboto-Regular.ttf"
|
||||||
id: footer_font
|
id: footer_font
|
||||||
size: 15
|
size: 15
|
||||||
@@ -741,17 +755,21 @@ font:
|
|||||||
"", # mdi-alert
|
"", # mdi-alert
|
||||||
]
|
]
|
||||||
|
|
||||||
|
# Binary logo stored in firmware for rendering without network access.
|
||||||
image:
|
image:
|
||||||
- file: "epaperframe/C1024_logo_flat_bw.png"
|
- platform: file
|
||||||
|
file: "epaperframe/C1024_logo_flat_bw.png"
|
||||||
id: c1024_logo
|
id: c1024_logo
|
||||||
type: binary
|
type: binary
|
||||||
resize: 77x40
|
resize: 77x40
|
||||||
invert_alpha: True
|
invert_alpha: true
|
||||||
|
|
||||||
|
# Shared SPI bus for the Waveshare e-paper panel.
|
||||||
spi:
|
spi:
|
||||||
clk_pin: 23
|
clk_pin: 23
|
||||||
mosi_pin: 22
|
mosi_pin: 22
|
||||||
|
|
||||||
|
# The two pages draw directly onto the 640x384 1-bit Waveshare e-paper panel.
|
||||||
display:
|
display:
|
||||||
- platform: waveshare_epaper
|
- platform: waveshare_epaper
|
||||||
id: epaper
|
id: epaper
|
||||||
@@ -763,8 +781,11 @@ display:
|
|||||||
# full_update_every: 30 # not supported on this display
|
# full_update_every: 30 # not supported on this display
|
||||||
update_interval: never
|
update_interval: never
|
||||||
pages:
|
pages:
|
||||||
|
# Environmental telemetry dashboard, refreshed on the 10-minute timer.
|
||||||
- id: environment
|
- id: environment
|
||||||
lambda: |-
|
lambda: |-
|
||||||
|
// Snapshot all Home Assistant values once per render so each panel uses
|
||||||
|
// a consistent set of readings throughout this e-paper refresh.
|
||||||
/* Outdoor */
|
/* Outdoor */
|
||||||
float outdoor_temp = id(temp_outdoor).state;
|
float outdoor_temp = id(temp_outdoor).state;
|
||||||
int outdoor_humid = int(id(humid_outdoor).state);
|
int outdoor_humid = int(id(humid_outdoor).state);
|
||||||
@@ -788,10 +809,11 @@ display:
|
|||||||
float childrensroom_co2 = id(co2_childrensroom).state;
|
float childrensroom_co2 = id(co2_childrensroom).state;
|
||||||
int childrensroom_pm25 = int(id(pm25_childrensroom).state);
|
int childrensroom_pm25 = int(id(pm25_childrensroom).state);
|
||||||
|
|
||||||
|
// Reuse one room widget layout by moving its origin across the two-column grid.
|
||||||
int offsetX = 0;
|
int offsetX = 0;
|
||||||
int offsetY = 0;
|
int offsetY = 0;
|
||||||
|
|
||||||
/* OUTSIDE */
|
/* OUTSIDE: logo, headline, and outdoor sensor summary */
|
||||||
it.print(10, 10, id(sensor_unit), "Umwelt");
|
it.print(10, 10, id(sensor_unit), "Umwelt");
|
||||||
/*
|
/*
|
||||||
Draw the outline of a rectangle with the top left at [86,21],
|
Draw the outline of a rectangle with the top left at [86,21],
|
||||||
@@ -1134,213 +1156,203 @@ display:
|
|||||||
ESP_LOGI("WiFi", "Unlikely");
|
ESP_LOGI("WiFi", "Unlikely");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Calendar agenda, month grid, and daily quote; redraws when event JSON changes.
|
||||||
- id: calendar
|
- id: calendar
|
||||||
lambda: |-
|
lambda: |-
|
||||||
/* Fetch today and tomorrow dates */
|
// Use Home Assistant time for all date labels, month calculations, and
|
||||||
|
// the footer, avoiding locale-dependent formatting on the ESP32.
|
||||||
auto now = id(homeassistant_time).now();
|
auto now = id(homeassistant_time).now();
|
||||||
int today_day = now.day_of_month;
|
const char *months[] = {"Januar", "Februar", "März", "April", "Mai", "Juni",
|
||||||
int today_month = now.month;
|
"Juli", "August", "September", "Oktober", "November", "Dezember"};
|
||||||
int today_wday = now.day_of_week; // 0=Sunday .. 6=Saturday
|
const char *weekdays[] = {"Mo", "Di", "Mi", "Do", "Fr", "Sa", "So"};
|
||||||
const char* weekdays[] = {"So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"};
|
|
||||||
const char* today_weekday_str = weekdays[today_wday];
|
|
||||||
int today_year = now.year;
|
|
||||||
|
|
||||||
/* Tomorrow's date */
|
const int year = now.year;
|
||||||
int tomorrow_day = today_day + 1;
|
const int month = now.month;
|
||||||
int tomorrow_month = today_month;
|
const int today = now.day_of_month;
|
||||||
int tomorrow_wday = (today_wday + 1) % 7;
|
|
||||||
const char* tomorrow_weekday_str = weekdays[tomorrow_wday];
|
|
||||||
int tomorrow_year = today_year;
|
|
||||||
|
|
||||||
/* C1024 logo */
|
// Date helpers build a Monday-first month grid and ISO-8601 week numbers
|
||||||
it.image(10, 37, id(c1024_logo));
|
// without relying on platform-specific C library time functions.
|
||||||
|
auto days_in_month = [](int calendar_year, int calendar_month) {
|
||||||
|
const int days[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
|
||||||
|
if (calendar_month == 2) {
|
||||||
|
return (calendar_year % 4 == 0 && (calendar_year % 100 != 0 || calendar_year % 400 == 0)) ? 29 : 28;
|
||||||
|
}
|
||||||
|
return days[calendar_month - 1];
|
||||||
|
};
|
||||||
|
auto weekday_monday = [](int calendar_year, int calendar_month, int day) {
|
||||||
|
const int offsets[] = {0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4};
|
||||||
|
calendar_year -= calendar_month < 3;
|
||||||
|
const int sunday_first = (calendar_year + calendar_year / 4 - calendar_year / 100 +
|
||||||
|
calendar_year / 400 + offsets[calendar_month - 1] + day) % 7;
|
||||||
|
return (sunday_first + 6) % 7;
|
||||||
|
};
|
||||||
|
auto iso_weeks_in_year = [&weekday_monday](int calendar_year) {
|
||||||
|
// 28 December is always in the final ISO week of its year.
|
||||||
|
const int day_of_year = 362 + ((calendar_year % 4 == 0 &&
|
||||||
|
(calendar_year % 100 != 0 || calendar_year % 400 == 0)) ? 1 : 0);
|
||||||
|
const int weekday = weekday_monday(calendar_year, 12, 28) + 1;
|
||||||
|
return (day_of_year - weekday + 10) / 7;
|
||||||
|
};
|
||||||
|
auto iso_week = [&weekday_monday, &days_in_month, &iso_weeks_in_year](int calendar_year, int calendar_month, int day) {
|
||||||
|
int day_of_year = day;
|
||||||
|
for (int current_month = 1; current_month < calendar_month; current_month++) {
|
||||||
|
day_of_year += days_in_month(calendar_year, current_month);
|
||||||
|
}
|
||||||
|
const int weekday = weekday_monday(calendar_year, calendar_month, day) + 1;
|
||||||
|
int week = (day_of_year - weekday + 10) / 7;
|
||||||
|
if (week < 1) return iso_weeks_in_year(calendar_year - 1);
|
||||||
|
if (week > iso_weeks_in_year(calendar_year)) return 1;
|
||||||
|
return week;
|
||||||
|
};
|
||||||
|
|
||||||
/* ── LEFT PANE: Today ── */
|
/* LEFT PANE: agenda */
|
||||||
int leftX = 10;
|
it.image(10, 10, id(c1024_logo));
|
||||||
int leftY = 70; // start below header row
|
it.print(226, 38, id(roboto_med_30), TextAlign::BASELINE_CENTER, "TERMINE");
|
||||||
|
it.line(10, 55, 355, 55);
|
||||||
|
it.line(365, 10, 365, 352);
|
||||||
|
|
||||||
it.print(15 + leftX, 10 + leftY, id(sensor_unit), "Heute");
|
// Parse the compact JSON attribute produced by Home Assistant. The empty
|
||||||
it.filled_rectangle(80 + leftX, 21 + leftY, 240, 3);
|
// and error states below ensure a useful screen while data is unavailable.
|
||||||
|
JsonDocument calendar_doc;
|
||||||
|
const DeserializationError calendar_error = deserializeJson(calendar_doc, id(calendar_entries).state.c_str());
|
||||||
|
JsonArray calendar_days = calendar_doc.as<JsonArray>();
|
||||||
|
int agenda_y = 72;
|
||||||
|
bool has_events = false;
|
||||||
|
bool has_hidden_events = false;
|
||||||
|
|
||||||
/* Today's date strip */
|
if (calendar_error || calendar_days.isNull()) {
|
||||||
it.printf(50 + leftX, 50 + leftY, id(big_sensor_font), "%d", today_day);
|
it.print(18, agenda_y, id(sensor_unit), TextAlign::TOP_LEFT, "Kalenderdaten werden geladen ...");
|
||||||
it.printf(145 + leftX, 45 + leftY, id(sub_sensor_font), "%s.", today_weekday_str);
|
} else if (calendar_days.size() == 0) {
|
||||||
it.printf(205 + leftX, 45 + leftY, id(sensor_unit), "%02d.%04d.", today_month, today_year);
|
it.print(18, agenda_y, id(sensor_unit), TextAlign::TOP_LEFT, "Keine Termine in den nächsten Tagen.");
|
||||||
|
|
||||||
/* Event lines (Privat / Arbeit) */
|
|
||||||
int eventOffsetY = 90;
|
|
||||||
|
|
||||||
// Helper lambda: draw one event line at given Y offset with the given text sensor id
|
|
||||||
// Privat today
|
|
||||||
if (id(kalender_heute_privat).has_state() && !id(kalender_heute_privat).state.empty()) {
|
|
||||||
it.print(10 + leftX, 50 + leftY + eventOffsetY, id(mdi_med), TextAlign::BASELINE_LEFT, "\U0001f32e" );
|
|
||||||
// Split by │ separator and display first line of events
|
|
||||||
auto parts = id(kalender_heute_privat).state.c_str();
|
|
||||||
it.printf(40 + leftX, 50 + leftY + eventOffsetY, id(sub_sensor_font), "%s",
|
|
||||||
id(kalender_heute_privat).state.substr(0, 60).c_str());
|
|
||||||
} else {
|
} else {
|
||||||
it.print(10 + leftX, 50 + leftY + eventOffsetY, id(mdi_med), TextAlign::BASELINE_LEFT, "\U0001f32e" );
|
for (JsonVariant day_variant : calendar_days) {
|
||||||
it.printf(40 + leftX, 50 + leftY + eventOffsetY, id(sub_sensor_font), "Kein Termin");
|
JsonObject day = day_variant.as<JsonObject>();
|
||||||
}
|
JsonArray events = day["events"].as<JsonArray>();
|
||||||
|
if (events.isNull() || events.size() == 0) continue;
|
||||||
|
if (agenda_y + 38 > 345) {
|
||||||
|
has_hidden_events = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
// Arbeit today
|
// A date rail occupies the left edge; event rows start alongside it
|
||||||
if (id(kalender_heute_arbeit).has_state() && !id(kalender_heute_arbeit).state.empty()) {
|
// and stop before the footer rather than overflowing the panel.
|
||||||
it.print(10 + leftX, 85 + leftY + eventOffsetY, id(mdi_med), TextAlign::BASELINE_LEFT, "\U0001f32e" );
|
const int group_y = agenda_y;
|
||||||
it.printf(40 + leftX, 85 + leftY + eventOffsetY, id(sub_sensor_font), "%s",
|
int event_y = group_y;
|
||||||
id(kalender_heute_arbeit).state.substr(0, 60).c_str());
|
const int day_number = day["day"] | 0;
|
||||||
} else {
|
const char *weekday = day["weekday"] | "";
|
||||||
it.print(10 + leftX, 85 + leftY + eventOffsetY, id(mdi_med), TextAlign::BASELINE_LEFT, "\U0001f32e" );
|
it.printf(30, group_y, id(sub_sensor_font), TextAlign::TOP_CENTER, "%d", day_number);
|
||||||
it.printf(40 + leftX, 85 + leftY + eventOffsetY, id(sub_sensor_font), "Kein Termin");
|
it.printf(30, group_y + 28, id(footer_font), TextAlign::TOP_CENTER, "%s", weekday);
|
||||||
}
|
|
||||||
|
|
||||||
/* ── RIGHT PANE: Tomorrow ── */
|
for (JsonVariant event_variant : events) {
|
||||||
int rightX = 315;
|
if (event_y + 33 > 345) {
|
||||||
int rightY = 70;
|
has_hidden_events = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
JsonObject event = event_variant.as<JsonObject>();
|
||||||
|
const char *title = event["title"] | "Ohne Titel";
|
||||||
|
const char *time = event["time"] | "";
|
||||||
|
const char *end_time = event["end"] | "";
|
||||||
|
const char *meta = event["meta"] | "";
|
||||||
|
it.printf(72, event_y, id(sensor_unit), TextAlign::TOP_LEFT, "%s", title);
|
||||||
|
it.printf(350, event_y, id(sensor_unit), TextAlign::TOP_RIGHT, "%s", time);
|
||||||
|
it.printf(72, event_y + 20, id(footer_font), TextAlign::TOP_LEFT, "%s", meta);
|
||||||
|
if (end_time[0] != '\0') {
|
||||||
|
it.printf(350, event_y + 20, id(footer_font), TextAlign::TOP_RIGHT, "%s", end_time);
|
||||||
|
}
|
||||||
|
event_y += 35;
|
||||||
|
has_events = true;
|
||||||
|
}
|
||||||
|
|
||||||
it.print(45 + rightX, 10 + rightY, id(sensor_unit), "Morgen");
|
int group_bottom = event_y;
|
||||||
it.filled_rectangle(130 + rightX, 21 + rightY, 200, 3);
|
if (group_bottom < group_y + 36) group_bottom = group_y + 36;
|
||||||
|
it.line(58, group_y, 58, group_bottom);
|
||||||
/* Date strip */
|
agenda_y = group_bottom + 5;
|
||||||
it.printf(50 + rightX, 50 + rightY, id(big_sensor_font), "%d", tomorrow_day);
|
if (has_hidden_events) break;
|
||||||
it.printf(145 + rightX, 45 + rightY, id(sub_sensor_font), "%s.", tomorrow_weekday_str);
|
|
||||||
it.printf(205 + rightX, 45 + rightY, id(sensor_unit), "%02d.%04d.", tomorrow_month, tomorrow_year);
|
|
||||||
|
|
||||||
/* Event lines (Privat / Arbeit) */
|
|
||||||
// Privat tomorrow
|
|
||||||
if (id(kalender_morgen_privat).has_state() && !id(kalender_morgen_privat).state.empty()) {
|
|
||||||
it.print(10 + rightX, 50 + rightY + eventOffsetY, id(mdi_med), TextAlign::BASELINE_LEFT, "\U0001f32e" );
|
|
||||||
it.printf(40 + rightX, 50 + rightY + eventOffsetY, id(sub_sensor_font), "%s",
|
|
||||||
id(kalender_morgen_privat).state.substr(0, 60).c_str());
|
|
||||||
} else {
|
|
||||||
it.print(10 + rightX, 50 + rightY + eventOffsetY, id(mdi_med), TextAlign::BASELINE_LEFT, "\U0001f32e" );
|
|
||||||
it.printf(40 + rightX, 50 + rightY + eventOffsetY, id(sub_sensor_font), "Kein Termin");
|
|
||||||
}
|
|
||||||
// Arbeit tomorrow
|
|
||||||
if (id(kalender_morgen_arbeit).has_state() && !id(kalender_morgen_arbeit).state.empty()) {
|
|
||||||
it.print(10 + rightX, 85 + rightY + eventOffsetY, id(mdi_med), TextAlign::BASELINE_LEFT, "\U0001f32e" );
|
|
||||||
it.printf(40 + rightX, 85 + rightY + eventOffsetY, id(sub_sensor_font), "%s",
|
|
||||||
id(kalender_morgen_arbeit).state.substr(0, 60).c_str());
|
|
||||||
} else {
|
|
||||||
it.print(10 + rightX, 85 + rightY + eventOffsetY, id(mdi_med), TextAlign::BASELINE_LEFT, "\U0001f32e" );
|
|
||||||
it.printf(40 + rightX, 85 + leftY + eventOffsetY, id(sub_sensor_font), "Kein Termin");
|
|
||||||
}
|
|
||||||
|
|
||||||
/* FOOTER */
|
|
||||||
it.strftime(614, 380, id(footer_font), TextAlign::BASELINE_RIGHT, "Aktualisiert um %d.%m.%Y %H:%M", id(homeassistant_time).now());
|
|
||||||
|
|
||||||
/* WiFi Signal strength */
|
|
||||||
if(id(wifisignal).has_state()) {
|
|
||||||
int x = 630;
|
|
||||||
int y = 384;
|
|
||||||
if (id(wifisignal).state >= -50) {
|
|
||||||
it.print(x, y, id(mdi_wifi), TextAlign::BASELINE_CENTER, "");
|
|
||||||
} else if (id(wifisignal).state >= -60) {
|
|
||||||
it.print(x, y, id(mdi_wifi), TextAlign::BASELINE_CENTER, "");
|
|
||||||
} else if (id(wifisignal).state >= -75) {
|
|
||||||
it.print(x, y, id(mdi_wifi), TextAlign::BASELINE_CENTER, "");
|
|
||||||
} else if (id(wifisignal).state >= -100) {
|
|
||||||
it.print(x, y, id(mdi_wifi), TextAlign::BASELINE_CENTER, "");
|
|
||||||
} else {
|
|
||||||
it.print(x, y, id(mdi_wifi), TextAlign::BASELINE_CENTER, "");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- id: power
|
if (!has_events && !calendar_error && !calendar_days.isNull() && calendar_days.size() > 0) {
|
||||||
lambda: |-
|
it.print(18, 72, id(sensor_unit), TextAlign::TOP_LEFT, "Keine Termine im sichtbaren Bereich.");
|
||||||
|
|
||||||
float total_power = id(power_total).state;
|
|
||||||
float serverroom_power = id(power_serverroom).state;
|
|
||||||
float livingroom_desk = id(desk_livingroom).state;
|
|
||||||
float livingroom_media = id(media_livingroom).state;
|
|
||||||
float sleepingroom = id(media_sleepingroom).state + id(bedlight_sleepingroom).state;
|
|
||||||
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
|
|
||||||
*/
|
|
||||||
it.filled_rectangle(76, 21, 307, 3);
|
|
||||||
|
|
||||||
/* 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);
|
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
it.print(20, 75 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_LEFT, "Schreibtisch");
|
|
||||||
if(livingroom_desk >= 0) {
|
|
||||||
it.printf(357, 75 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, "%2.1f W", livingroom_desk);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
it.print(357, 75 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, " - W");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
it.print(20, 115 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_LEFT, "Heimkino");
|
|
||||||
if(livingroom_media >= 0) {
|
/* RIGHT TOP: month view, Monday-first with ISO week numbers */
|
||||||
it.printf(357, 115 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, "%2.1f W", livingroom_media);
|
// Draw only the five or six rows this month actually needs so no orphan
|
||||||
}
|
// week number is rendered beneath shorter months.
|
||||||
else {
|
char month_title[24];
|
||||||
it.print(357, 115 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, " - W");
|
snprintf(month_title, sizeof(month_title), "%s %d", months[month - 1], year);
|
||||||
|
it.printf(502, 18, id(sensor_unit), TextAlign::TOP_CENTER, "%s", month_title);
|
||||||
|
it.print(384, 47, id(footer_font), TextAlign::TOP_CENTER, "KW");
|
||||||
|
for (int column = 0; column < 7; column++) {
|
||||||
|
it.printf(415 + column * 30, 47, id(footer_font), TextAlign::TOP_CENTER, "%s", weekdays[column]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Sleepingroom */
|
const int first_weekday = weekday_monday(year, month, 1);
|
||||||
offsetY = 247;
|
const int month_days = days_in_month(year, month);
|
||||||
it.print(10, 10 + offsetY, id(sensor_unit), "Schlafzimmer");
|
const int calendar_rows = (first_weekday + month_days + 6) / 7;
|
||||||
it.filled_rectangle(144, 21 + offsetY, 239, 3);
|
for (int row = 0; row < calendar_rows; row++) {
|
||||||
|
const int monday_day = 1 - first_weekday + row * 7;
|
||||||
|
int week_year = year;
|
||||||
|
int week_month = month;
|
||||||
|
int week_day = monday_day;
|
||||||
|
if (week_day < 1) {
|
||||||
|
week_month--;
|
||||||
|
if (week_month == 0) {
|
||||||
|
week_month = 12;
|
||||||
|
week_year--;
|
||||||
|
}
|
||||||
|
week_day += days_in_month(week_year, week_month);
|
||||||
|
} else if (week_day > month_days) {
|
||||||
|
week_day -= month_days;
|
||||||
|
week_month++;
|
||||||
|
if (week_month == 13) {
|
||||||
|
week_month = 1;
|
||||||
|
week_year++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const int cell_y = 69 + row * 23;
|
||||||
|
it.printf(384, cell_y, id(footer_font), TextAlign::TOP_CENTER, "%02d", iso_week(week_year, week_month, week_day));
|
||||||
|
|
||||||
it.print(375, 115 + offsetY, id(mdi_small), TextAlign::BASELINE_CENTER, ""); // power-plug
|
for (int column = 0; column < 7; column++) {
|
||||||
|
const int day = row * 7 + column - first_weekday + 1;
|
||||||
// it.print(20, 115 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_LEFT, "Heimkino");
|
if (day < 1 || day > month_days) continue;
|
||||||
if(sleepingroom >= 0) {
|
const int cell_x = 415 + column * 30;
|
||||||
it.printf(357, 115 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, "%2.1f W", sleepingroom);
|
if (day == today) {
|
||||||
}
|
it.filled_rectangle(cell_x - 12, cell_y - 2, 25, 18, COLOR_ON);
|
||||||
else {
|
it.printf(cell_x, cell_y, id(calendar_day_bold), COLOR_OFF, TextAlign::TOP_CENTER, "%d", day);
|
||||||
it.print(357, 115 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, " - W");
|
} else {
|
||||||
|
it.printf(cell_x, cell_y, id(footer_font), TextAlign::TOP_CENTER, "%d", day);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* LINEPOWER */
|
/* RIGHT BOTTOM: daily quote selected by Home Assistant */
|
||||||
offsetX = 390;
|
// Wrap on word boundaries into the fixed four-line, inverted quote panel.
|
||||||
offsetY = 65;
|
it.filled_rectangle(375, 220, 255, 130, COLOR_ON);
|
||||||
it.print(10 + offsetX, 10, id(sensor_unit), "Gesamt");
|
std::string quote = "Zitat wird geladen.";
|
||||||
it.filled_rectangle(90 + offsetX, 21, 155, 3);
|
if (id(demotivational_quote).has_state() && !id(demotivational_quote).state.empty()) {
|
||||||
|
quote = id(demotivational_quote).state;
|
||||||
it.print(227 + offsetX, 20 + offsetY, id(mdi_small), TextAlign::BASELINE_CENTER, ""); // transmission-tower
|
|
||||||
|
|
||||||
if(total_power >= 0) {
|
|
||||||
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 {
|
const size_t max_quote_characters = 27;
|
||||||
it.print(207 + offsetX, 20 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, " - W");
|
size_t quote_start = 0;
|
||||||
|
for (int line = 0; line < 4 && quote_start < quote.length(); line++) {
|
||||||
|
size_t quote_end = quote_start + max_quote_characters;
|
||||||
|
if (quote_end < quote.length()) {
|
||||||
|
const size_t word_break = quote.rfind(' ', quote_end);
|
||||||
|
if (word_break != std::string::npos && word_break > quote_start) quote_end = word_break;
|
||||||
|
} else {
|
||||||
|
quote_end = quote.length();
|
||||||
|
}
|
||||||
|
const std::string quote_line = quote.substr(quote_start, quote_end - quote_start);
|
||||||
|
it.printf(502, 234 + line * 24, id(sensor_unit), COLOR_OFF, TextAlign::TOP_CENTER, "%s", quote_line.c_str());
|
||||||
|
quote_start = quote_end;
|
||||||
|
while (quote_start < quote.length() && quote[quote_start] == ' ') quote_start++;
|
||||||
}
|
}
|
||||||
|
|
||||||
it.graph(10 + offsetX, 30 + offsetY, id(line_power_graph));
|
/* FOOTER: Footer is shared visual status: render timestamp plus a Wi-Fi-strength glyph. */
|
||||||
|
it.strftime(614, 380, id(footer_font), TextAlign::BASELINE_RIGHT,
|
||||||
/* Serverroom */
|
"Aktualisiert um %d.%m.%Y %H:%M", now);
|
||||||
offsetY = 247;
|
|
||||||
it.print(10 + offsetX, 10 + offsetY, id(sensor_unit), "Serverraum");
|
|
||||||
it.filled_rectangle(125 + offsetX, 21 + offsetY, 110, 3);
|
|
||||||
|
|
||||||
it.print(227 + offsetX, 110 + offsetY, id(mdi_small), TextAlign::BASELINE_CENTER, ""); // power-plug
|
|
||||||
|
|
||||||
if(serverroom_power >= 0) {
|
|
||||||
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 strength */
|
/* WiFi Signal strength */
|
||||||
if(id(wifisignal).has_state()) {
|
if(id(wifisignal).has_state()) {
|
||||||
|
|||||||
@@ -3,16 +3,16 @@
|
|||||||
substitutions:
|
substitutions:
|
||||||
name: m5stack-atom-echo
|
name: m5stack-atom-echo
|
||||||
friendly_name: M5Stack Atom Echo
|
friendly_name: M5Stack Atom Echo
|
||||||
micro_wake_word_model: okay_nabu # alexa, hey_jarvis, hey_mycroft are also supported
|
|
||||||
|
|
||||||
esphome:
|
esphome:
|
||||||
name: ${name}
|
name: ${name}
|
||||||
name_add_mac_suffix: False
|
name_add_mac_suffix: false
|
||||||
friendly_name: ${friendly_name}
|
friendly_name: ${friendly_name}
|
||||||
min_version: 2025.2.0
|
min_version: 2025.5.0
|
||||||
|
|
||||||
esp32:
|
esp32:
|
||||||
board: m5stack-atom
|
board: m5stack-atom
|
||||||
|
cpu_frequency: 240MHz
|
||||||
framework:
|
framework:
|
||||||
type: esp-idf
|
type: esp-idf
|
||||||
|
|
||||||
@@ -63,14 +63,17 @@ microphone:
|
|||||||
i2s_din_pin: GPIO23
|
i2s_din_pin: GPIO23
|
||||||
adc_type: external
|
adc_type: external
|
||||||
pdm: true
|
pdm: true
|
||||||
|
sample_rate: 16000
|
||||||
|
correct_dc_offset: true
|
||||||
|
|
||||||
speaker:
|
speaker:
|
||||||
- platform: i2s_audio
|
- platform: i2s_audio
|
||||||
id: echo_speaker
|
id: echo_speaker
|
||||||
i2s_dout_pin: GPIO22
|
i2s_dout_pin: GPIO22
|
||||||
dac_type: external
|
dac_type: external
|
||||||
bits_per_sample: 32bit
|
bits_per_sample: 16bit
|
||||||
channel: right
|
sample_rate: 16000
|
||||||
|
channel: stereo # The Echo has poor playback audio quality when using mon audio
|
||||||
buffer_duration: 60ms
|
buffer_duration: 60ms
|
||||||
|
|
||||||
media_player:
|
media_player:
|
||||||
@@ -80,7 +83,6 @@ media_player:
|
|||||||
announcement_pipeline:
|
announcement_pipeline:
|
||||||
speaker: echo_speaker
|
speaker: echo_speaker
|
||||||
format: WAV
|
format: WAV
|
||||||
codec_support_enabled: false
|
|
||||||
buffer_size: 6000
|
buffer_size: 6000
|
||||||
volume_min: 0.4
|
volume_min: 0.4
|
||||||
files:
|
files:
|
||||||
@@ -91,14 +93,7 @@ media_player:
|
|||||||
condition:
|
condition:
|
||||||
- microphone.is_capturing:
|
- microphone.is_capturing:
|
||||||
then:
|
then:
|
||||||
- if:
|
- script.execute: stop_wake_word
|
||||||
condition:
|
|
||||||
lambda: return id(wake_word_engine_location).state == "On device";
|
|
||||||
then:
|
|
||||||
- micro_wake_word.stop:
|
|
||||||
else:
|
|
||||||
- voice_assistant.stop:
|
|
||||||
- script.execute: reset_led
|
|
||||||
- light.turn_on:
|
- light.turn_on:
|
||||||
id: led
|
id: led
|
||||||
blue: 100%
|
blue: 100%
|
||||||
@@ -108,14 +103,18 @@ media_player:
|
|||||||
effect: none
|
effect: none
|
||||||
on_idle:
|
on_idle:
|
||||||
- script.execute: start_wake_word
|
- script.execute: start_wake_word
|
||||||
|
- script.execute: reset_led
|
||||||
|
|
||||||
voice_assistant:
|
voice_assistant:
|
||||||
id: va
|
id: va
|
||||||
microphone: echo_microphone
|
micro_wake_word:
|
||||||
|
microphone:
|
||||||
|
microphone: echo_microphone
|
||||||
|
channels: 0
|
||||||
|
gain_factor: 4
|
||||||
media_player: echo_media_player
|
media_player: echo_media_player
|
||||||
noise_suppression_level: 2
|
noise_suppression_level: 2
|
||||||
auto_gain: 31dBFS
|
auto_gain: 31dBFS
|
||||||
volume_multiplier: 2.0
|
|
||||||
on_listening:
|
on_listening:
|
||||||
- light.turn_on:
|
- light.turn_on:
|
||||||
id: led
|
id: led
|
||||||
@@ -139,8 +138,26 @@ voice_assistant:
|
|||||||
brightness: 100%
|
brightness: 100%
|
||||||
effect: none
|
effect: none
|
||||||
on_end:
|
on_end:
|
||||||
- delay: 100ms
|
# Handle the "nevermind" case where there is no announcement
|
||||||
- script.execute: start_wake_word
|
- wait_until:
|
||||||
|
condition:
|
||||||
|
- media_player.is_announcing:
|
||||||
|
timeout: 0.5s
|
||||||
|
# Restart only mWW if enabled; streaming wake words automatically restart
|
||||||
|
- if:
|
||||||
|
condition:
|
||||||
|
- lambda: |-
|
||||||
|
return id(wake_word_engine_location).current_option() == "On device";
|
||||||
|
then:
|
||||||
|
- wait_until:
|
||||||
|
- and:
|
||||||
|
- not:
|
||||||
|
voice_assistant.is_running:
|
||||||
|
- not:
|
||||||
|
speaker.is_playing:
|
||||||
|
- lambda: id(va).set_use_wake_word(false);
|
||||||
|
- micro_wake_word.start:
|
||||||
|
- script.execute: reset_led
|
||||||
on_error:
|
on_error:
|
||||||
- light.turn_on:
|
- light.turn_on:
|
||||||
id: led
|
id: led
|
||||||
@@ -155,11 +172,9 @@ voice_assistant:
|
|||||||
- delay: 2s # Give the api server time to settle
|
- delay: 2s # Give the api server time to settle
|
||||||
- script.execute: start_wake_word
|
- script.execute: start_wake_word
|
||||||
on_client_disconnected:
|
on_client_disconnected:
|
||||||
- voice_assistant.stop:
|
- script.execute: stop_wake_word
|
||||||
- micro_wake_word.stop:
|
|
||||||
on_timer_finished:
|
on_timer_finished:
|
||||||
- voice_assistant.stop:
|
- script.execute: stop_wake_word
|
||||||
- micro_wake_word.stop:
|
|
||||||
- wait_until:
|
- wait_until:
|
||||||
not:
|
not:
|
||||||
microphone.is_capturing:
|
microphone.is_capturing:
|
||||||
@@ -235,7 +250,8 @@ script:
|
|||||||
then:
|
then:
|
||||||
- if:
|
- if:
|
||||||
condition:
|
condition:
|
||||||
- lambda: return id(wake_word_engine_location).state == "On device";
|
- lambda: |-
|
||||||
|
return id(wake_word_engine_location).current_option() == "On device";
|
||||||
- switch.is_on: use_listen_light
|
- switch.is_on: use_listen_light
|
||||||
then:
|
then:
|
||||||
- light.turn_on:
|
- light.turn_on:
|
||||||
@@ -248,7 +264,8 @@ script:
|
|||||||
else:
|
else:
|
||||||
- if:
|
- if:
|
||||||
condition:
|
condition:
|
||||||
- lambda: return id(wake_word_engine_location).state != "On device";
|
- lambda: |-
|
||||||
|
return id(wake_word_engine_location).current_option() == "On device";
|
||||||
- switch.is_on: use_listen_light
|
- switch.is_on: use_listen_light
|
||||||
then:
|
then:
|
||||||
- light.turn_on:
|
- light.turn_on:
|
||||||
@@ -262,27 +279,41 @@ script:
|
|||||||
- light.turn_off: led
|
- light.turn_off: led
|
||||||
- id: start_wake_word
|
- id: start_wake_word
|
||||||
then:
|
then:
|
||||||
- wait_until:
|
|
||||||
and:
|
|
||||||
- media_player.is_idle:
|
|
||||||
- speaker.is_stopped:
|
|
||||||
- if:
|
- if:
|
||||||
condition:
|
condition:
|
||||||
lambda: return id(wake_word_engine_location).state == "On device";
|
and:
|
||||||
|
- not:
|
||||||
|
- voice_assistant.is_running:
|
||||||
|
- lambda: |-
|
||||||
|
return id(wake_word_engine_location).current_option() == "On device";
|
||||||
then:
|
then:
|
||||||
- voice_assistant.stop
|
- lambda: id(va).set_use_wake_word(false);
|
||||||
- micro_wake_word.stop:
|
|
||||||
- delay: 1s
|
|
||||||
- script.execute: reset_led
|
|
||||||
- script.wait: reset_led
|
|
||||||
- micro_wake_word.start:
|
- micro_wake_word.start:
|
||||||
else:
|
- if:
|
||||||
- if:
|
condition:
|
||||||
condition: voice_assistant.is_running
|
and:
|
||||||
then:
|
- not:
|
||||||
- voice_assistant.stop:
|
- voice_assistant.is_running:
|
||||||
- script.execute: reset_led
|
- lambda: |-
|
||||||
|
return id(wake_word_engine_location).current_option() == "In Home Assistant";
|
||||||
|
then:
|
||||||
|
- lambda: id(va).set_use_wake_word(true);
|
||||||
- voice_assistant.start_continuous:
|
- voice_assistant.start_continuous:
|
||||||
|
- id: stop_wake_word
|
||||||
|
then:
|
||||||
|
- if:
|
||||||
|
condition:
|
||||||
|
lambda: |-
|
||||||
|
return id(wake_word_engine_location).current_option() == "In Home Assistant";
|
||||||
|
then:
|
||||||
|
- lambda: id(va).set_use_wake_word(false);
|
||||||
|
- voice_assistant.stop:
|
||||||
|
- if:
|
||||||
|
condition:
|
||||||
|
lambda: |-
|
||||||
|
return id(wake_word_engine_location).current_option() == "On device";
|
||||||
|
then:
|
||||||
|
- micro_wake_word.stop:
|
||||||
|
|
||||||
switch:
|
switch:
|
||||||
- platform: template
|
- platform: template
|
||||||
@@ -342,7 +373,7 @@ select:
|
|||||||
condition:
|
condition:
|
||||||
lambda: return x == "In Home Assistant";
|
lambda: return x == "In Home Assistant";
|
||||||
then:
|
then:
|
||||||
- micro_wake_word.stop
|
- micro_wake_word.stop:
|
||||||
- delay: 500ms
|
- delay: 500ms
|
||||||
- lambda: id(va).set_use_wake_word(true);
|
- lambda: id(va).set_use_wake_word(true);
|
||||||
- voice_assistant.start_continuous:
|
- voice_assistant.start_continuous:
|
||||||
@@ -351,9 +382,9 @@ select:
|
|||||||
lambda: return x == "On device";
|
lambda: return x == "On device";
|
||||||
then:
|
then:
|
||||||
- lambda: id(va).set_use_wake_word(false);
|
- lambda: id(va).set_use_wake_word(false);
|
||||||
- voice_assistant.stop
|
- voice_assistant.stop:
|
||||||
- delay: 500ms
|
- delay: 500ms
|
||||||
- micro_wake_word.start
|
- micro_wake_word.start:
|
||||||
|
|
||||||
micro_wake_word:
|
micro_wake_word:
|
||||||
on_wake_word_detected:
|
on_wake_word_detected:
|
||||||
@@ -361,4 +392,9 @@ micro_wake_word:
|
|||||||
wake_word: !lambda return wake_word;
|
wake_word: !lambda return wake_word;
|
||||||
vad:
|
vad:
|
||||||
models:
|
models:
|
||||||
- model: ${micro_wake_word_model}
|
- model: okay_nabu
|
||||||
|
id: okay_nabu
|
||||||
|
- model: hey_mycroft
|
||||||
|
id: hey_mycroft
|
||||||
|
- model: hey_jarvis
|
||||||
|
id: hey_jarvis
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
# Source: https://github.com/wildekek/rdtech-esphome
|
||||||
|
|
||||||
substitutions:
|
substitutions:
|
||||||
name: "riden-labornetzteil-18a"
|
name: "riden-labornetzteil-18a"
|
||||||
friendly_name: "Riden Labornetzteil 18A"
|
friendly_name: "Riden Labornetzteil 18A"
|
||||||
@@ -8,7 +10,7 @@ substitutions:
|
|||||||
device_friendly_name: "Riden RD6018"
|
device_friendly_name: "Riden RD6018"
|
||||||
device_description: "Monitor and control a RD6018 PSU via WiFi"
|
device_description: "Monitor and control a RD6018 PSU via WiFi"
|
||||||
time_timezone: "Europe/Berlin"
|
time_timezone: "Europe/Berlin"
|
||||||
|
|
||||||
# Model specific settings (Don't change these!)
|
# Model specific settings (Don't change these!)
|
||||||
RD6006_voltage_maximum: "60"
|
RD6006_voltage_maximum: "60"
|
||||||
RD6006_voltage_accuracy: "2"
|
RD6006_voltage_accuracy: "2"
|
||||||
@@ -16,13 +18,17 @@ substitutions:
|
|||||||
RD6006_current_maximum: "6"
|
RD6006_current_maximum: "6"
|
||||||
RD6006_current_accuracy: "3"
|
RD6006_current_accuracy: "3"
|
||||||
RD6006_current_multiplier: "0.001"
|
RD6006_current_multiplier: "0.001"
|
||||||
|
RD6006_power_accuracy: "2"
|
||||||
|
RD6006_power_multiplier: "0.01"
|
||||||
|
|
||||||
RD6006P_voltage_maximum: "60"
|
RD6006P_voltage_maximum: "60"
|
||||||
RD6006P_voltage_accuracy: "3"
|
RD6006P_voltage_accuracy: "3"
|
||||||
RD6006P_voltage_multiplier: "0.001"
|
RD6006P_voltage_multiplier: "0.001"
|
||||||
RD6006P_current_maximum: "6"
|
RD6006P_current_maximum: "6"
|
||||||
RD6006P_current_accuracy: "4"
|
RD6006P_current_accuracy: "4"
|
||||||
RD6006P_current_multiplier: "0.0001"
|
RD6006P_current_multiplier: "0.0001"
|
||||||
|
RD6006P_power_accuracy: "3"
|
||||||
|
RD6006P_power_multiplier: "0.001"
|
||||||
|
|
||||||
RD6012_voltage_maximum: "60"
|
RD6012_voltage_maximum: "60"
|
||||||
RD6012_voltage_accuracy: "2"
|
RD6012_voltage_accuracy: "2"
|
||||||
@@ -30,6 +36,8 @@ substitutions:
|
|||||||
RD6012_current_maximum: "12"
|
RD6012_current_maximum: "12"
|
||||||
RD6012_current_accuracy: "2"
|
RD6012_current_accuracy: "2"
|
||||||
RD6012_current_multiplier: "0.01"
|
RD6012_current_multiplier: "0.01"
|
||||||
|
RD6012_power_accuracy: "2"
|
||||||
|
RD6012_power_multiplier: "0.01"
|
||||||
|
|
||||||
RD6018_voltage_maximum: "60"
|
RD6018_voltage_maximum: "60"
|
||||||
RD6018_voltage_accuracy: "2"
|
RD6018_voltage_accuracy: "2"
|
||||||
@@ -37,6 +45,8 @@ substitutions:
|
|||||||
RD6018_current_maximum: "18"
|
RD6018_current_maximum: "18"
|
||||||
RD6018_current_accuracy: "2"
|
RD6018_current_accuracy: "2"
|
||||||
RD6018_current_multiplier: "0.01"
|
RD6018_current_multiplier: "0.01"
|
||||||
|
RD6018_power_accuracy: "2"
|
||||||
|
RD6018_power_multiplier: "0.01"
|
||||||
|
|
||||||
esphome:
|
esphome:
|
||||||
name: $device_name
|
name: $device_name
|
||||||
@@ -45,7 +55,7 @@ esphome:
|
|||||||
name_add_mac_suffix: false
|
name_add_mac_suffix: false
|
||||||
project:
|
project:
|
||||||
name: "wildekek.rd6006-controller"
|
name: "wildekek.rd6006-controller"
|
||||||
version: "1.4.1"
|
version: "1.5"
|
||||||
|
|
||||||
esp8266:
|
esp8266:
|
||||||
board: esp12e
|
board: esp12e
|
||||||
@@ -56,7 +66,7 @@ network:
|
|||||||
wifi:
|
wifi:
|
||||||
ssid: "Voltage-legacy"
|
ssid: "Voltage-legacy"
|
||||||
password: !secret voltage_legacy_psk
|
password: !secret voltage_legacy_psk
|
||||||
#use_address: riden-labornetzteil-18a.home
|
use_address: riden-labornetzteil-18a.home
|
||||||
power_save_mode: high
|
power_save_mode: high
|
||||||
fast_connect: on
|
fast_connect: on
|
||||||
min_auth_mode: WPA2
|
min_auth_mode: WPA2
|
||||||
@@ -76,7 +86,7 @@ logger:
|
|||||||
|
|
||||||
# Enable Home Assistant API
|
# Enable Home Assistant API
|
||||||
api:
|
api:
|
||||||
encryption:
|
encryption:
|
||||||
key: !secret apikey
|
key: !secret apikey
|
||||||
|
|
||||||
ota:
|
ota:
|
||||||
@@ -152,7 +162,9 @@ sensor:
|
|||||||
on_value:
|
on_value:
|
||||||
then:
|
then:
|
||||||
- lambda: |-
|
- lambda: |-
|
||||||
id(model_name).publish_state(value_accuracy_to_string(x, 0));
|
id(model_name).publish_state(
|
||||||
|
std::to_string(static_cast<uint16_t>(x))
|
||||||
|
);
|
||||||
|
|
||||||
- platform: modbus_controller
|
- platform: modbus_controller
|
||||||
name: "Serial Number"
|
name: "Serial Number"
|
||||||
@@ -164,7 +176,7 @@ sensor:
|
|||||||
register_type: holding
|
register_type: holding
|
||||||
value_type: U_DWORD
|
value_type: U_DWORD
|
||||||
accuracy_decimals: 0
|
accuracy_decimals: 0
|
||||||
|
|
||||||
- platform: modbus_controller
|
- platform: modbus_controller
|
||||||
modbus_controller_id: powersupply
|
modbus_controller_id: powersupply
|
||||||
address: 3
|
address: 3
|
||||||
@@ -213,9 +225,9 @@ sensor:
|
|||||||
unit_of_measurement: "W"
|
unit_of_measurement: "W"
|
||||||
register_type: holding
|
register_type: holding
|
||||||
value_type: U_DWORD
|
value_type: U_DWORD
|
||||||
accuracy_decimals: 2
|
accuracy_decimals: ${${model}_power_accuracy}
|
||||||
filters:
|
filters:
|
||||||
- multiply: 0.01
|
- multiply: ${${model}_power_multiplier}
|
||||||
|
|
||||||
- platform: modbus_controller
|
- platform: modbus_controller
|
||||||
modbus_controller_id: powersupply
|
modbus_controller_id: powersupply
|
||||||
@@ -226,9 +238,9 @@ sensor:
|
|||||||
unit_of_measurement: "V"
|
unit_of_measurement: "V"
|
||||||
register_type: holding
|
register_type: holding
|
||||||
value_type: U_WORD
|
value_type: U_WORD
|
||||||
accuracy_decimals: ${${model}_voltage_accuracy}
|
accuracy_decimals: 2
|
||||||
filters:
|
filters:
|
||||||
- multiply: ${${model}_voltage_multiplier}
|
- multiply: 0.01
|
||||||
|
|
||||||
- platform: modbus_controller
|
- platform: modbus_controller
|
||||||
modbus_controller_id: powersupply
|
modbus_controller_id: powersupply
|
||||||
@@ -266,10 +278,10 @@ sensor:
|
|||||||
unit_of_measurement: "V"
|
unit_of_measurement: "V"
|
||||||
register_type: holding
|
register_type: holding
|
||||||
value_type: U_WORD
|
value_type: U_WORD
|
||||||
accuracy_decimals: ${${model}_voltage_accuracy}
|
accuracy_decimals: 2
|
||||||
filters:
|
filters:
|
||||||
- multiply: ${${model}_voltage_multiplier}
|
- multiply: 0.01
|
||||||
|
|
||||||
- platform: modbus_controller
|
- platform: modbus_controller
|
||||||
name: "Temperature"
|
name: "Temperature"
|
||||||
device_class: temperature
|
device_class: temperature
|
||||||
@@ -279,7 +291,7 @@ sensor:
|
|||||||
address: 4
|
address: 4
|
||||||
value_type: S_DWORD
|
value_type: S_DWORD
|
||||||
unit_of_measurement: "°C"
|
unit_of_measurement: "°C"
|
||||||
|
|
||||||
- platform: modbus_controller
|
- platform: modbus_controller
|
||||||
name: "Temperature external"
|
name: "Temperature external"
|
||||||
state_class: measurement
|
state_class: measurement
|
||||||
@@ -289,7 +301,7 @@ sensor:
|
|||||||
value_type: S_DWORD
|
value_type: S_DWORD
|
||||||
device_class: temperature
|
device_class: temperature
|
||||||
unit_of_measurement: "°C"
|
unit_of_measurement: "°C"
|
||||||
|
|
||||||
- platform: wifi_signal
|
- platform: wifi_signal
|
||||||
name: "Wi-Fi Signal"
|
name: "Wi-Fi Signal"
|
||||||
disabled_by_default: True
|
disabled_by_default: True
|
||||||
@@ -408,7 +420,7 @@ number:
|
|||||||
step: ${${model}_voltage_multiplier}
|
step: ${${model}_voltage_multiplier}
|
||||||
lambda: !lambda return x * ${${model}_voltage_multiplier};
|
lambda: !lambda return x * ${${model}_voltage_multiplier};
|
||||||
write_lambda: !lambda return x * (1/${${model}_voltage_multiplier});
|
write_lambda: !lambda return x * (1/${${model}_voltage_multiplier});
|
||||||
|
|
||||||
- platform: modbus_controller
|
- platform: modbus_controller
|
||||||
modbus_controller_id: powersupply
|
modbus_controller_id: powersupply
|
||||||
name: "Output current"
|
name: "Output current"
|
||||||
@@ -437,7 +449,6 @@ number:
|
|||||||
lambda: !lambda return x * ${${model}_voltage_multiplier};
|
lambda: !lambda return x * ${${model}_voltage_multiplier};
|
||||||
write_lambda: !lambda return x * (1/${${model}_voltage_multiplier});
|
write_lambda: !lambda return x * (1/${${model}_voltage_multiplier});
|
||||||
|
|
||||||
|
|
||||||
- platform: modbus_controller
|
- platform: modbus_controller
|
||||||
modbus_controller_id: powersupply
|
modbus_controller_id: powersupply
|
||||||
name: "Over Current Protection"
|
name: "Over Current Protection"
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
# Source: https://github.com/wildekek/rdtech-esphome
|
||||||
|
|
||||||
substitutions:
|
substitutions:
|
||||||
name: "riden-labornetzteil-6a"
|
name: "riden-labornetzteil-6a"
|
||||||
friendly_name: "Riden Labornetzteil 6A"
|
friendly_name: "Riden Labornetzteil 6A"
|
||||||
@@ -8,7 +10,7 @@ substitutions:
|
|||||||
device_friendly_name: "Riden RD6006"
|
device_friendly_name: "Riden RD6006"
|
||||||
device_description: "Monitor and control a RD6006 PSU via WiFi"
|
device_description: "Monitor and control a RD6006 PSU via WiFi"
|
||||||
time_timezone: "Europe/Berlin"
|
time_timezone: "Europe/Berlin"
|
||||||
|
|
||||||
# Model specific settings (Don't change these!)
|
# Model specific settings (Don't change these!)
|
||||||
RD6006_voltage_maximum: "60"
|
RD6006_voltage_maximum: "60"
|
||||||
RD6006_voltage_accuracy: "2"
|
RD6006_voltage_accuracy: "2"
|
||||||
@@ -16,13 +18,17 @@ substitutions:
|
|||||||
RD6006_current_maximum: "6"
|
RD6006_current_maximum: "6"
|
||||||
RD6006_current_accuracy: "3"
|
RD6006_current_accuracy: "3"
|
||||||
RD6006_current_multiplier: "0.001"
|
RD6006_current_multiplier: "0.001"
|
||||||
|
RD6006_power_accuracy: "2"
|
||||||
|
RD6006_power_multiplier: "0.01"
|
||||||
|
|
||||||
RD6006P_voltage_maximum: "60"
|
RD6006P_voltage_maximum: "60"
|
||||||
RD6006P_voltage_accuracy: "3"
|
RD6006P_voltage_accuracy: "3"
|
||||||
RD6006P_voltage_multiplier: "0.001"
|
RD6006P_voltage_multiplier: "0.001"
|
||||||
RD6006P_current_maximum: "6"
|
RD6006P_current_maximum: "6"
|
||||||
RD6006P_current_accuracy: "4"
|
RD6006P_current_accuracy: "4"
|
||||||
RD6006P_current_multiplier: "0.0001"
|
RD6006P_current_multiplier: "0.0001"
|
||||||
|
RD6006P_power_accuracy: "3"
|
||||||
|
RD6006P_power_multiplier: "0.001"
|
||||||
|
|
||||||
RD6012_voltage_maximum: "60"
|
RD6012_voltage_maximum: "60"
|
||||||
RD6012_voltage_accuracy: "2"
|
RD6012_voltage_accuracy: "2"
|
||||||
@@ -30,6 +36,8 @@ substitutions:
|
|||||||
RD6012_current_maximum: "12"
|
RD6012_current_maximum: "12"
|
||||||
RD6012_current_accuracy: "2"
|
RD6012_current_accuracy: "2"
|
||||||
RD6012_current_multiplier: "0.01"
|
RD6012_current_multiplier: "0.01"
|
||||||
|
RD6012_power_accuracy: "2"
|
||||||
|
RD6012_power_multiplier: "0.01"
|
||||||
|
|
||||||
RD6018_voltage_maximum: "60"
|
RD6018_voltage_maximum: "60"
|
||||||
RD6018_voltage_accuracy: "2"
|
RD6018_voltage_accuracy: "2"
|
||||||
@@ -37,6 +45,8 @@ substitutions:
|
|||||||
RD6018_current_maximum: "18"
|
RD6018_current_maximum: "18"
|
||||||
RD6018_current_accuracy: "2"
|
RD6018_current_accuracy: "2"
|
||||||
RD6018_current_multiplier: "0.01"
|
RD6018_current_multiplier: "0.01"
|
||||||
|
RD6018_power_accuracy: "2"
|
||||||
|
RD6018_power_multiplier: "0.01"
|
||||||
|
|
||||||
esphome:
|
esphome:
|
||||||
name: $device_name
|
name: $device_name
|
||||||
@@ -45,7 +55,7 @@ esphome:
|
|||||||
name_add_mac_suffix: false
|
name_add_mac_suffix: false
|
||||||
project:
|
project:
|
||||||
name: "wildekek.rd6006-controller"
|
name: "wildekek.rd6006-controller"
|
||||||
version: "1.4.1"
|
version: "1.5"
|
||||||
|
|
||||||
esp8266:
|
esp8266:
|
||||||
board: esp12e
|
board: esp12e
|
||||||
@@ -56,7 +66,7 @@ network:
|
|||||||
wifi:
|
wifi:
|
||||||
ssid: "Voltage-legacy"
|
ssid: "Voltage-legacy"
|
||||||
password: !secret voltage_legacy_psk
|
password: !secret voltage_legacy_psk
|
||||||
#use_address: riden-labornetzteil-6a.home
|
use_address: riden-labornetzteil-6a.home
|
||||||
power_save_mode: high
|
power_save_mode: high
|
||||||
fast_connect: on
|
fast_connect: on
|
||||||
min_auth_mode: WPA2
|
min_auth_mode: WPA2
|
||||||
@@ -76,7 +86,7 @@ logger:
|
|||||||
|
|
||||||
# Enable Home Assistant API
|
# Enable Home Assistant API
|
||||||
api:
|
api:
|
||||||
encryption:
|
encryption:
|
||||||
key: !secret apikey
|
key: !secret apikey
|
||||||
|
|
||||||
ota:
|
ota:
|
||||||
@@ -152,7 +162,9 @@ sensor:
|
|||||||
on_value:
|
on_value:
|
||||||
then:
|
then:
|
||||||
- lambda: |-
|
- lambda: |-
|
||||||
id(model_name).publish_state(value_accuracy_to_string(x, 0));
|
id(model_name).publish_state(
|
||||||
|
std::to_string(static_cast<uint16_t>(x))
|
||||||
|
);
|
||||||
|
|
||||||
- platform: modbus_controller
|
- platform: modbus_controller
|
||||||
name: "Serial Number"
|
name: "Serial Number"
|
||||||
@@ -164,7 +176,7 @@ sensor:
|
|||||||
register_type: holding
|
register_type: holding
|
||||||
value_type: U_DWORD
|
value_type: U_DWORD
|
||||||
accuracy_decimals: 0
|
accuracy_decimals: 0
|
||||||
|
|
||||||
- platform: modbus_controller
|
- platform: modbus_controller
|
||||||
modbus_controller_id: powersupply
|
modbus_controller_id: powersupply
|
||||||
address: 3
|
address: 3
|
||||||
@@ -213,9 +225,9 @@ sensor:
|
|||||||
unit_of_measurement: "W"
|
unit_of_measurement: "W"
|
||||||
register_type: holding
|
register_type: holding
|
||||||
value_type: U_DWORD
|
value_type: U_DWORD
|
||||||
accuracy_decimals: 2
|
accuracy_decimals: ${${model}_power_accuracy}
|
||||||
filters:
|
filters:
|
||||||
- multiply: 0.01
|
- multiply: ${${model}_power_multiplier}
|
||||||
|
|
||||||
- platform: modbus_controller
|
- platform: modbus_controller
|
||||||
modbus_controller_id: powersupply
|
modbus_controller_id: powersupply
|
||||||
@@ -226,9 +238,9 @@ sensor:
|
|||||||
unit_of_measurement: "V"
|
unit_of_measurement: "V"
|
||||||
register_type: holding
|
register_type: holding
|
||||||
value_type: U_WORD
|
value_type: U_WORD
|
||||||
accuracy_decimals: ${${model}_voltage_accuracy}
|
accuracy_decimals: 2
|
||||||
filters:
|
filters:
|
||||||
- multiply: ${${model}_voltage_multiplier}
|
- multiply: 0.01
|
||||||
|
|
||||||
- platform: modbus_controller
|
- platform: modbus_controller
|
||||||
modbus_controller_id: powersupply
|
modbus_controller_id: powersupply
|
||||||
@@ -266,10 +278,10 @@ sensor:
|
|||||||
unit_of_measurement: "V"
|
unit_of_measurement: "V"
|
||||||
register_type: holding
|
register_type: holding
|
||||||
value_type: U_WORD
|
value_type: U_WORD
|
||||||
accuracy_decimals: ${${model}_voltage_accuracy}
|
accuracy_decimals: 2
|
||||||
filters:
|
filters:
|
||||||
- multiply: ${${model}_voltage_multiplier}
|
- multiply: 0.01
|
||||||
|
|
||||||
- platform: modbus_controller
|
- platform: modbus_controller
|
||||||
name: "Temperature"
|
name: "Temperature"
|
||||||
device_class: temperature
|
device_class: temperature
|
||||||
@@ -279,7 +291,7 @@ sensor:
|
|||||||
address: 4
|
address: 4
|
||||||
value_type: S_DWORD
|
value_type: S_DWORD
|
||||||
unit_of_measurement: "°C"
|
unit_of_measurement: "°C"
|
||||||
|
|
||||||
- platform: modbus_controller
|
- platform: modbus_controller
|
||||||
name: "Temperature external"
|
name: "Temperature external"
|
||||||
state_class: measurement
|
state_class: measurement
|
||||||
@@ -289,7 +301,7 @@ sensor:
|
|||||||
value_type: S_DWORD
|
value_type: S_DWORD
|
||||||
device_class: temperature
|
device_class: temperature
|
||||||
unit_of_measurement: "°C"
|
unit_of_measurement: "°C"
|
||||||
|
|
||||||
- platform: wifi_signal
|
- platform: wifi_signal
|
||||||
name: "Wi-Fi Signal"
|
name: "Wi-Fi Signal"
|
||||||
disabled_by_default: True
|
disabled_by_default: True
|
||||||
@@ -408,7 +420,7 @@ number:
|
|||||||
step: ${${model}_voltage_multiplier}
|
step: ${${model}_voltage_multiplier}
|
||||||
lambda: !lambda return x * ${${model}_voltage_multiplier};
|
lambda: !lambda return x * ${${model}_voltage_multiplier};
|
||||||
write_lambda: !lambda return x * (1/${${model}_voltage_multiplier});
|
write_lambda: !lambda return x * (1/${${model}_voltage_multiplier});
|
||||||
|
|
||||||
- platform: modbus_controller
|
- platform: modbus_controller
|
||||||
modbus_controller_id: powersupply
|
modbus_controller_id: powersupply
|
||||||
name: "Output current"
|
name: "Output current"
|
||||||
|
|||||||
@@ -0,0 +1,40 @@
|
|||||||
|
epaper_demotivationszitat:
|
||||||
|
name: Epaper Demotivationszitat
|
||||||
|
icon: mdi:emoticon-sad-outline
|
||||||
|
options:
|
||||||
|
- "Erwarte nichts. Dann kann dich auch wenig enttäuschen."
|
||||||
|
- "Du musst nicht scheitern. Es reicht, es nie zu versuchen."
|
||||||
|
- "Der Weg ist das Ziel. Leider führt er im Kreis."
|
||||||
|
- "Auch ein Rückschritt ist Bewegung. Nur eben rückwärts."
|
||||||
|
- "Nicht jeder Tag muss gut sein. Dieser hier zum Beispiel nicht."
|
||||||
|
- "Dein Potenzial ist beeindruckend. Seine Nutzung bleibt optional."
|
||||||
|
- "Morgen wird alles besser. Wahrscheinlich aber auch nicht."
|
||||||
|
- "Motivation ist vergänglich. Frust ist zuverlässig."
|
||||||
|
- "Man kann nicht alles haben. Nicht einmal gute Laune."
|
||||||
|
- "Wenn Plan A scheitert, war Plan B vermutlich auch keine Hilfe."
|
||||||
|
- "Es ist nie zu spät, die Erwartungen zu senken."
|
||||||
|
- "Du bist nicht zu spät. Die anderen sind nur früher gescheitert."
|
||||||
|
- "Das wird schon. Nur eben nicht gut."
|
||||||
|
- "Ziele sind wichtig. Besonders wenn man sie verfehlt."
|
||||||
|
- "Die Konkurrenz schläft nicht. Du darfst trotzdem weitermachen."
|
||||||
|
- "Du gibst dein Bestes. Das erklärt einiges."
|
||||||
|
- "Jeder Fehler ist eine Lektion. Du bist bald Experte."
|
||||||
|
- "Heute ist ein neuer Tag. Die Probleme sind dieselben."
|
||||||
|
- "Erfolg braucht Geduld. Enttäuschung ist sofort verfügbar."
|
||||||
|
- "Ein kleiner Schritt für dich. Ein kaum bemerkbarer für alle anderen."
|
||||||
|
- "Wer früh aufgibt, hat länger frei."
|
||||||
|
- "Es gibt keine dummen Fragen. Nur ungünstige Zeitpunkte."
|
||||||
|
- "Deine Komfortzone vermisst dich nicht."
|
||||||
|
- "Manchmal gewinnt man. Meistens lernt man daraus."
|
||||||
|
- "Der erste Schritt ist der schwerste. Die anderen sind nur länger."
|
||||||
|
- "Arbeite hart. Vielleicht merkt es niemand."
|
||||||
|
- "Nicht aufgeben. Es könnte noch schlimmer werden."
|
||||||
|
- "Träume groß. Die Realität übernimmt den Rest."
|
||||||
|
- "Das Glas ist halb voll. Mit Problemen."
|
||||||
|
- "Jeder Tag bietet Chancen. Manche davon sind Termine."
|
||||||
|
- "Du kannst alles schaffen. Außer vielleicht heute."
|
||||||
|
- "Das Leben ist kurz. Besprechungen sind länger."
|
||||||
|
- "Mut steht am Anfang. Die Rechnung kommt später."
|
||||||
|
- "Wenn es einfach wäre, würde es jemand anders machen."
|
||||||
|
- "Deine To-do-Liste glaubt an dich. Sie muss ja nicht mitmachen."
|
||||||
|
- "Perfektion ist erreichbar. Nur nicht von hier."
|
||||||
@@ -0,0 +1,97 @@
|
|||||||
|
# Display contract shared with the ESPHome calendar page: compact German labels,
|
||||||
|
# a bounded number of events, and strings sized for the e-paper layout.
|
||||||
|
CALENDAR_NAMES = {
|
||||||
|
"calendar.tkrz_kalender": "Arbeit",
|
||||||
|
"calendar.privat": "Privat",
|
||||||
|
}
|
||||||
|
DAY_NAMES = ["Mo", "Di", "Mi", "Do", "Fr", "Sa", "So"]
|
||||||
|
MAX_ENTRIES = 8
|
||||||
|
# Reserve the right side of each row for start and end times.
|
||||||
|
MAX_TITLE_LENGTH = 22
|
||||||
|
MAX_META_LENGTH = 35
|
||||||
|
|
||||||
|
|
||||||
|
# Keep variable event text within the fixed-width e-paper agenda columns.
|
||||||
|
def shorten(value, maximum):
|
||||||
|
value = (value or "").strip()
|
||||||
|
if len(value) <= maximum:
|
||||||
|
return value
|
||||||
|
return value[: maximum - 3].rstrip() + "..."
|
||||||
|
|
||||||
|
|
||||||
|
# Convert one Home Assistant calendar event into the small JSON shape consumed
|
||||||
|
# by ESPHome, separating all-day, start-time, end-time, and metadata display data.
|
||||||
|
def compact_event(event, calendar_name):
|
||||||
|
start = event.get("start", "")
|
||||||
|
all_day = "T" not in start
|
||||||
|
end = event.get("end", "")
|
||||||
|
time = "ganzt." if all_day else start[11:16]
|
||||||
|
end_time = "" if all_day or "T" not in end else end[11:16]
|
||||||
|
|
||||||
|
location = (event.get("location") or "").split("\n")[0].strip()
|
||||||
|
meta = calendar_name
|
||||||
|
if location:
|
||||||
|
meta += " / " + location
|
||||||
|
|
||||||
|
return {
|
||||||
|
"title": shorten(event.get("summary", "Ohne Titel"), MAX_TITLE_LENGTH),
|
||||||
|
"time": time,
|
||||||
|
"end": end_time,
|
||||||
|
"meta": shorten(meta, MAX_META_LENGTH),
|
||||||
|
"all_day": int(all_day),
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Read the calendar.get_events response supplied by the calling template sensor
|
||||||
|
# and collect events under the date on which they should appear in the agenda.
|
||||||
|
calendar_data = data.get("calendar", {})
|
||||||
|
today = str(data.get("now", ""))[:10]
|
||||||
|
events_by_date = {}
|
||||||
|
|
||||||
|
for calendar_id, calendar in calendar_data.items():
|
||||||
|
calendar_name = CALENDAR_NAMES.get(calendar_id, calendar_id.split(".")[-1].capitalize())
|
||||||
|
for event in calendar.get("events", []):
|
||||||
|
start = event.get("start", "")
|
||||||
|
end = event.get("end", "")
|
||||||
|
event_date = start[:10]
|
||||||
|
end_date = end[:10]
|
||||||
|
|
||||||
|
# Ignore malformed or already finished entries. All-day event end dates
|
||||||
|
# are exclusive in Home Assistant; timed events ending today may still be
|
||||||
|
# active. Multi-day entries remain visible on today's date rail.
|
||||||
|
all_day = "T" not in start
|
||||||
|
if not event_date or (all_day and end_date <= today) or (not all_day and end_date < today):
|
||||||
|
continue
|
||||||
|
if event_date < today:
|
||||||
|
event_date = today
|
||||||
|
|
||||||
|
events_by_date.setdefault(event_date, []).append(
|
||||||
|
compact_event(event, calendar_name)
|
||||||
|
)
|
||||||
|
|
||||||
|
# Sort day groups and events, put all-day entries first, and cap the payload so
|
||||||
|
# deserializing it stays safe on the ESP32 without PSRAM.
|
||||||
|
entries = []
|
||||||
|
entry_count = 0
|
||||||
|
for date in sorted(events_by_date):
|
||||||
|
if entry_count >= MAX_ENTRIES:
|
||||||
|
break
|
||||||
|
|
||||||
|
events = events_by_date[date]
|
||||||
|
events.sort(key=lambda item: (item["all_day"] == 0, item["time"]))
|
||||||
|
remaining = MAX_ENTRIES - entry_count
|
||||||
|
events = events[:remaining]
|
||||||
|
entry_count += len(events)
|
||||||
|
|
||||||
|
parsed_date = dt_util.parse_datetime(date)
|
||||||
|
entries.append(
|
||||||
|
{
|
||||||
|
"day": parsed_date.day,
|
||||||
|
"weekday": DAY_NAMES[parsed_date.weekday()],
|
||||||
|
"today": int(date == today),
|
||||||
|
"events": events,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
# Return only the normalized agenda payload to the Home Assistant template sensor.
|
||||||
|
output["entries"] = entries
|
||||||
+6
-4
@@ -10,7 +10,8 @@
|
|||||||
unique_id: '3303381540758'
|
unique_id: '3303381540758'
|
||||||
host: !secret router_ip
|
host: !secret router_ip
|
||||||
community: !secret router_community
|
community: !secret router_community
|
||||||
baseoid: .1.3.6.1.2.1.31.1.1.1.6.511
|
# baseoid: .1.3.6.1.2.1.31.1.1.1.6.511
|
||||||
|
baseoid: .1.3.6.1.2.1.2.2.1.10.12
|
||||||
version: 2c
|
version: 2c
|
||||||
unit_of_measurement: "Octets"
|
unit_of_measurement: "Octets"
|
||||||
- platform: snmp
|
- platform: snmp
|
||||||
@@ -18,7 +19,8 @@
|
|||||||
unique_id: '1573258703922'
|
unique_id: '1573258703922'
|
||||||
host: !secret router_ip
|
host: !secret router_ip
|
||||||
community: !secret router_community
|
community: !secret router_community
|
||||||
baseoid: .1.3.6.1.2.1.31.1.1.1.10.511
|
# baseoid: .1.3.6.1.2.1.31.1.1.1.10.511
|
||||||
|
baseoid: .1.3.6.1.2.1.2.2.1.16.12
|
||||||
version: 2c
|
version: 2c
|
||||||
unit_of_measurement: "Octets"
|
unit_of_measurement: "Octets"
|
||||||
|
|
||||||
@@ -38,13 +40,13 @@
|
|||||||
unique_id: '9081721471264'
|
unique_id: '9081721471264'
|
||||||
state_characteristic: mean
|
state_characteristic: mean
|
||||||
entity_id: sensor.internet_speed_in
|
entity_id: sensor.internet_speed_in
|
||||||
sampling_size: 10
|
sampling_size: 2
|
||||||
- platform: statistics
|
- platform: statistics
|
||||||
name: 'WAN Traffic Out'
|
name: 'WAN Traffic Out'
|
||||||
unique_id: '8688955223027'
|
unique_id: '8688955223027'
|
||||||
state_characteristic: mean
|
state_characteristic: mean
|
||||||
entity_id: sensor.internet_speed_out
|
entity_id: sensor.internet_speed_out
|
||||||
sampling_size: 10
|
sampling_size: 2
|
||||||
|
|
||||||
# Sensor for Riemann sum of energy import (W -> Wh)
|
# Sensor for Riemann sum of energy import (W -> Wh)
|
||||||
- platform: integration
|
- platform: integration
|
||||||
|
|||||||
+34
-27
@@ -49,6 +49,11 @@
|
|||||||
name: Sun Setting Template
|
name: Sun Setting Template
|
||||||
state: '{{ as_timestamp(states.sun.sun.attributes.next_setting) | timestamp_custom
|
state: '{{ as_timestamp(states.sun.sun.attributes.next_setting) | timestamp_custom
|
||||||
(''%H:%M'') }}'
|
(''%H:%M'') }}'
|
||||||
|
- unique_id: epaper_demotivational_quote
|
||||||
|
default_entity_id: sensor.epaper_demotivationszitat
|
||||||
|
name: Epaper Demotivationszitat
|
||||||
|
state: "{{ states('input_select.epaper_demotivationszitat') }}"
|
||||||
|
|
||||||
- name: "power_other"
|
- name: "power_other"
|
||||||
unique_id: '5579422933393'
|
unique_id: '5579422933393'
|
||||||
unit_of_measurement: "W"
|
unit_of_measurement: "W"
|
||||||
@@ -79,6 +84,35 @@
|
|||||||
attributes:
|
attributes:
|
||||||
last_reset: '1970-01-01T00:00:00+00:00'
|
last_reset: '1970-01-01T00:00:00+00:00'
|
||||||
|
|
||||||
|
# Compact calendar feed for the e-paper display. The actual event data lives in
|
||||||
|
# the `entries` attribute, which ESPHome reads as a text sensor.
|
||||||
|
- trigger:
|
||||||
|
- trigger: homeassistant
|
||||||
|
event: start
|
||||||
|
- trigger: time_pattern
|
||||||
|
minutes: /15
|
||||||
|
action:
|
||||||
|
- action: calendar.get_events
|
||||||
|
target:
|
||||||
|
entity_id:
|
||||||
|
- calendar.tkrz_kalender
|
||||||
|
- calendar.privat
|
||||||
|
data:
|
||||||
|
duration:
|
||||||
|
days: 14
|
||||||
|
response_variable: calendar_response
|
||||||
|
- action: python_script.epaper_calendar_data
|
||||||
|
data:
|
||||||
|
calendar: "{{ calendar_response }}"
|
||||||
|
now: "{{ now().date() }}"
|
||||||
|
response_variable: calendar_converted
|
||||||
|
sensor:
|
||||||
|
- name: Epaper Kalenderdaten
|
||||||
|
unique_id: epaper_calendar_data
|
||||||
|
state: "{{ calendar_converted.entries | count }}"
|
||||||
|
attributes:
|
||||||
|
entries: "{{ calendar_converted.entries }}"
|
||||||
|
|
||||||
# Shelly 3EM cumulative sensors (incl. PV)
|
# Shelly 3EM cumulative sensors (incl. PV)
|
||||||
- sensor:
|
- sensor:
|
||||||
# Template sensor for values of power import (active_power > 0)
|
# Template sensor for values of power import (active_power > 0)
|
||||||
@@ -145,30 +179,3 @@
|
|||||||
unit_of_measurement: 'Mbps'
|
unit_of_measurement: 'Mbps'
|
||||||
attributes:
|
attributes:
|
||||||
last_reset: '1970-01-01T00:00:00+00:00'
|
last_reset: '1970-01-01T00:00:00+00:00'
|
||||||
|
|
||||||
# ── Kalender-Ereignisse für epaperframe ──
|
|
||||||
# Alle Events werden per Automation (automations.yaml) in input_text Helfer geschrieben.
|
|
||||||
# Diese template sensors lesen nur noch daraus. Das verhindert doppelte Logik und garantiert,
|
|
||||||
# dass sowohl "heute" als auch "morgen" Events mit Titeln, Uhrzeiten und Beschreibungen verfügbar sind.
|
|
||||||
- sensor:
|
|
||||||
# ── HEUTE ──
|
|
||||||
- name: "Kalender heute Privat"
|
|
||||||
unique_id: kalender_heute_privat
|
|
||||||
state: "{{ states('input_text.kalender_heute_privat') }}"
|
|
||||||
icon: mdi:calendar-account
|
|
||||||
|
|
||||||
- name: "Kalender heute Arbeit"
|
|
||||||
unique_id: kalender_heute_arbeit
|
|
||||||
state: "{{ states('input_text.kalender_heute_arbeit') }}"
|
|
||||||
icon: mdi:calendar-account
|
|
||||||
|
|
||||||
# ── MORGEN ──
|
|
||||||
- name: "Kalender morgen Privat"
|
|
||||||
unique_id: kalender_morgen_privat
|
|
||||||
state: "{{ states('input_text.kalender_morgen_privat') }}"
|
|
||||||
icon: mdi:calendar-calendar-today
|
|
||||||
|
|
||||||
- name: "Kalender morgen Arbeit"
|
|
||||||
unique_id: kalender_morgen_arbeit
|
|
||||||
state: "{{ states('input_text.kalender_morgen_arbeit') }}"
|
|
||||||
icon: mdi:calendar-calendar-today
|
|
||||||
|
|||||||
@@ -1,20 +0,0 @@
|
|||||||
kalender_heute_privat:
|
|
||||||
name: "Kalender heute Privat"
|
|
||||||
initial: "-"
|
|
||||||
icon: mdi:calendar-account
|
|
||||||
mode: text
|
|
||||||
kalender_heute_arbeit:
|
|
||||||
name: "Kalender heute Arbeit"
|
|
||||||
initial: "-"
|
|
||||||
icon: mdi:calendar-account
|
|
||||||
mode: text
|
|
||||||
kalender_morgen_privat:
|
|
||||||
name: "Kalender morgen Privat"
|
|
||||||
initial: "-"
|
|
||||||
icon: mdi:calendar-calendar-today
|
|
||||||
mode: text
|
|
||||||
kalender_morgen_arbeit:
|
|
||||||
name: "Kalender morgen Arbeit"
|
|
||||||
initial: "-"
|
|
||||||
icon: mdi:calendar-calendar-today
|
|
||||||
mode: text
|
|
||||||
+12
-6
@@ -1,34 +1,40 @@
|
|||||||
# Internet traffic
|
# Internet traffic
|
||||||
internet_usage_in_monthly:
|
internet_usage_in_monthly:
|
||||||
source: sensor.snmp_wan_in
|
source: sensor.wan_in_derivative
|
||||||
name: Monthly internet traffic in
|
name: Monthly internet traffic in
|
||||||
unique_id: monthly_internet_traffic_in
|
unique_id: monthly_internet_traffic_in
|
||||||
cycle: monthly
|
cycle: monthly
|
||||||
|
delta_values: True
|
||||||
internet_usage_out_monthly:
|
internet_usage_out_monthly:
|
||||||
source: sensor.snmp_wan_out
|
source: sensor.wan_out_derivative
|
||||||
name: Monthly internet traffic out
|
name: Monthly internet traffic out
|
||||||
unique_id: monthly_internet_traffic_out
|
unique_id: monthly_internet_traffic_out
|
||||||
cycle: monthly
|
cycle: monthly
|
||||||
|
delta_values: True
|
||||||
internet_usage_in_daily:
|
internet_usage_in_daily:
|
||||||
source: sensor.snmp_wan_in
|
source: sensor.wan_in_derivative
|
||||||
name: Daily internet traffic in
|
name: Daily internet traffic in
|
||||||
unique_id: daily_internet_traffic_in
|
unique_id: daily_internet_traffic_in
|
||||||
cycle: daily
|
cycle: daily
|
||||||
|
delta_values: True
|
||||||
internet_usage_out_daily:
|
internet_usage_out_daily:
|
||||||
source: sensor.snmp_wan_out
|
source: sensor.wan_out_derivative
|
||||||
name: Daily internet traffic out
|
name: Daily internet traffic out
|
||||||
unique_id: daily_internet_traffic_out
|
unique_id: daily_internet_traffic_out
|
||||||
cycle: daily
|
cycle: daily
|
||||||
|
delta_values: True
|
||||||
internet_usage_in_hourly:
|
internet_usage_in_hourly:
|
||||||
source: sensor.snmp_wan_in
|
source: sensor.wan_in_derivative
|
||||||
name: Hourly internet traffic in
|
name: Hourly internet traffic in
|
||||||
unique_id: hourly_internet_traffic_in
|
unique_id: hourly_internet_traffic_in
|
||||||
cycle: hourly
|
cycle: hourly
|
||||||
|
delta_values: True
|
||||||
internet_usage_out_hourly:
|
internet_usage_out_hourly:
|
||||||
source: sensor.snmp_wan_out
|
source: sensor.wan_out_derivative
|
||||||
name: Hourly internet traffic out
|
name: Hourly internet traffic out
|
||||||
unique_id: hourly_internet_traffic_out
|
unique_id: hourly_internet_traffic_out
|
||||||
cycle: hourly
|
cycle: hourly
|
||||||
|
delta_values: True
|
||||||
|
|
||||||
# Energy
|
# Energy
|
||||||
energy_import_daily:
|
energy_import_daily:
|
||||||
|
|||||||
Reference in New Issue
Block a user