Compare commits
16 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4e46f60b65 | |||
| 9e7684e294 | |||
| 818b06f3d7 | |||
| 99bb2594e2 | |||
| 9104cd8fdc | |||
| 96b88624d9 | |||
| c1ba3012d4 | |||
| e77d9ee8d2 | |||
| bf49633fac | |||
| 99579a30f7 | |||
| 250bfa94bd | |||
| c342efc08f | |||
| 13e58355da | |||
| ee814c4afe | |||
| 6149a9e994 | |||
| 35e7f81224 |
+1
-1
@@ -1 +1 @@
|
|||||||
2026.7.1
|
2026.7.2
|
||||||
@@ -1438,3 +1438,22 @@
|
|||||||
device_id: 6d1be741876624a70ab5b01b54c6fd6f
|
device_id: 6d1be741876624a70ab5b01b54c6fd6f
|
||||||
entity_id: 621e4377a089b7f5d92c7c9f2cc171a1
|
entity_id: 621e4377a089b7f5d92c7c9f2cc171a1
|
||||||
domain: switch
|
domain: switch
|
||||||
|
|
||||||
|
- id: epaper_daily_demotivational_quote
|
||||||
|
alias: Epaper tägliches Demotivationszitat
|
||||||
|
description: Wählt täglich ein festes Zitat aus der lokalen Zitatbibliothek aus.
|
||||||
|
triggers:
|
||||||
|
- trigger: homeassistant
|
||||||
|
event: start
|
||||||
|
- trigger: time
|
||||||
|
at: "00:00:00"
|
||||||
|
conditions: []
|
||||||
|
actions:
|
||||||
|
- action: input_select.select_option
|
||||||
|
target:
|
||||||
|
entity_id: input_select.epaper_demotivationszitat
|
||||||
|
data:
|
||||||
|
option: >-
|
||||||
|
{% set quotes = state_attr('input_select.epaper_demotivationszitat', 'options') %}
|
||||||
|
{{ quotes[(now().strftime('%j') | int - 1) % (quotes | count)] }}
|
||||||
|
mode: single
|
||||||
|
|||||||
@@ -38,6 +38,9 @@ mqtt_statestream: !include mqtt_statestream.yaml
|
|||||||
# Calendar data is normalised in a sandboxed script before ESPHome receives it.
|
# Calendar data is normalised in a sandboxed script before ESPHome receives it.
|
||||||
python_script:
|
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
|
||||||
|
|
||||||
|
|||||||
+118
-33
@@ -15,13 +15,15 @@ esphome:
|
|||||||
priority: -10
|
priority: -10
|
||||||
then:
|
then:
|
||||||
- delay: 10s
|
- delay: 10s
|
||||||
- display.page.show: environment # temporary for power page dev
|
- display.page.show: calendar # temporary for power page dev
|
||||||
- component.update: epaper
|
- component.update: epaper
|
||||||
|
|
||||||
esp32:
|
esp32:
|
||||||
board: nodemcu-32s
|
board: nodemcu-32s
|
||||||
framework:
|
framework:
|
||||||
type: esp-idf
|
type: esp-idf
|
||||||
|
advanced:
|
||||||
|
minimum_chip_revision: "3.0"
|
||||||
|
|
||||||
wifi:
|
wifi:
|
||||||
ssid: "Voltage-legacy"
|
ssid: "Voltage-legacy"
|
||||||
@@ -46,6 +48,16 @@ api:
|
|||||||
encryption:
|
encryption:
|
||||||
key: !secret apikey
|
key: !secret apikey
|
||||||
|
|
||||||
|
# Include ArduinoJson support for the compact calendar event feed.
|
||||||
|
json:
|
||||||
|
|
||||||
|
# Avoid refreshing the panel 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
|
||||||
@@ -217,6 +229,22 @@ text_sensor:
|
|||||||
entity_id: sensor.epaper_kalenderdaten
|
entity_id: sensor.epaper_kalenderdaten
|
||||||
attribute: entries
|
attribute: entries
|
||||||
id: calendar_entries
|
id: calendar_entries
|
||||||
|
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
|
||||||
|
entity_id: sensor.epaper_demotivationszitat
|
||||||
|
id: demotivational_quote
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -233,14 +261,19 @@ 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
|
# Refresh environmental readings every 10 minutes. The calendar page is
|
||||||
|
# redrawn only when its event feed actually changes.
|
||||||
- seconds: 0
|
- seconds: 0
|
||||||
minutes: /10
|
minutes: /10
|
||||||
then:
|
then:
|
||||||
- logger.log:
|
- if:
|
||||||
level: INFO
|
condition:
|
||||||
format: "Timer based screen refresh"
|
display.is_displaying_page: environment
|
||||||
- component.update: epaper
|
then:
|
||||||
|
- logger.log:
|
||||||
|
level: INFO
|
||||||
|
format: "Timer based environment screen refresh"
|
||||||
|
- component.update: epaper
|
||||||
|
|
||||||
# Font definitions
|
# Font definitions
|
||||||
font:
|
font:
|
||||||
@@ -248,6 +281,12 @@ font:
|
|||||||
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
|
||||||
@@ -1136,11 +1175,11 @@ display:
|
|||||||
|
|
||||||
/* LEFT PANE: agenda */
|
/* LEFT PANE: agenda */
|
||||||
it.image(10, 10, id(c1024_logo));
|
it.image(10, 10, id(c1024_logo));
|
||||||
it.print(100, 27, id(roboto_med_30), TextAlign::BASELINE_LEFT, "TERMINE");
|
it.print(226, 38, id(roboto_med_30), TextAlign::BASELINE_CENTER, "TERMINE");
|
||||||
it.line(10, 55, 355, 55);
|
it.line(10, 55, 355, 55);
|
||||||
it.line(365, 10, 365, 352);
|
it.line(365, 10, 365, 352);
|
||||||
|
|
||||||
DynamicJsonDocument calendar_doc(3072);
|
JsonDocument calendar_doc;
|
||||||
const DeserializationError calendar_error = deserializeJson(calendar_doc, id(calendar_entries).state.c_str());
|
const DeserializationError calendar_error = deserializeJson(calendar_doc, id(calendar_entries).state.c_str());
|
||||||
JsonArray calendar_days = calendar_doc.as<JsonArray>();
|
JsonArray calendar_days = calendar_doc.as<JsonArray>();
|
||||||
int agenda_y = 72;
|
int agenda_y = 72;
|
||||||
@@ -1161,31 +1200,37 @@ display:
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const int group_y = agenda_y;
|
||||||
|
int event_y = group_y;
|
||||||
const int day_number = day["day"] | 0;
|
const int day_number = day["day"] | 0;
|
||||||
const char *weekday = day["weekday"] | "";
|
const char *weekday = day["weekday"] | "";
|
||||||
const bool is_today = (day["today"] | 0) == 1;
|
it.printf(30, group_y, id(sub_sensor_font), TextAlign::TOP_CENTER, "%d", day_number);
|
||||||
it.printf(30, agenda_y, id(sub_sensor_font), TextAlign::TOP_CENTER, "%d", day_number);
|
it.printf(30, group_y + 28, id(footer_font), TextAlign::TOP_CENTER, "%s", weekday);
|
||||||
it.printf(30, agenda_y + 28, id(footer_font), TextAlign::TOP_CENTER, "%s", weekday);
|
|
||||||
it.print(68, agenda_y + 2, id(footer_font), TextAlign::TOP_LEFT, is_today ? "HEUTE" : "");
|
|
||||||
it.line(58, agenda_y, 58, agenda_y + 32 + events.size() * 35);
|
|
||||||
agenda_y += 36;
|
|
||||||
|
|
||||||
for (JsonVariant event_variant : events) {
|
for (JsonVariant event_variant : events) {
|
||||||
if (agenda_y + 33 > 345) {
|
if (event_y + 33 > 345) {
|
||||||
has_hidden_events = true;
|
has_hidden_events = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
JsonObject event = event_variant.as<JsonObject>();
|
JsonObject event = event_variant.as<JsonObject>();
|
||||||
const char *title = event["title"] | "Ohne Titel";
|
const char *title = event["title"] | "Ohne Titel";
|
||||||
const char *time = event["time"] | "";
|
const char *time = event["time"] | "";
|
||||||
|
const char *end_time = event["end"] | "";
|
||||||
const char *meta = event["meta"] | "";
|
const char *meta = event["meta"] | "";
|
||||||
it.printf(72, agenda_y, id(sensor_unit), TextAlign::TOP_LEFT, "%s", title);
|
it.printf(72, event_y, id(sensor_unit), TextAlign::TOP_LEFT, "%s", title);
|
||||||
it.printf(350, agenda_y, id(sensor_unit), TextAlign::TOP_RIGHT, "%s", time);
|
it.printf(350, event_y, id(sensor_unit), TextAlign::TOP_RIGHT, "%s", time);
|
||||||
it.printf(72, agenda_y + 20, id(footer_font), TextAlign::TOP_LEFT, "%s", meta);
|
it.printf(72, event_y + 20, id(footer_font), TextAlign::TOP_LEFT, "%s", meta);
|
||||||
agenda_y += 35;
|
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;
|
has_events = true;
|
||||||
}
|
}
|
||||||
agenda_y += 5;
|
|
||||||
|
int group_bottom = event_y;
|
||||||
|
if (group_bottom < group_y + 36) group_bottom = group_y + 36;
|
||||||
|
it.line(58, group_y, 58, group_bottom);
|
||||||
|
agenda_y = group_bottom + 5;
|
||||||
if (has_hidden_events) break;
|
if (has_hidden_events) break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1193,15 +1238,12 @@ display:
|
|||||||
if (!has_events && !calendar_error && !calendar_days.isNull() && calendar_days.size() > 0) {
|
if (!has_events && !calendar_error && !calendar_days.isNull() && calendar_days.size() > 0) {
|
||||||
it.print(18, 72, id(sensor_unit), TextAlign::TOP_LEFT, "Keine Termine im sichtbaren Bereich.");
|
it.print(18, 72, id(sensor_unit), TextAlign::TOP_LEFT, "Keine Termine im sichtbaren Bereich.");
|
||||||
}
|
}
|
||||||
if (has_hidden_events) {
|
|
||||||
it.print(72, 340, id(footer_font), TextAlign::TOP_LEFT, "Weitere Termine vorhanden ...");
|
|
||||||
}
|
|
||||||
|
|
||||||
/* RIGHT TOP: month view, Monday-first with ISO week numbers */
|
/* RIGHT TOP: month view, Monday-first with ISO week numbers */
|
||||||
char month_title[24];
|
char month_title[24];
|
||||||
snprintf(month_title, sizeof(month_title), "%s %d", months[month - 1], year);
|
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.printf(502, 18, id(sensor_unit), TextAlign::TOP_CENTER, "%s", month_title);
|
||||||
it.line(375, 28, 630, 28);
|
|
||||||
it.print(384, 47, id(footer_font), TextAlign::TOP_CENTER, "KW");
|
it.print(384, 47, id(footer_font), TextAlign::TOP_CENTER, "KW");
|
||||||
for (int column = 0; column < 7; column++) {
|
for (int column = 0; column < 7; column++) {
|
||||||
it.printf(415 + column * 30, 47, id(footer_font), TextAlign::TOP_CENTER, "%s", weekdays[column]);
|
it.printf(415 + column * 30, 47, id(footer_font), TextAlign::TOP_CENTER, "%s", weekdays[column]);
|
||||||
@@ -1209,7 +1251,8 @@ display:
|
|||||||
|
|
||||||
const int first_weekday = weekday_monday(year, month, 1);
|
const int first_weekday = weekday_monday(year, month, 1);
|
||||||
const int month_days = days_in_month(year, month);
|
const int month_days = days_in_month(year, month);
|
||||||
for (int row = 0; row < 6; row++) {
|
const int calendar_rows = (first_weekday + month_days + 6) / 7;
|
||||||
|
for (int row = 0; row < calendar_rows; row++) {
|
||||||
const int monday_day = 1 - first_weekday + row * 7;
|
const int monday_day = 1 - first_weekday + row * 7;
|
||||||
int week_year = year;
|
int week_year = year;
|
||||||
int week_month = month;
|
int week_month = month;
|
||||||
@@ -1237,21 +1280,63 @@ display:
|
|||||||
if (day < 1 || day > month_days) continue;
|
if (day < 1 || day > month_days) continue;
|
||||||
const int cell_x = 415 + column * 30;
|
const int cell_x = 415 + column * 30;
|
||||||
if (day == today) {
|
if (day == today) {
|
||||||
it.filled_rectangle(cell_x - 12, cell_y - 2, 25, 18, Color::BLACK);
|
it.filled_rectangle(cell_x - 12, cell_y - 2, 25, 18, COLOR_ON);
|
||||||
it.printf(cell_x, cell_y, id(footer_font), Color::WHITE, TextAlign::TOP_CENTER, "%d", day);
|
it.printf(cell_x, cell_y, id(calendar_day_bold), COLOR_OFF, TextAlign::TOP_CENTER, "%d", day);
|
||||||
} else {
|
} else {
|
||||||
it.printf(cell_x, cell_y, id(footer_font), TextAlign::TOP_CENTER, "%d", day);
|
it.printf(cell_x, cell_y, id(footer_font), TextAlign::TOP_CENTER, "%d", day);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* RIGHT BOTTOM: quote placeholder, intentionally inverted */
|
/* RIGHT BOTTOM: daily quote selected by Home Assistant */
|
||||||
it.filled_rectangle(375, 220, 255, 130, Color::BLACK);
|
it.filled_rectangle(375, 220, 255, 130, COLOR_ON);
|
||||||
it.print(502, 234, id(footer_font), Color::WHITE, TextAlign::TOP_CENTER, "DEMOTIVATION");
|
std::string quote = "Zitat wird geladen.";
|
||||||
it.print(502, 267, id(sensor_unit), Color::WHITE, TextAlign::TOP_CENTER, "Es ist nie zu spät,");
|
if (id(demotivational_quote).has_state() && !id(demotivational_quote).state.empty()) {
|
||||||
it.print(502, 291, id(sensor_unit), Color::WHITE, TextAlign::TOP_CENTER, "die Erwartungen zu senken.");
|
quote = id(demotivational_quote).state;
|
||||||
it.print(502, 326, id(footer_font), Color::WHITE, TextAlign::TOP_CENTER, "Zitatquelle folgt");
|
}
|
||||||
|
const size_t max_quote_characters = 27;
|
||||||
|
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++;
|
||||||
|
}
|
||||||
|
|
||||||
/* FOOTER */
|
/* FOOTER */
|
||||||
it.strftime(614, 380, id(footer_font), TextAlign::BASELINE_RIGHT,
|
it.strftime(614, 380, id(footer_font), TextAlign::BASELINE_RIGHT,
|
||||||
"Aktualisiert um %d.%m.%Y %H:%M", now);
|
"Aktualisiert um %d.%m.%Y %H:%M", now);
|
||||||
|
|
||||||
|
/* WiFi Signal strength */
|
||||||
|
if(id(wifisignal).has_state()) {
|
||||||
|
int x = 630;
|
||||||
|
int y = 384;
|
||||||
|
if (id(wifisignal).state >= -50) {
|
||||||
|
// Excellent
|
||||||
|
it.print(x, y, id(mdi_wifi), TextAlign::BASELINE_CENTER, "");
|
||||||
|
ESP_LOGI("WiFi", "Excellent");
|
||||||
|
} else if (id(wifisignal).state >= -60) {
|
||||||
|
// Good
|
||||||
|
it.print(x, y, id(mdi_wifi), TextAlign::BASELINE_CENTER, "");
|
||||||
|
ESP_LOGI("WiFi", "Good");
|
||||||
|
} else if (id(wifisignal).state >= -75) {
|
||||||
|
// Fair
|
||||||
|
it.print(x, y, id(mdi_wifi), TextAlign::BASELINE_CENTER, "");
|
||||||
|
ESP_LOGI("WiFi", "Fair");
|
||||||
|
} else if (id(wifisignal).state >= -100) {
|
||||||
|
// Weak
|
||||||
|
it.print(x, y, id(mdi_wifi), TextAlign::BASELINE_CENTER, "");
|
||||||
|
ESP_LOGI("WiFi", "Weak");
|
||||||
|
} else {
|
||||||
|
// Unlikely working signal
|
||||||
|
it.print(x, y, id(mdi_wifi), TextAlign::BASELINE_CENTER, "");
|
||||||
|
ESP_LOGI("WiFi", "Unlikely");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -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."
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
# Calendar data is compacted here so the ESP32 only receives display-ready entries.
|
|
||||||
CALENDAR_NAMES = {
|
CALENDAR_NAMES = {
|
||||||
"calendar.tkrz_kalender": "Arbeit",
|
"calendar.tkrz_kalender": "Arbeit",
|
||||||
"calendar.privat": "Privat",
|
"calendar.privat": "Privat",
|
||||||
}
|
}
|
||||||
DAY_NAMES = ["Mo", "Di", "Mi", "Do", "Fr", "Sa", "So"]
|
DAY_NAMES = ["Mo", "Di", "Mi", "Do", "Fr", "Sa", "So"]
|
||||||
MAX_ENTRIES = 8
|
MAX_ENTRIES = 8
|
||||||
MAX_TITLE_LENGTH = 28
|
# Reserve the right side of each row for start and end times.
|
||||||
MAX_META_LENGTH = 32
|
MAX_TITLE_LENGTH = 22
|
||||||
|
MAX_META_LENGTH = 35
|
||||||
|
|
||||||
|
|
||||||
def shorten(value, maximum):
|
def shorten(value, maximum):
|
||||||
@@ -19,7 +19,9 @@ def shorten(value, maximum):
|
|||||||
def compact_event(event, calendar_name):
|
def compact_event(event, calendar_name):
|
||||||
start = event.get("start", "")
|
start = event.get("start", "")
|
||||||
all_day = "T" not in start
|
all_day = "T" not in start
|
||||||
|
end = event.get("end", "")
|
||||||
time = "ganztägig" if all_day else start[11:16]
|
time = "ganztägig" 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()
|
location = (event.get("location") or "").split("\n")[0].strip()
|
||||||
meta = calendar_name
|
meta = calendar_name
|
||||||
@@ -29,6 +31,7 @@ def compact_event(event, calendar_name):
|
|||||||
return {
|
return {
|
||||||
"title": shorten(event.get("summary", "Ohne Titel"), MAX_TITLE_LENGTH),
|
"title": shorten(event.get("summary", "Ohne Titel"), MAX_TITLE_LENGTH),
|
||||||
"time": time,
|
"time": time,
|
||||||
|
"end": end_time,
|
||||||
"meta": shorten(meta, MAX_META_LENGTH),
|
"meta": shorten(meta, MAX_META_LENGTH),
|
||||||
"all_day": int(all_day),
|
"all_day": int(all_day),
|
||||||
}
|
}
|
||||||
|
|||||||
+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.25
|
||||||
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.25
|
||||||
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
|
||||||
|
|||||||
@@ -49,6 +49,10 @@
|
|||||||
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'
|
||||||
|
|||||||
+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