Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| df047f61fb | |||
| 67a0a03093 | |||
| 8f90ef1cb4 | |||
| 7c3186563a | |||
| 4f6ea199d4 | |||
| f57a7f94fd | |||
| c2060b6495 | |||
| 987bb977ce | |||
| 83450c11c2 | |||
| af8f74dfb7 | |||
| d609d780e8 |
@@ -1393,3 +1393,113 @@
|
|||||||
device_id: 6d1be741876624a70ab5b01b54c6fd6f
|
device_id: 6d1be741876624a70ab5b01b54c6fd6f
|
||||||
entity_id: 621e4377a089b7f5d92c7c9f2cc171a1
|
entity_id: 621e4377a089b7f5d92c7c9f2cc171a1
|
||||||
domain: switch
|
domain: switch
|
||||||
|
- id: '1773000000001'
|
||||||
|
alias: epaperframe - Kalender Events laden
|
||||||
|
description: Ruft alle Events von calendar.privat und calendar.tkrz_kalender für heute und morgen ab und schreibt sie in input_text-Helfer.
|
||||||
|
triggers:
|
||||||
|
# Täglich um 00:01 neu holen
|
||||||
|
- trigger: time
|
||||||
|
at: '00:01:00'
|
||||||
|
id: daily
|
||||||
|
actions:
|
||||||
|
# ── Events für heute (00:00 bis 23:59) holen ──
|
||||||
|
- action: calendar.get_events
|
||||||
|
target:
|
||||||
|
entity_id:
|
||||||
|
- calendar.privat
|
||||||
|
- calendar.tkrz_kalender
|
||||||
|
data:
|
||||||
|
start_date_time: "{{ now().replace(hour=0, minute=0, second=0) }}"
|
||||||
|
end_date_time: "{{ (now().replace(hour=0, minute=0, second=0) + timedelta(days=1)) }}"
|
||||||
|
response_variable: today_evts
|
||||||
|
|
||||||
|
# ── 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
|
||||||
|
|
||||||
|
# ── Helper: Events als kompakte Liste formatieren ──
|
||||||
|
|
||||||
|
# Privat heute
|
||||||
|
- set_var:
|
||||||
|
name: fmt_today_privat
|
||||||
|
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 '-' }}
|
||||||
|
|
||||||
|
# Arbeit heute
|
||||||
|
- set_var:
|
||||||
|
name: fmt_today_arbeit
|
||||||
|
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 '-' }}
|
||||||
|
|
||||||
|
# Privat morgen
|
||||||
|
- set_var:
|
||||||
|
name: fmt_tomorrow_privat
|
||||||
|
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 '-' }}
|
||||||
|
|
||||||
|
# Arbeit morgen
|
||||||
|
- set_var:
|
||||||
|
name: fmt_tomorrow_arbeit
|
||||||
|
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 '-' }}
|
||||||
|
|
||||||
|
# ── input_text Helfer schreiben ──
|
||||||
|
- action: input_text.set_value
|
||||||
|
target:
|
||||||
|
entity_id: input_text.kalender_heute_privat
|
||||||
|
data:
|
||||||
|
value: "{{ fmt_today_privat }}"
|
||||||
|
- action: input_text.set_value
|
||||||
|
target:
|
||||||
|
entity_id: input_text.kalender_heute_arbeit
|
||||||
|
data:
|
||||||
|
value: "{{ fmt_today_arbeit }}"
|
||||||
|
- action: input_text.set_value
|
||||||
|
target:
|
||||||
|
entity_id: input_text.kalender_morgen_privat
|
||||||
|
data:
|
||||||
|
value: "{{ fmt_tomorrow_privat }}"
|
||||||
|
- action: input_text.set_value
|
||||||
|
target:
|
||||||
|
entity_id: input_text.kalender_morgen_arbeit
|
||||||
|
data:
|
||||||
|
value: "{{ fmt_tomorrow_arbeit }}"
|
||||||
|
|||||||
@@ -49,6 +49,9 @@ 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
|
||||||
|
|
||||||
|
|||||||
+215
-60
@@ -15,7 +15,7 @@ esphome:
|
|||||||
priority: -10
|
priority: -10
|
||||||
then:
|
then:
|
||||||
- delay: 10s
|
- delay: 10s
|
||||||
- display.page.show: power # temporary for power page dev
|
- display.page.show: calendar # temporary for power page dev
|
||||||
- component.update: epaper
|
- component.update: epaper
|
||||||
|
|
||||||
esp32:
|
esp32:
|
||||||
@@ -23,10 +23,13 @@ esp32:
|
|||||||
framework:
|
framework:
|
||||||
type: esp-idf
|
type: esp-idf
|
||||||
|
|
||||||
|
network:
|
||||||
|
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
|
||||||
@@ -234,21 +237,26 @@ text_sensor:
|
|||||||
entity_id: weather.zuhause
|
entity_id: weather.zuhause
|
||||||
id: weather
|
id: weather
|
||||||
|
|
||||||
|
# ── Kalender-Ereignisse (from HA input_text helpers) ──
|
||||||
- platform: homeassistant
|
- platform: homeassistant
|
||||||
entity_id: sensor.schlafzimmer_co2_warnstufe
|
entity_id: sensor.kalender_heute_privat
|
||||||
id: szco2
|
id: kalender_heute_privat
|
||||||
|
internal: true
|
||||||
|
|
||||||
- platform: homeassistant
|
- platform: homeassistant
|
||||||
entity_id: sensor.schlafzimmer_feinstaub_warnstufe
|
entity_id: sensor.kalender_heute_arbeit
|
||||||
id: szpm
|
id: kalender_heute_arbeit
|
||||||
|
internal: true
|
||||||
|
|
||||||
- platform: homeassistant
|
- platform: homeassistant
|
||||||
entity_id: sensor.wohnzimmer_co2_warnstufe
|
entity_id: sensor.kalender_morgen_privat
|
||||||
id: wzco2
|
id: kalender_morgen_privat
|
||||||
|
internal: true
|
||||||
|
|
||||||
- platform: homeassistant
|
- platform: homeassistant
|
||||||
entity_id: sensor.wohnzimmer_feinstaub_warnstufe
|
entity_id: sensor.kalender_morgen_arbeit
|
||||||
id: wzpm
|
id: kalender_morgen_arbeit
|
||||||
|
internal: true
|
||||||
|
|
||||||
graph:
|
graph:
|
||||||
- id: line_power_graph
|
- id: line_power_graph
|
||||||
@@ -775,10 +783,10 @@ display:
|
|||||||
float sleepingroom_co2 = id(co2_sleepingroom).state;
|
float sleepingroom_co2 = id(co2_sleepingroom).state;
|
||||||
int sleepingroom_pm25 = int(id(pm25_sleepingroom).state);
|
int sleepingroom_pm25 = int(id(pm25_sleepingroom).state);
|
||||||
/* Children's room */
|
/* Children's room */
|
||||||
float childrensroom_temp = id(temp_sleepingroom).state;
|
float childrensroom_temp = id(temp_childrensroom).state;
|
||||||
int childrensroom_humid = int(id(humid_sleepingroom).state);
|
int childrensroom_humid = int(id(humid_childrensroom).state);
|
||||||
float childrensroom_co2 = id(co2_sleepingroom).state;
|
float childrensroom_co2 = id(co2_childrensroom).state;
|
||||||
int childrensroom_pm25 = int(id(pm25_sleepingroom).state);
|
int childrensroom_pm25 = int(id(pm25_childrensroom).state);
|
||||||
|
|
||||||
int offsetX = 0;
|
int offsetX = 0;
|
||||||
int offsetY = 0;
|
int offsetY = 0;
|
||||||
@@ -834,86 +842,86 @@ display:
|
|||||||
/* Livingroom */
|
/* Livingroom */
|
||||||
offsetY = 127;
|
offsetY = 127;
|
||||||
it.print(10, 10 + offsetY, id(sensor_unit), "Wohnzimmer");
|
it.print(10, 10 + offsetY, id(sensor_unit), "Wohnzimmer");
|
||||||
it.filled_rectangle(136, 21 + offsetY, 247, 3);
|
it.filled_rectangle(136, 21 + offsetY, 169, 3);
|
||||||
it.print(10, 125 + offsetY, id(mdi_small), TextAlign::BASELINE_LEFT, ""); // PM2.5
|
it.print(10, 125 + offsetY, id(mdi_small), TextAlign::BASELINE_LEFT, ""); // PM2.5
|
||||||
it.print(375, 75 + offsetY, id(mdi_small), TextAlign::BASELINE_CENTER, ""); // thermometer
|
it.print(305, 75 + offsetY, id(mdi_small), TextAlign::BASELINE_CENTER, ""); // thermometer
|
||||||
it.print(375, 125 + offsetY, id(mdi_small), TextAlign::BASELINE_CENTER, ""); // water percent
|
it.print(305, 125 + offsetY, id(mdi_small), TextAlign::BASELINE_CENTER, ""); // water percent
|
||||||
it.print(10, 75 + offsetY, id(mdi_small), TextAlign::BASELINE_LEFT, ""); // CO2
|
it.print(10, 75 + offsetY, id(mdi_small), TextAlign::BASELINE_LEFT, ""); // CO2
|
||||||
|
|
||||||
|
|
||||||
if(livingroom_temp > -100 && livingroom_temp < 100) {
|
if(livingroom_temp > -100 && livingroom_temp < 100) {
|
||||||
it.printf(357, 75 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, "%2.1fºC", livingroom_temp);
|
it.printf(287, 75 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, "%2.1fºC", livingroom_temp);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
it.print(357, 75 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, " - ºC");
|
it.print(287, 75 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, " - ºC");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(livingroom_humid >=0 && livingroom_humid <= 100) {
|
if(livingroom_humid >=0 && livingroom_humid <= 100) {
|
||||||
it.printf(357, 125 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, "%3d%%", livingroom_humid);
|
it.printf(287, 125 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, "%3d%%", livingroom_humid);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
it.print(357, 125 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, " - %");
|
it.print(287, 125 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, " - %");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(livingroom_co2 >=380 && livingroom_co2 <= 20000) {
|
if(livingroom_co2 >=380 && livingroom_co2 <= 20000) {
|
||||||
it.printf(170, 75 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "%4.0f", livingroom_co2);
|
it.printf(150, 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");
|
it.print(155, 50 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "ppm");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
it.print(170, 75 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "- ");
|
it.print(150, 75 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "- ");
|
||||||
it.print(175, 50 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "ppm³");
|
it.print(155, 50 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "ppm³");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(livingroom_pm25 < 255 && livingroom_pm25 >=0) {
|
if(livingroom_pm25 < 255 && livingroom_pm25 >=0) {
|
||||||
it.printf(220, 125 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "%3d", livingroom_pm25);
|
it.printf(150, 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³");
|
it.print(155, 125 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "µg/m³");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
it.print(220, 125 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "- ");
|
it.print(150, 125 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "- ");
|
||||||
it.print(225, 125 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "µg/m³");
|
it.print(155, 125 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "µg/m³");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Sleepingroom */
|
/* Sleepingroom */
|
||||||
offsetY = 247;
|
offsetY = 247;
|
||||||
it.print(10, 10 + offsetY, id(sensor_unit), "Schlafzimmer");
|
it.print(10, 10 + offsetY, id(sensor_unit), "Schlafzimmer");
|
||||||
it.filled_rectangle(144, 21 + offsetY, 239, 3);
|
it.filled_rectangle(144, 21 + offsetY, 161, 3);
|
||||||
it.print(10, 124 + offsetY, id(mdi_small), TextAlign::BASELINE_LEFT, ""); // PM2.5
|
it.print(10, 125 + offsetY, id(mdi_small), TextAlign::BASELINE_LEFT, ""); // PM2.5
|
||||||
it.print(375, 75 + offsetY, id(mdi_small), TextAlign::BASELINE_CENTER, ""); // thermometer
|
it.print(305, 75 + offsetY, id(mdi_small), TextAlign::BASELINE_CENTER, ""); // thermometer
|
||||||
it.print(375, 124 + offsetY, id(mdi_small), TextAlign::BASELINE_CENTER, ""); // water percent
|
it.print(305, 125 + offsetY, id(mdi_small), TextAlign::BASELINE_CENTER, ""); // water percent
|
||||||
it.print(10, 75 + offsetY, id(mdi_small), TextAlign::BASELINE_LEFT, ""); // CO2
|
it.print(10, 75 + offsetY, id(mdi_small), TextAlign::BASELINE_LEFT, ""); // CO2
|
||||||
|
|
||||||
|
|
||||||
if(sleepingroom_temp > -100 && sleepingroom_temp < 100) {
|
if(sleepingroom_temp > -100 && sleepingroom_temp < 100) {
|
||||||
it.printf(357, 75 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, "%2.1fºC", sleepingroom_temp);
|
it.printf(287, 75 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, "%2.1fºC", sleepingroom_temp);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
it.print(357, 75 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, " - ºC");
|
it.print(287, 75 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, " - ºC");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(sleepingroom_humid >=0 && sleepingroom_humid <= 100) {
|
if(sleepingroom_humid >=0 && sleepingroom_humid <= 100) {
|
||||||
it.printf(357, 125 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, "%3d%%", sleepingroom_humid);
|
it.printf(287, 125 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, "%3d%%", sleepingroom_humid);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
it.print(357, 125 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, " - %");
|
it.print(287, 125 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, " - %");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(sleepingroom_co2 >=380 && sleepingroom_co2 <= 20000) {
|
if(sleepingroom_co2 >=380 && sleepingroom_co2 <= 20000) {
|
||||||
it.printf(170, 75 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "%4.0f", sleepingroom_co2);
|
it.printf(150, 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");
|
it.print(155, 50 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "ppm");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
it.print(170, 75 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "- ");
|
it.print(150, 75 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "- ");
|
||||||
it.print(175, 50 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "ppm³");
|
it.print(155, 50 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "ppm³");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(sleepingroom_pm25 < 255 && sleepingroom_pm25 >=0) {
|
if(sleepingroom_pm25 < 255 && sleepingroom_pm25 >=0) {
|
||||||
it.printf(220, 125 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "%3d", sleepingroom_pm25);
|
it.printf(150, 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³");
|
it.print(155, 125 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "µg/m³");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
it.print(220, 125 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "- ");
|
it.print(150, 125 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "- ");
|
||||||
it.print(225, 125 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "µg/m³");
|
it.print(155, 125 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "µg/m³");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Weather */
|
/* Weather */
|
||||||
@@ -924,7 +932,7 @@ display:
|
|||||||
/* Current weather */
|
/* Current weather */
|
||||||
if(id(weather).has_state()) {
|
if(id(weather).has_state()) {
|
||||||
int x = 227 + offsetX;
|
int x = 227 + offsetX;
|
||||||
int y = 116;
|
int y = 96;
|
||||||
if (id(weather).state == "clear-night") {
|
if (id(weather).state == "clear-night") {
|
||||||
// clear night
|
// clear night
|
||||||
it.print(x, y, id(mdi_weather), TextAlign::BASELINE_RIGHT, "");
|
it.print(x, y, id(mdi_weather), TextAlign::BASELINE_RIGHT, "");
|
||||||
@@ -995,7 +1003,7 @@ display:
|
|||||||
/* Moon phase display */
|
/* Moon phase display */
|
||||||
if(id(moonphase).has_state()) {
|
if(id(moonphase).has_state()) {
|
||||||
int x = 10 + offsetX;
|
int x = 10 + offsetX;
|
||||||
int y = 116;
|
int y = 96;
|
||||||
if (id(moonphase).state == "new_moon") {
|
if (id(moonphase).state == "new_moon") {
|
||||||
// new moon
|
// new moon
|
||||||
it.print(x, y, id(mdi_weather), TextAlign::BASELINE_LEFT, "");
|
it.print(x, y, id(mdi_weather), TextAlign::BASELINE_LEFT, "");
|
||||||
@@ -1035,30 +1043,66 @@ display:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Warnings */
|
it.print(10 + offsetX, 130, id(mdi_small), TextAlign::BASELINE_LEFT, ""); // sun-up
|
||||||
if(id(szco2).state == "rot" || id(szpm).state == "rot" || id(wzco2).state == "rot" || id(wzpm).state == "rot") {
|
it.printf(50 + offsetX, 130, id(sensor_unit), TextAlign::BASELINE_LEFT, "%s", id(sun_rising).state.c_str());
|
||||||
it.print(10 + offsetX, 200, id(mdi_med), TextAlign::BASELINE_LEFT, "");
|
it.print(135 + offsetX, 130, id(mdi_small), TextAlign::BASELINE_LEFT, ""); // sun-down
|
||||||
it.print(80 + offsetX, 200, id(big_sensor_font), TextAlign::BASELINE_LEFT, "Lüften!");
|
it.printf(175 + offsetX, 130, id(sensor_unit), TextAlign::BASELINE_LEFT, "%s", id(sun_setting).state.c_str());
|
||||||
|
|
||||||
|
/* Children's room */
|
||||||
|
offsetX = 320;
|
||||||
|
offsetY = 127;
|
||||||
|
it.print(10 + offsetX, 10 + offsetY, id(sensor_unit), "Kinderzimmer");
|
||||||
|
it.filled_rectangle(148 + offsetX, 21 + offsetY, 157, 3);
|
||||||
|
it.print(10 + offsetX, 125 + offsetY, id(mdi_small), TextAlign::BASELINE_LEFT, ""); // PM2.5
|
||||||
|
it.print(305 + offsetX, 75 + offsetY, id(mdi_small), TextAlign::BASELINE_CENTER, ""); // thermometer
|
||||||
|
it.print(305 + offsetX, 125 + offsetY, id(mdi_small), TextAlign::BASELINE_CENTER, ""); // water percent
|
||||||
|
it.print(10 + offsetX, 75 + offsetY, id(mdi_small), TextAlign::BASELINE_LEFT, ""); // CO2
|
||||||
|
|
||||||
|
if(childrensroom_temp > -100 && childrensroom_temp < 100) {
|
||||||
|
it.printf(287 + offsetX, 75 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, "%2.1fºC", childrensroom_temp);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
it.print(287 + offsetX, 75 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, " - ºC");
|
||||||
}
|
}
|
||||||
|
|
||||||
it.print(10 + offsetX, 250, id(mdi_small), TextAlign::BASELINE_LEFT, ""); // sun-up
|
if(childrensroom_humid >=0 && childrensroom_humid <= 100) {
|
||||||
it.printf(50 + offsetX, 250, id(sensor_unit), TextAlign::BASELINE_LEFT, "%s", id(sun_rising).state.c_str());
|
it.printf(287 + offsetX, 125 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, "%3d%%", childrensroom_humid);
|
||||||
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());
|
else {
|
||||||
|
it.print(287 + offsetX, 125 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, " - %");
|
||||||
|
}
|
||||||
|
|
||||||
|
if(childrensroom_co2 >=380 && childrensroom_co2 <= 20000) {
|
||||||
|
it.printf(150 + offsetX, 75 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "%4.0f", childrensroom_co2);
|
||||||
|
it.print(155 + offsetX, 50 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "ppm");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
it.print(150 + offsetX, 75 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "- ");
|
||||||
|
it.print(155 + offsetX, 50 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "ppm³");
|
||||||
|
}
|
||||||
|
|
||||||
|
if(childrensroom_pm25 < 255 && childrensroom_pm25 >=0) {
|
||||||
|
it.printf(150 + offsetX, 125 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "%3d", childrensroom_pm25);
|
||||||
|
it.print(155 + offsetX, 125 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "µg/m³");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
it.print(150 + offsetX, 125 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "- ");
|
||||||
|
it.print(155 + offsetX, 125 + offsetY, id(sensor_unit), TextAlign::BASELINE_LEFT, "µg/m³");
|
||||||
|
}
|
||||||
|
|
||||||
/* Serverroom */
|
/* Serverroom */
|
||||||
offsetY = 247;
|
offsetY = 247;
|
||||||
it.print(10 + offsetX, 10 + offsetY, id(sensor_unit), "Serverraum");
|
it.print(10 + offsetX, 10 + offsetY, id(sensor_unit), "Serverraum");
|
||||||
it.filled_rectangle(125 + offsetX, 21 + offsetY, 110, 3);
|
it.filled_rectangle(125 + offsetX, 21 + offsetY, 180, 3);
|
||||||
|
|
||||||
it.print(227 + offsetX, 110 + offsetY, id(mdi_small), TextAlign::BASELINE_CENTER, ""); // thermometer
|
it.print(305 + offsetX, 110 + offsetY, id(mdi_small), TextAlign::BASELINE_CENTER, ""); // thermometer
|
||||||
|
|
||||||
if(serverroom_temp > -100 && serverroom_temp < 100) {
|
if(serverroom_temp > -100 && serverroom_temp < 100) {
|
||||||
it.printf(207 + offsetX, 110 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, "ºC");
|
it.printf(287 + 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);
|
it.printf(250 + offsetX, 110 + offsetY, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "%2.1f", serverroom_temp);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
it.print(207 + offsetX, 110 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, " - ºC");
|
it.print(287 + offsetX, 110 + offsetY, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, " - ºC");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FOOTER */
|
/* FOOTER */
|
||||||
@@ -1090,6 +1134,117 @@ display:
|
|||||||
ESP_LOGI("WiFi", "Unlikely");
|
ESP_LOGI("WiFi", "Unlikely");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
- id: calendar
|
||||||
|
lambda: |-
|
||||||
|
/* Fetch today and tomorrow dates */
|
||||||
|
auto now = id(homeassistant_time).now();
|
||||||
|
int today_day = now.day_of_month;
|
||||||
|
int today_month = now.month;
|
||||||
|
int today_wday = now.day_of_week; // 0=Sunday .. 6=Saturday
|
||||||
|
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 */
|
||||||
|
int tomorrow_day = today_day + 1;
|
||||||
|
int tomorrow_month = today_month;
|
||||||
|
int tomorrow_wday = (today_wday + 1) % 7;
|
||||||
|
const char* tomorrow_weekday_str = weekdays[tomorrow_wday];
|
||||||
|
int tomorrow_year = today_year;
|
||||||
|
|
||||||
|
/* C1024 logo */
|
||||||
|
it.image(10, 37, id(c1024_logo));
|
||||||
|
|
||||||
|
/* ── LEFT PANE: Today ── */
|
||||||
|
int leftX = 10;
|
||||||
|
int leftY = 70; // start below header row
|
||||||
|
|
||||||
|
it.print(15 + leftX, 10 + leftY, id(sensor_unit), "Heute");
|
||||||
|
it.filled_rectangle(80 + leftX, 21 + leftY, 240, 3);
|
||||||
|
|
||||||
|
/* Today's date strip */
|
||||||
|
it.printf(50 + leftX, 50 + leftY, id(big_sensor_font), "%d", today_day);
|
||||||
|
it.printf(145 + leftX, 45 + leftY, id(sub_sensor_font), "%s.", today_weekday_str);
|
||||||
|
it.printf(205 + leftX, 45 + leftY, id(sensor_unit), "%02d.%04d.", today_month, today_year);
|
||||||
|
|
||||||
|
/* 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 {
|
||||||
|
it.print(10 + leftX, 50 + leftY + eventOffsetY, id(mdi_med), TextAlign::BASELINE_LEFT, "\U0001f32e" );
|
||||||
|
it.printf(40 + leftX, 50 + leftY + eventOffsetY, id(sub_sensor_font), "Kein Termin");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Arbeit today
|
||||||
|
if (id(kalender_heute_arbeit).has_state() && !id(kalender_heute_arbeit).state.empty()) {
|
||||||
|
it.print(10 + leftX, 85 + leftY + eventOffsetY, id(mdi_med), TextAlign::BASELINE_LEFT, "\U0001f32e" );
|
||||||
|
it.printf(40 + leftX, 85 + leftY + eventOffsetY, id(sub_sensor_font), "%s",
|
||||||
|
id(kalender_heute_arbeit).state.substr(0, 60).c_str());
|
||||||
|
} else {
|
||||||
|
it.print(10 + leftX, 85 + leftY + eventOffsetY, id(mdi_med), TextAlign::BASELINE_LEFT, "\U0001f32e" );
|
||||||
|
it.printf(40 + leftX, 85 + leftY + eventOffsetY, id(sub_sensor_font), "Kein Termin");
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ── RIGHT PANE: Tomorrow ── */
|
||||||
|
int rightX = 315;
|
||||||
|
int rightY = 70;
|
||||||
|
|
||||||
|
it.print(45 + rightX, 10 + rightY, id(sensor_unit), "Morgen");
|
||||||
|
it.filled_rectangle(130 + rightX, 21 + rightY, 200, 3);
|
||||||
|
|
||||||
|
/* Date strip */
|
||||||
|
it.printf(50 + rightX, 50 + rightY, id(big_sensor_font), "%d", tomorrow_day);
|
||||||
|
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
|
- id: power
|
||||||
lambda: |-
|
lambda: |-
|
||||||
|
|
||||||
|
|||||||
+28
-2
@@ -139,8 +139,34 @@
|
|||||||
attributes:
|
attributes:
|
||||||
last_reset: '1970-01-01T00:00:00+00:00'
|
last_reset: '1970-01-01T00:00:00+00:00'
|
||||||
- name: internet_speed_out
|
- name: internet_speed_out
|
||||||
|
unique_id: '9519483670667'
|
||||||
state: >
|
state: >
|
||||||
{{ (( states('sensor.wan_out_derivative') | float * 8 / 1000000 ) | round(2)) }}
|
{{ (( states('sensor.wan_out_derivative') | float * 8 / 1000000 ) | round(2)) }}
|
||||||
unit_of_measurement: 'Mbps'
|
unit_of_measurement: 'Mbps'
|
||||||
attributes:
|
|
||||||
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.
|
||||||
|
- text_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
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
# Helpers for epaperframe calendar display
|
||||||
|
input_text:
|
||||||
|
- name: "Kalender heute Privat"
|
||||||
|
initial: "-"
|
||||||
|
icon: mdi:calendar-account
|
||||||
|
mode: text
|
||||||
|
- name: "Kalender heute Arbeit"
|
||||||
|
initial: "-"
|
||||||
|
icon: mdi:calendar-account
|
||||||
|
mode: text
|
||||||
|
- name: "Kalender morgen Privat"
|
||||||
|
initial: "-"
|
||||||
|
icon: mdi:calendar-calendar-today
|
||||||
|
mode: text
|
||||||
|
- name: "Kalender morgen Arbeit"
|
||||||
|
initial: "-"
|
||||||
|
icon: mdi:calendar-calendar-today
|
||||||
|
mode: text
|
||||||
Reference in New Issue
Block a user