Compare commits
20 Commits
ee814c4afe
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| d23c6a23a3 | |||
| 166cc3efd5 | |||
| e358c2cffe | |||
| 5d4e8ef40c | |||
| 8dc781a6b1 | |||
| 6c91cc2d59 | |||
| ba2a56a15b | |||
| 9e7684e294 | |||
| 818b06f3d7 | |||
| 99bb2594e2 | |||
| 9104cd8fdc | |||
| 96b88624d9 | |||
| c1ba3012d4 | |||
| e77d9ee8d2 | |||
| bf49633fac | |||
| 99579a30f7 | |||
| 250bfa94bd | |||
| c342efc08f | |||
| 13e58355da | |||
| 35e7f81224 |
+1
-1
@@ -1 +1 @@
|
||||
2026.7.1
|
||||
2026.7.2
|
||||
@@ -1438,3 +1438,22 @@
|
||||
device_id: 6d1be741876624a70ab5b01b54c6fd6f
|
||||
entity_id: 621e4377a089b7f5d92c7c9f2cc171a1
|
||||
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.
|
||||
python_script:
|
||||
|
||||
# Home Assistant-managed e-paper quote library
|
||||
input_select: !include input_select.yaml
|
||||
|
||||
# Template sensors
|
||||
template: !include template.yaml
|
||||
|
||||
|
||||
+101
-17
@@ -1,7 +1,10 @@
|
||||
# Device identity shared by ESPHome and Home Assistant.
|
||||
substitutions:
|
||||
name: epaperframe
|
||||
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:
|
||||
name: ${name}
|
||||
friendly_name: ${friendly_name}
|
||||
@@ -18,11 +21,15 @@ esphome:
|
||||
- display.page.show: calendar # temporary for power page dev
|
||||
- component.update: epaper
|
||||
|
||||
# ESP32 target and ESP-IDF build settings for the hardware revision in use.
|
||||
esp32:
|
||||
board: nodemcu-32s
|
||||
framework:
|
||||
type: esp-idf
|
||||
advanced:
|
||||
minimum_chip_revision: "3.0"
|
||||
|
||||
# Network access is required for Home Assistant state delivery and OTA updates.
|
||||
wifi:
|
||||
ssid: "Voltage-legacy"
|
||||
password: !secret voltage_legacy_psk
|
||||
@@ -49,6 +56,13 @@ api:
|
||||
# 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:
|
||||
platform: esphome
|
||||
password: !secret ota
|
||||
@@ -115,6 +129,7 @@ button:
|
||||
- display.page.show_next: epaper
|
||||
- component.update: epaper
|
||||
|
||||
# Numeric telemetry received from Home Assistant for the environment dashboard.
|
||||
sensor:
|
||||
# WiFi signal strength
|
||||
- platform: wifi_signal
|
||||
@@ -192,6 +207,7 @@ sensor:
|
||||
entity_id: sensor.radioaktive_strahlungsleistung
|
||||
id: radiation
|
||||
|
||||
# Textual Home Assistant state, including the compact calendar payload and quote.
|
||||
text_sensor:
|
||||
- platform: homeassistant
|
||||
name: "Sun Rising ESP"
|
||||
@@ -220,9 +236,29 @@ text_sensor:
|
||||
entity_id: sensor.epaper_kalenderdaten
|
||||
attribute: entries
|
||||
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
|
||||
entity_id: sensor.epaper_demotivationszitat
|
||||
id: demotivational_quote
|
||||
|
||||
|
||||
|
||||
# Time drives panel power maintenance, the environment refresh cadence, and the
|
||||
# midnight redraw that advances the calendar and daily quote.
|
||||
time:
|
||||
- platform: homeassistant
|
||||
id: homeassistant_time
|
||||
@@ -236,15 +272,29 @@ time:
|
||||
- output.turn_on: power_key
|
||||
- delay: 0.5s
|
||||
- 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
|
||||
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:
|
||||
- logger.log:
|
||||
level: INFO
|
||||
format: "Timer based screen refresh"
|
||||
format: "Update screen on new day"
|
||||
- component.update: epaper
|
||||
|
||||
# Visual assets used by both 1-bit e-paper pages.
|
||||
# Font definitions
|
||||
font:
|
||||
- file: "fonts/Roboto-Medium.ttf"
|
||||
@@ -705,17 +755,21 @@ font:
|
||||
"", # mdi-alert
|
||||
]
|
||||
|
||||
# Binary logo stored in firmware for rendering without network access.
|
||||
image:
|
||||
- file: "epaperframe/C1024_logo_flat_bw.png"
|
||||
- platform: file
|
||||
file: "epaperframe/C1024_logo_flat_bw.png"
|
||||
id: c1024_logo
|
||||
type: binary
|
||||
resize: 77x40
|
||||
invert_alpha: True
|
||||
invert_alpha: true
|
||||
|
||||
# Shared SPI bus for the Waveshare e-paper panel.
|
||||
spi:
|
||||
clk_pin: 23
|
||||
mosi_pin: 22
|
||||
|
||||
# The two pages draw directly onto the 640x384 1-bit Waveshare e-paper panel.
|
||||
display:
|
||||
- platform: waveshare_epaper
|
||||
id: epaper
|
||||
@@ -727,8 +781,11 @@ display:
|
||||
# full_update_every: 30 # not supported on this display
|
||||
update_interval: never
|
||||
pages:
|
||||
# Environmental telemetry dashboard, refreshed on the 10-minute timer.
|
||||
- id: environment
|
||||
lambda: |-
|
||||
// Snapshot all Home Assistant values once per render so each panel uses
|
||||
// a consistent set of readings throughout this e-paper refresh.
|
||||
/* Outdoor */
|
||||
float outdoor_temp = id(temp_outdoor).state;
|
||||
int outdoor_humid = int(id(humid_outdoor).state);
|
||||
@@ -752,10 +809,11 @@ display:
|
||||
float childrensroom_co2 = id(co2_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 offsetY = 0;
|
||||
|
||||
/* OUTSIDE */
|
||||
/* OUTSIDE: logo, headline, and outdoor sensor summary */
|
||||
it.print(10, 10, id(sensor_unit), "Umwelt");
|
||||
/*
|
||||
Draw the outline of a rectangle with the top left at [86,21],
|
||||
@@ -1099,8 +1157,11 @@ display:
|
||||
}
|
||||
}
|
||||
|
||||
# Calendar agenda, month grid, and daily quote; redraws when event JSON changes.
|
||||
- id: calendar
|
||||
lambda: |-
|
||||
// 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();
|
||||
const char *months[] = {"Januar", "Februar", "März", "April", "Mai", "Juni",
|
||||
"Juli", "August", "September", "Oktober", "November", "Dezember"};
|
||||
@@ -1110,6 +1171,8 @@ display:
|
||||
const int month = now.month;
|
||||
const int today = now.day_of_month;
|
||||
|
||||
// Date helpers build a Monday-first month grid and ISO-8601 week numbers
|
||||
// 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) {
|
||||
@@ -1149,7 +1212,9 @@ display:
|
||||
it.line(10, 55, 355, 55);
|
||||
it.line(365, 10, 365, 352);
|
||||
|
||||
DynamicJsonDocument calendar_doc(3072);
|
||||
// Parse the compact JSON attribute produced by Home Assistant. The empty
|
||||
// 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;
|
||||
@@ -1170,6 +1235,8 @@ display:
|
||||
break;
|
||||
}
|
||||
|
||||
// A date rail occupies the left edge; event rows start alongside it
|
||||
// and stop before the footer rather than overflowing the panel.
|
||||
const int group_y = agenda_y;
|
||||
int event_y = group_y;
|
||||
const int day_number = day["day"] | 0;
|
||||
@@ -1208,11 +1275,11 @@ display:
|
||||
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.");
|
||||
}
|
||||
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 */
|
||||
// Draw only the five or six rows this month actually needs so no orphan
|
||||
// week number is rendered beneath shorter months.
|
||||
char month_title[24];
|
||||
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);
|
||||
@@ -1223,7 +1290,8 @@ display:
|
||||
|
||||
const int first_weekday = weekday_monday(year, month, 1);
|
||||
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;
|
||||
int week_year = year;
|
||||
int week_month = month;
|
||||
@@ -1259,18 +1327,34 @@ display:
|
||||
}
|
||||
}
|
||||
|
||||
/* RIGHT BOTTOM: quote placeholder, intentionally inverted */
|
||||
/* RIGHT BOTTOM: daily quote selected by Home Assistant */
|
||||
// Wrap on word boundaries into the fixed four-line, inverted quote panel.
|
||||
it.filled_rectangle(375, 220, 255, 130, COLOR_ON);
|
||||
it.print(502, 246, id(sensor_unit), COLOR_OFF, TextAlign::TOP_CENTER, "Es ist nie zu spät,");
|
||||
it.print(502, 271, id(sensor_unit), COLOR_OFF, TextAlign::TOP_CENTER, "die Erwartungen zu");
|
||||
it.print(502, 296, id(sensor_unit), COLOR_OFF, TextAlign::TOP_CENTER, "senken.");
|
||||
it.print(502, 326, id(footer_font), COLOR_OFF, TextAlign::TOP_CENTER, "Zitatquelle folgt");
|
||||
std::string quote = "Zitat wird geladen.";
|
||||
if (id(demotivational_quote).has_state() && !id(demotivational_quote).state.empty()) {
|
||||
quote = id(demotivational_quote).state;
|
||||
}
|
||||
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: Footer is shared visual status: render timestamp plus a Wi-Fi-strength glyph. */
|
||||
it.strftime(614, 380, id(footer_font), TextAlign::BASELINE_RIGHT,
|
||||
"Aktualisiert um %d.%m.%Y %H:%M", now);
|
||||
|
||||
/* WiFi Signal Strenght */
|
||||
/* WiFi Signal strength */
|
||||
if(id(wifisignal).has_state()) {
|
||||
int x = 630;
|
||||
int y = 384;
|
||||
|
||||
@@ -3,16 +3,16 @@
|
||||
substitutions:
|
||||
name: m5stack-atom-echo
|
||||
friendly_name: M5Stack Atom Echo
|
||||
micro_wake_word_model: okay_nabu # alexa, hey_jarvis, hey_mycroft are also supported
|
||||
|
||||
esphome:
|
||||
name: ${name}
|
||||
name_add_mac_suffix: False
|
||||
name_add_mac_suffix: false
|
||||
friendly_name: ${friendly_name}
|
||||
min_version: 2025.2.0
|
||||
min_version: 2025.5.0
|
||||
|
||||
esp32:
|
||||
board: m5stack-atom
|
||||
cpu_frequency: 240MHz
|
||||
framework:
|
||||
type: esp-idf
|
||||
|
||||
@@ -63,14 +63,17 @@ microphone:
|
||||
i2s_din_pin: GPIO23
|
||||
adc_type: external
|
||||
pdm: true
|
||||
sample_rate: 16000
|
||||
correct_dc_offset: true
|
||||
|
||||
speaker:
|
||||
- platform: i2s_audio
|
||||
id: echo_speaker
|
||||
i2s_dout_pin: GPIO22
|
||||
dac_type: external
|
||||
bits_per_sample: 32bit
|
||||
channel: right
|
||||
bits_per_sample: 16bit
|
||||
sample_rate: 16000
|
||||
channel: stereo # The Echo has poor playback audio quality when using mon audio
|
||||
buffer_duration: 60ms
|
||||
|
||||
media_player:
|
||||
@@ -80,7 +83,6 @@ media_player:
|
||||
announcement_pipeline:
|
||||
speaker: echo_speaker
|
||||
format: WAV
|
||||
codec_support_enabled: false
|
||||
buffer_size: 6000
|
||||
volume_min: 0.4
|
||||
files:
|
||||
@@ -91,14 +93,7 @@ media_player:
|
||||
condition:
|
||||
- microphone.is_capturing:
|
||||
then:
|
||||
- if:
|
||||
condition:
|
||||
lambda: return id(wake_word_engine_location).state == "On device";
|
||||
then:
|
||||
- micro_wake_word.stop:
|
||||
else:
|
||||
- voice_assistant.stop:
|
||||
- script.execute: reset_led
|
||||
- script.execute: stop_wake_word
|
||||
- light.turn_on:
|
||||
id: led
|
||||
blue: 100%
|
||||
@@ -108,14 +103,18 @@ media_player:
|
||||
effect: none
|
||||
on_idle:
|
||||
- script.execute: start_wake_word
|
||||
- script.execute: reset_led
|
||||
|
||||
voice_assistant:
|
||||
id: va
|
||||
microphone: echo_microphone
|
||||
micro_wake_word:
|
||||
microphone:
|
||||
microphone: echo_microphone
|
||||
channels: 0
|
||||
gain_factor: 4
|
||||
media_player: echo_media_player
|
||||
noise_suppression_level: 2
|
||||
auto_gain: 31dBFS
|
||||
volume_multiplier: 2.0
|
||||
on_listening:
|
||||
- light.turn_on:
|
||||
id: led
|
||||
@@ -139,8 +138,26 @@ voice_assistant:
|
||||
brightness: 100%
|
||||
effect: none
|
||||
on_end:
|
||||
- delay: 100ms
|
||||
- script.execute: start_wake_word
|
||||
# Handle the "nevermind" case where there is no announcement
|
||||
- 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:
|
||||
- light.turn_on:
|
||||
id: led
|
||||
@@ -155,11 +172,9 @@ voice_assistant:
|
||||
- delay: 2s # Give the api server time to settle
|
||||
- script.execute: start_wake_word
|
||||
on_client_disconnected:
|
||||
- voice_assistant.stop:
|
||||
- micro_wake_word.stop:
|
||||
- script.execute: stop_wake_word
|
||||
on_timer_finished:
|
||||
- voice_assistant.stop:
|
||||
- micro_wake_word.stop:
|
||||
- script.execute: stop_wake_word
|
||||
- wait_until:
|
||||
not:
|
||||
microphone.is_capturing:
|
||||
@@ -235,7 +250,8 @@ script:
|
||||
then:
|
||||
- if:
|
||||
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
|
||||
then:
|
||||
- light.turn_on:
|
||||
@@ -248,7 +264,8 @@ script:
|
||||
else:
|
||||
- if:
|
||||
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
|
||||
then:
|
||||
- light.turn_on:
|
||||
@@ -262,27 +279,41 @@ script:
|
||||
- light.turn_off: led
|
||||
- id: start_wake_word
|
||||
then:
|
||||
- wait_until:
|
||||
and:
|
||||
- media_player.is_idle:
|
||||
- speaker.is_stopped:
|
||||
- if:
|
||||
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:
|
||||
- voice_assistant.stop
|
||||
- micro_wake_word.stop:
|
||||
- delay: 1s
|
||||
- script.execute: reset_led
|
||||
- script.wait: reset_led
|
||||
- lambda: id(va).set_use_wake_word(false);
|
||||
- micro_wake_word.start:
|
||||
else:
|
||||
- if:
|
||||
condition: voice_assistant.is_running
|
||||
then:
|
||||
- voice_assistant.stop:
|
||||
- script.execute: reset_led
|
||||
- if:
|
||||
condition:
|
||||
and:
|
||||
- not:
|
||||
- voice_assistant.is_running:
|
||||
- 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:
|
||||
- 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:
|
||||
- platform: template
|
||||
@@ -342,7 +373,7 @@ select:
|
||||
condition:
|
||||
lambda: return x == "In Home Assistant";
|
||||
then:
|
||||
- micro_wake_word.stop
|
||||
- micro_wake_word.stop:
|
||||
- delay: 500ms
|
||||
- lambda: id(va).set_use_wake_word(true);
|
||||
- voice_assistant.start_continuous:
|
||||
@@ -351,9 +382,9 @@ select:
|
||||
lambda: return x == "On device";
|
||||
then:
|
||||
- lambda: id(va).set_use_wake_word(false);
|
||||
- voice_assistant.stop
|
||||
- voice_assistant.stop:
|
||||
- delay: 500ms
|
||||
- micro_wake_word.start
|
||||
- micro_wake_word.start:
|
||||
|
||||
micro_wake_word:
|
||||
on_wake_word_detected:
|
||||
@@ -361,4 +392,9 @@ micro_wake_word:
|
||||
wake_word: !lambda return wake_word;
|
||||
vad:
|
||||
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:
|
||||
name: "riden-labornetzteil-18a"
|
||||
friendly_name: "Riden Labornetzteil 18A"
|
||||
@@ -16,6 +18,8 @@ substitutions:
|
||||
RD6006_current_maximum: "6"
|
||||
RD6006_current_accuracy: "3"
|
||||
RD6006_current_multiplier: "0.001"
|
||||
RD6006_power_accuracy: "2"
|
||||
RD6006_power_multiplier: "0.01"
|
||||
|
||||
RD6006P_voltage_maximum: "60"
|
||||
RD6006P_voltage_accuracy: "3"
|
||||
@@ -23,6 +27,8 @@ substitutions:
|
||||
RD6006P_current_maximum: "6"
|
||||
RD6006P_current_accuracy: "4"
|
||||
RD6006P_current_multiplier: "0.0001"
|
||||
RD6006P_power_accuracy: "3"
|
||||
RD6006P_power_multiplier: "0.001"
|
||||
|
||||
RD6012_voltage_maximum: "60"
|
||||
RD6012_voltage_accuracy: "2"
|
||||
@@ -30,6 +36,8 @@ substitutions:
|
||||
RD6012_current_maximum: "12"
|
||||
RD6012_current_accuracy: "2"
|
||||
RD6012_current_multiplier: "0.01"
|
||||
RD6012_power_accuracy: "2"
|
||||
RD6012_power_multiplier: "0.01"
|
||||
|
||||
RD6018_voltage_maximum: "60"
|
||||
RD6018_voltage_accuracy: "2"
|
||||
@@ -37,6 +45,8 @@ substitutions:
|
||||
RD6018_current_maximum: "18"
|
||||
RD6018_current_accuracy: "2"
|
||||
RD6018_current_multiplier: "0.01"
|
||||
RD6018_power_accuracy: "2"
|
||||
RD6018_power_multiplier: "0.01"
|
||||
|
||||
esphome:
|
||||
name: $device_name
|
||||
@@ -45,7 +55,7 @@ esphome:
|
||||
name_add_mac_suffix: false
|
||||
project:
|
||||
name: "wildekek.rd6006-controller"
|
||||
version: "1.4.1"
|
||||
version: "1.5"
|
||||
|
||||
esp8266:
|
||||
board: esp12e
|
||||
@@ -56,7 +66,7 @@ network:
|
||||
wifi:
|
||||
ssid: "Voltage-legacy"
|
||||
password: !secret voltage_legacy_psk
|
||||
#use_address: riden-labornetzteil-18a.home
|
||||
use_address: riden-labornetzteil-18a.home
|
||||
power_save_mode: high
|
||||
fast_connect: on
|
||||
min_auth_mode: WPA2
|
||||
@@ -152,7 +162,9 @@ sensor:
|
||||
on_value:
|
||||
then:
|
||||
- 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
|
||||
name: "Serial Number"
|
||||
@@ -213,9 +225,9 @@ sensor:
|
||||
unit_of_measurement: "W"
|
||||
register_type: holding
|
||||
value_type: U_DWORD
|
||||
accuracy_decimals: 2
|
||||
accuracy_decimals: ${${model}_power_accuracy}
|
||||
filters:
|
||||
- multiply: 0.01
|
||||
- multiply: ${${model}_power_multiplier}
|
||||
|
||||
- platform: modbus_controller
|
||||
modbus_controller_id: powersupply
|
||||
@@ -226,9 +238,9 @@ sensor:
|
||||
unit_of_measurement: "V"
|
||||
register_type: holding
|
||||
value_type: U_WORD
|
||||
accuracy_decimals: ${${model}_voltage_accuracy}
|
||||
accuracy_decimals: 2
|
||||
filters:
|
||||
- multiply: ${${model}_voltage_multiplier}
|
||||
- multiply: 0.01
|
||||
|
||||
- platform: modbus_controller
|
||||
modbus_controller_id: powersupply
|
||||
@@ -266,9 +278,9 @@ sensor:
|
||||
unit_of_measurement: "V"
|
||||
register_type: holding
|
||||
value_type: U_WORD
|
||||
accuracy_decimals: ${${model}_voltage_accuracy}
|
||||
accuracy_decimals: 2
|
||||
filters:
|
||||
- multiply: ${${model}_voltage_multiplier}
|
||||
- multiply: 0.01
|
||||
|
||||
- platform: modbus_controller
|
||||
name: "Temperature"
|
||||
@@ -437,7 +449,6 @@ number:
|
||||
lambda: !lambda return x * ${${model}_voltage_multiplier};
|
||||
write_lambda: !lambda return x * (1/${${model}_voltage_multiplier});
|
||||
|
||||
|
||||
- platform: modbus_controller
|
||||
modbus_controller_id: powersupply
|
||||
name: "Over Current Protection"
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# Source: https://github.com/wildekek/rdtech-esphome
|
||||
|
||||
substitutions:
|
||||
name: "riden-labornetzteil-6a"
|
||||
friendly_name: "Riden Labornetzteil 6A"
|
||||
@@ -16,6 +18,8 @@ substitutions:
|
||||
RD6006_current_maximum: "6"
|
||||
RD6006_current_accuracy: "3"
|
||||
RD6006_current_multiplier: "0.001"
|
||||
RD6006_power_accuracy: "2"
|
||||
RD6006_power_multiplier: "0.01"
|
||||
|
||||
RD6006P_voltage_maximum: "60"
|
||||
RD6006P_voltage_accuracy: "3"
|
||||
@@ -23,6 +27,8 @@ substitutions:
|
||||
RD6006P_current_maximum: "6"
|
||||
RD6006P_current_accuracy: "4"
|
||||
RD6006P_current_multiplier: "0.0001"
|
||||
RD6006P_power_accuracy: "3"
|
||||
RD6006P_power_multiplier: "0.001"
|
||||
|
||||
RD6012_voltage_maximum: "60"
|
||||
RD6012_voltage_accuracy: "2"
|
||||
@@ -30,6 +36,8 @@ substitutions:
|
||||
RD6012_current_maximum: "12"
|
||||
RD6012_current_accuracy: "2"
|
||||
RD6012_current_multiplier: "0.01"
|
||||
RD6012_power_accuracy: "2"
|
||||
RD6012_power_multiplier: "0.01"
|
||||
|
||||
RD6018_voltage_maximum: "60"
|
||||
RD6018_voltage_accuracy: "2"
|
||||
@@ -37,6 +45,8 @@ substitutions:
|
||||
RD6018_current_maximum: "18"
|
||||
RD6018_current_accuracy: "2"
|
||||
RD6018_current_multiplier: "0.01"
|
||||
RD6018_power_accuracy: "2"
|
||||
RD6018_power_multiplier: "0.01"
|
||||
|
||||
esphome:
|
||||
name: $device_name
|
||||
@@ -45,7 +55,7 @@ esphome:
|
||||
name_add_mac_suffix: false
|
||||
project:
|
||||
name: "wildekek.rd6006-controller"
|
||||
version: "1.4.1"
|
||||
version: "1.5"
|
||||
|
||||
esp8266:
|
||||
board: esp12e
|
||||
@@ -56,7 +66,7 @@ network:
|
||||
wifi:
|
||||
ssid: "Voltage-legacy"
|
||||
password: !secret voltage_legacy_psk
|
||||
#use_address: riden-labornetzteil-6a.home
|
||||
use_address: riden-labornetzteil-6a.home
|
||||
power_save_mode: high
|
||||
fast_connect: on
|
||||
min_auth_mode: WPA2
|
||||
@@ -152,7 +162,9 @@ sensor:
|
||||
on_value:
|
||||
then:
|
||||
- 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
|
||||
name: "Serial Number"
|
||||
@@ -213,9 +225,9 @@ sensor:
|
||||
unit_of_measurement: "W"
|
||||
register_type: holding
|
||||
value_type: U_DWORD
|
||||
accuracy_decimals: 2
|
||||
accuracy_decimals: ${${model}_power_accuracy}
|
||||
filters:
|
||||
- multiply: 0.01
|
||||
- multiply: ${${model}_power_multiplier}
|
||||
|
||||
- platform: modbus_controller
|
||||
modbus_controller_id: powersupply
|
||||
@@ -226,9 +238,9 @@ sensor:
|
||||
unit_of_measurement: "V"
|
||||
register_type: holding
|
||||
value_type: U_WORD
|
||||
accuracy_decimals: ${${model}_voltage_accuracy}
|
||||
accuracy_decimals: 2
|
||||
filters:
|
||||
- multiply: ${${model}_voltage_multiplier}
|
||||
- multiply: 0.01
|
||||
|
||||
- platform: modbus_controller
|
||||
modbus_controller_id: powersupply
|
||||
@@ -266,9 +278,9 @@ sensor:
|
||||
unit_of_measurement: "V"
|
||||
register_type: holding
|
||||
value_type: U_WORD
|
||||
accuracy_decimals: ${${model}_voltage_accuracy}
|
||||
accuracy_decimals: 2
|
||||
filters:
|
||||
- multiply: ${${model}_voltage_multiplier}
|
||||
- multiply: 0.01
|
||||
|
||||
- platform: modbus_controller
|
||||
name: "Temperature"
|
||||
|
||||
@@ -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,4 +1,5 @@
|
||||
# Calendar data is compacted here so the ESP32 only receives display-ready entries.
|
||||
# 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",
|
||||
@@ -6,10 +7,11 @@ CALENDAR_NAMES = {
|
||||
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 = 19
|
||||
MAX_META_LENGTH = 28
|
||||
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:
|
||||
@@ -17,11 +19,13 @@ def shorten(value, maximum):
|
||||
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ägig" if all_day else start[11:16]
|
||||
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()
|
||||
@@ -38,6 +42,8 @@ def compact_event(event, calendar_name):
|
||||
}
|
||||
|
||||
|
||||
# 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 = {}
|
||||
@@ -63,6 +69,8 @@ for calendar_id, calendar in calendar_data.items():
|
||||
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):
|
||||
@@ -85,4 +93,5 @@ for date in sorted(events_by_date):
|
||||
}
|
||||
)
|
||||
|
||||
# Return only the normalized agenda payload to the Home Assistant template sensor.
|
||||
output["entries"] = entries
|
||||
|
||||
+6
-4
@@ -10,7 +10,8 @@
|
||||
unique_id: '3303381540758'
|
||||
host: !secret router_ip
|
||||
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
|
||||
unit_of_measurement: "Octets"
|
||||
- platform: snmp
|
||||
@@ -18,7 +19,8 @@
|
||||
unique_id: '1573258703922'
|
||||
host: !secret router_ip
|
||||
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
|
||||
unit_of_measurement: "Octets"
|
||||
|
||||
@@ -38,13 +40,13 @@
|
||||
unique_id: '9081721471264'
|
||||
state_characteristic: mean
|
||||
entity_id: sensor.internet_speed_in
|
||||
sampling_size: 10
|
||||
sampling_size: 2
|
||||
- platform: statistics
|
||||
name: 'WAN Traffic Out'
|
||||
unique_id: '8688955223027'
|
||||
state_characteristic: mean
|
||||
entity_id: sensor.internet_speed_out
|
||||
sampling_size: 10
|
||||
sampling_size: 2
|
||||
|
||||
# Sensor for Riemann sum of energy import (W -> Wh)
|
||||
- platform: integration
|
||||
|
||||
@@ -49,6 +49,10 @@
|
||||
name: Sun Setting Template
|
||||
state: '{{ as_timestamp(states.sun.sun.attributes.next_setting) | timestamp_custom
|
||||
(''%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"
|
||||
unique_id: '5579422933393'
|
||||
|
||||
+12
-6
@@ -1,34 +1,40 @@
|
||||
# Internet traffic
|
||||
internet_usage_in_monthly:
|
||||
source: sensor.snmp_wan_in
|
||||
source: sensor.wan_in_derivative
|
||||
name: Monthly internet traffic in
|
||||
unique_id: monthly_internet_traffic_in
|
||||
cycle: monthly
|
||||
delta_values: True
|
||||
internet_usage_out_monthly:
|
||||
source: sensor.snmp_wan_out
|
||||
source: sensor.wan_out_derivative
|
||||
name: Monthly internet traffic out
|
||||
unique_id: monthly_internet_traffic_out
|
||||
cycle: monthly
|
||||
delta_values: True
|
||||
internet_usage_in_daily:
|
||||
source: sensor.snmp_wan_in
|
||||
source: sensor.wan_in_derivative
|
||||
name: Daily internet traffic in
|
||||
unique_id: daily_internet_traffic_in
|
||||
cycle: daily
|
||||
delta_values: True
|
||||
internet_usage_out_daily:
|
||||
source: sensor.snmp_wan_out
|
||||
source: sensor.wan_out_derivative
|
||||
name: Daily internet traffic out
|
||||
unique_id: daily_internet_traffic_out
|
||||
cycle: daily
|
||||
delta_values: True
|
||||
internet_usage_in_hourly:
|
||||
source: sensor.snmp_wan_in
|
||||
source: sensor.wan_in_derivative
|
||||
name: Hourly internet traffic in
|
||||
unique_id: hourly_internet_traffic_in
|
||||
cycle: hourly
|
||||
delta_values: True
|
||||
internet_usage_out_hourly:
|
||||
source: sensor.snmp_wan_out
|
||||
source: sensor.wan_out_derivative
|
||||
name: Hourly internet traffic out
|
||||
unique_id: hourly_internet_traffic_out
|
||||
cycle: hourly
|
||||
delta_values: True
|
||||
|
||||
# Energy
|
||||
energy_import_daily:
|
||||
|
||||
Reference in New Issue
Block a user