Author SHA1 Message Date
Commander1024 333484a89a Show Home Assistant API connectivity status 2026-08-04 15:51:33 +02:00
Commander1024 ef2047e268 Added work wifi 2026-08-04 15:36:53 +02:00
Commander1024 dc6cf4d1af Increased Wifi signal strength update rate again. 2026-07-30 07:55:04 +02:00
Commander1024 302bc3a924 Use Material Design icons for status indicators 2026-07-30 00:24:30 +02:00
Commander1024 73354c4447 Expose WiFi signal strength sensor
Update the display to use the renamed sensor ID and refresh
signal readings every 60 seconds.
2026-07-30 00:02:35 +02:00
Commander1024 f35f1eee22 Add WireGuard monitoring sensors
Expose WireGuard handshake, status, enabled state, and address in
ESPHome.
2026-07-29 23:42:58 +02:00
Commander1024 31644426fc Update display network status icons 2026-07-29 21:51:38 +02:00
Commander1024 059b6c0a4b Configure WireGuard tunnel for energy monitor 2026-07-29 21:43:49 +02:00
Commander1024 6a3afd71df Display Current Time via SNTP 2026-07-29 21:20:17 +02:00
Commander1024 b7b943e4bf Add Wi-Fi roaming and connection status display 2026-07-29 21:13:04 +02:00
Commander1024 195c327ed7 Initial WIP draft of the energymonitor. 2026-07-29 16:07:19 +02:00
Commander1024 22034a86e1 Revert "Energymonitor skeleton"
This reverts commit 81665588a8.
2026-07-28 19:13:19 +02:00
Commander1024 81665588a8 Energymonitor skeleton 2026-07-25 16:39:42 +02:00
Commander1024 f956e19d3b Updated Bootloaders to enable advanced esp32 functions. 2026-07-25 15:11:03 +02:00
Commander1024 0a94233a36 Updated HA. 2026-07-25 15:09:35 +02:00
Commander1024 d23c6a23a3 Clarify e-paper dashboard and calendar pipeline by adding inline
comments.
2026-07-17 09:44:25 +02:00
Commander1024 166cc3efd5 Abbreviated ganztägig. 2026-07-16 17:02:29 +02:00
Commander1024 e358c2cffe Optimize e-paper refresh behavior and make deprecated image logic future
proof.
2026-07-16 16:52:28 +02:00
Commander1024 5d4e8ef40c Fixed model_number population 2026-07-16 14:37:33 +02:00
Commander1024 8dc781a6b1 Made esphome devices 2026.07.xx compatible 2026-07-16 13:59:31 +02:00
Commander1024 6c91cc2d59 Changed WAN Interface oids to parent vlan interface (instead of pppoe0 2026-07-16 13:57:58 +02:00
ESPHome Device Builder ba2a56a15b Edit epaperframe.yaml 2026-07-15 11:13:43 +02:00
10 changed files with 475 additions and 91 deletions
+1 -1
View File
@@ -1 +1 @@
2026.7.2
2026.7.4
+269
View File
@@ -0,0 +1,269 @@
substitutions:
name: "energymonitor"
friendly_name: "Energy Monitor"
esphome:
name: ${name}
friendly_name: ${friendly_name}
name_add_mac_suffix: false
project:
name: monitor.energymonitor
version: "1.0"
on_boot:
then:
- light.turn_on: display_backlight
esp32:
board: m5stack-core-esp32
framework:
type: esp-idf
network:
enable_ipv6: true
wifi:
networks:
- ssid: "Voltage-legacy"
password: !secret voltage_legacy_psk
priority: 10
- ssid: "Moppelkotze"
password: !secret moppelkotze_psk
priority: 5
- ssid: "TKRZ"
password: !secret tkrz_psk
priority: 4
use_address: 192.168.126.250
on_connect:
- lambda: id(wifi_connected) = true;
on_disconnect:
- lambda: id(wifi_connected) = false;
power_save_mode: high
min_auth_mode: WPA2
ap:
ssid: "Energymonitor Fallback Hotspot"
password: !secret fallback_psk
captive_portal:
time:
- platform: sntp
id: sntp_time
timezone: Europe/Berlin
servers:
- de.pool.ntp.org
# Values are maintained in secrets.yaml.
wireguard:
id: energymonitor_wireguard
address: !secret energymonitor_wireguard_address
netmask: !secret energymonitor_wireguard_netmask
private_key: !secret energymonitor_wireguard_private_key
peer_endpoint: !secret energymonitor_wireguard_peer_endpoint
peer_port: !secret energymonitor_wireguard_peer_port
peer_public_key: !secret energymonitor_wireguard_peer_public_key
peer_allowed_ips:
- !secret energymonitor_wireguard_peer_allowed_ip
peer_persistent_keepalive: 25s
# Avoid rebooting while the placeholder endpoint is intentionally unreachable.
reboot_timeout: 0s
logger:
api:
id: api_server
encryption:
key: !secret apikey
ota:
platform: esphome
password: !secret ota
spi:
clk_pin: GPIO18
mosi_pin: GPIO23
output:
- platform: gpio
pin: GPIO32
id: display_backlight_output
light:
- platform: binary
id: display_backlight
name: "Display Backlight"
output: display_backlight_output
restore_mode: ALWAYS_ON
font:
- file: "fonts/Roboto-Regular.ttf"
id: font_small
size: 18
glyphsets:
- GF_Latin_Kernel
glyphs: ["äöüÄÖÜß"]
- file: "fonts/Roboto-Bold.ttf"
id: font_title
size: 28
glyphsets:
- GF_Latin_Kernel
glyphs: ["äöüÄÖÜß"]
- file: "fonts/Roboto-Bold.ttf"
id: font_value
size: 52
glyphsets:
- GF_Latin_Kernel
glyphs: ["äöüÄÖÜß"]
- file: "fonts/materialdesignicons-webfont.ttf"
id: font_icon
size: 24
glyphs:
- "\U000F0306" # mdi:key
- "\U000F07D0" # mdi:home-assistant
- "\U000F091F" # mdi:wifi-strength-1
- "\U000F0922" # mdi:wifi-strength-2
- "\U000F0925" # mdi:wifi-strength-3
- "\U000F0928" # mdi:wifi-strength-4
- "\U000F092D" # mdi:wifi-strength-off
globals:
- id: page_index
type: int
restore_value: true
initial_value: '0'
- id: wifi_connected
type: bool
restore_value: false
initial_value: 'false'
sensor:
# WiFi signal strength
- platform: wifi_signal
name: "WiFi Signalstärke"
id: wifisignal
update_interval: 10s
- platform: homeassistant
id: grid_power
entity_id: sensor.netzleistung
internal: true
- platform: homeassistant
id: balcony_solar_power
entity_id: sensor.balkonkraftwerk_power
internal: true
- platform: wireguard
latest_handshake:
name: 'WireGuard Latest Handshake'
binary_sensor:
- platform: wireguard
status:
name: 'WireGuard Status'
- platform: wireguard
enabled:
name: 'WireGuard Enabled'
# M5Stack Core button A (left). GPIO39 is input-only and has an external pull-up.
- platform: gpio
pin:
number: GPIO39
mode: INPUT
inverted: true
id: button_left
on_press:
then:
- lambda: |-
id(page_index) = (id(page_index) + 2 - 1) % 2;
- component.update: tft
# M5Stack Core button C (right). GPIO37 is input-only and has an external pull-up.
- platform: gpio
pin:
number: GPIO37
mode: INPUT
inverted: true
id: button_right
on_press:
then:
- lambda: |-
id(page_index) = (id(page_index) + 1) % 2;
- component.update: tft
text_sensor:
- platform: wireguard
address:
name: 'WireGuard Address'
# M5CORE is the mipi_spi preset for the M5Stack Core's integrated display.
display:
- platform: mipi_spi
id: tft
model: M5CORE
cs_pin: GPIO14
dc_pin: GPIO27
reset_pin: GPIO33
invert_colors: true
update_interval: 1s
lambda: |-
it.fill(Color::BLACK);
if (id(sntp_time).now().is_valid()) {
it.strftime(234, 10, id(font_small), Color::WHITE, TextAlign::TOP_RIGHT,
"%H:%M", id(sntp_time).now());
} else {
it.printf(234, 10, id(font_small), Color::WHITE, TextAlign::TOP_RIGHT, "--:--");
}
// Native API connectivity; Home Assistant is normally the connected client.
const bool home_assistant_online = id(api_server).is_connected();
const Color home_assistant_color = home_assistant_online ? Color(64, 255, 64) : Color(255, 80, 80);
it.printf(260, 8, id(font_icon), home_assistant_color, TextAlign::TOP_RIGHT, "\U000F07D0");
// Green means the WireGuard peer is online; red means it is offline.
const bool wireguard_online = id(energymonitor_wireguard).is_peer_up();
const Color wireguard_color = wireguard_online ? Color(64, 255, 64) : Color(255, 80, 80);
it.printf(286, 8, id(font_icon), wireguard_color, TextAlign::TOP_RIGHT, "\U000F0306");
// Render the requested MDI Wi-Fi strength glyph in green or red when disconnected.
const bool wifi_online = id(wifi_connected);
const Color wifi_color = wifi_online ? Color(64, 255, 64) : Color(255, 80, 80);
const char *wifi_icon = "\U000F092D"; // mdi:wifi-strength-off
if (wifi_online) {
if (id(wifisignal).has_state()) {
const float rssi = id(wifisignal).state;
wifi_icon = rssi >= -55 ? "\U000F0928" : rssi >= -67 ? "\U000F0925"
: rssi >= -75 ? "\U000F0922" : "\U000F091F";
} else {
wifi_icon = "\U000F091F";
}
}
it.printf(312, 8, id(font_icon), wifi_color, TextAlign::TOP_RIGHT, "%s", wifi_icon);
if (id(page_index) == 0) {
it.printf(12, 12, id(font_small), Color::WHITE, "Netzleistung");
if (id(grid_power).has_state()) {
it.printf(308, 32, id(font_value), Color::WHITE, TextAlign::TOP_RIGHT,
"%+.0f W", id(grid_power).state);
} else {
it.printf(308, 42, id(font_value), Color::WHITE, TextAlign::TOP_RIGHT,
"-- W");
}
it.printf(12, 99, id(font_small), Color::WHITE, "Balkonkraftwerk");
if (id(balcony_solar_power).has_state()) {
it.printf(308, 119, id(font_value), Color(255, 215, 0), TextAlign::TOP_RIGHT,
"%.0f W", id(balcony_solar_power).state);
} else {
it.printf(308, 129, id(font_value), Color(255, 215, 0), TextAlign::TOP_RIGHT,
"-- W");
}
} else {
it.printf(160, 45, id(font_title), Color::WHITE, TextAlign::TOP_CENTER,
"Weitere Seite");
it.printf(160, 95, id(font_small), Color::WHITE, TextAlign::TOP_CENTER,
"Für zusätzliche Werte vorbereitet");
}
// Labels correspond to the left (A) and right (C) hardware buttons.
it.printf(8, 239, id(font_small), Color::WHITE, TextAlign::BOTTOM_LEFT,
"< Zurück");
it.printf(312, 239, id(font_small), Color::WHITE, TextAlign::BOTTOM_RIGHT,
"Weiter >");
it.printf(160, 239, id(font_small), Color::WHITE, TextAlign::BOTTOM_CENTER,
"%d / 2", id(page_index) + 1);
+48 -8
View File
@@ -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,13 +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:
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
@@ -51,7 +56,7 @@ api:
# Include ArduinoJson support for the compact calendar event feed.
json:
# Avoid refreshing the panel when Home Assistant republishes unchanged calendar data.
# Prevent refreshes when Home Assistant republishes unchanged calendar data.
globals:
- id: last_rendered_calendar_entries
type: std::string
@@ -124,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
@@ -201,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"
@@ -229,6 +236,8 @@ 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:
@@ -248,6 +257,8 @@ text_sensor:
# 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
@@ -261,8 +272,8 @@ time:
- output.turn_on: power_key
- delay: 0.5s
- output.turn_off: power_key
# Refresh environmental readings every 10 minutes. The calendar page is
# redrawn only when its event feed actually changes.
# 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:
@@ -274,7 +285,16 @@ time:
level: INFO
format: "Timer based environment screen refresh"
- component.update: epaper
- seconds: 10
minutes: 0
hours: 0
then:
- logger.log:
level: INFO
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"
@@ -735,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
@@ -757,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);
@@ -782,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],
@@ -1129,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"};
@@ -1140,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) {
@@ -1179,6 +1212,8 @@ display:
it.line(10, 55, 355, 55);
it.line(365, 10, 365, 352);
// 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>();
@@ -1200,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;
@@ -1241,6 +1278,8 @@ display:
/* 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);
@@ -1289,6 +1328,7 @@ display:
}
/* 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);
std::string quote = "Zitat wird geladen.";
if (id(demotivational_quote).has_state() && !id(demotivational_quote).state.empty()) {
@@ -1310,7 +1350,7 @@ display:
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);
+2
View File
@@ -31,3 +31,5 @@ ota:
password: !secret ota
http_request:
captive_portal:
+2
View File
@@ -31,3 +31,5 @@ ota:
password: !secret ota
http_request:
captive_portal:
+82 -44
View File
@@ -3,18 +3,20 @@
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
advanced:
sram1_as_iram: true
# Enable Home Assistant API
api:
@@ -63,14 +65,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 +85,6 @@ media_player:
announcement_pipeline:
speaker: echo_speaker
format: WAV
codec_support_enabled: false
buffer_size: 6000
volume_min: 0.4
files:
@@ -91,14 +95,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 +105,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 +140,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 +174,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 +252,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 +266,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 +281,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 +375,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 +384,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 +394,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
+29 -18
View File
@@ -1,3 +1,5 @@
# Source: https://github.com/wildekek/rdtech-esphome
substitutions:
name: "riden-labornetzteil-18a"
friendly_name: "Riden Labornetzteil 18A"
@@ -8,7 +10,7 @@ substitutions:
device_friendly_name: "Riden RD6018"
device_description: "Monitor and control a RD6018 PSU via WiFi"
time_timezone: "Europe/Berlin"
# Model specific settings (Don't change these!)
RD6006_voltage_maximum: "60"
RD6006_voltage_accuracy: "2"
@@ -16,13 +18,17 @@ 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"
RD6006P_voltage_multiplier: "0.001"
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
@@ -76,7 +86,7 @@ logger:
# Enable Home Assistant API
api:
encryption:
encryption:
key: !secret apikey
ota:
@@ -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"
@@ -164,7 +176,7 @@ sensor:
register_type: holding
value_type: U_DWORD
accuracy_decimals: 0
- platform: modbus_controller
modbus_controller_id: powersupply
address: 3
@@ -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,10 +278,10 @@ 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"
device_class: temperature
@@ -279,7 +291,7 @@ sensor:
address: 4
value_type: S_DWORD
unit_of_measurement: "°C"
- platform: modbus_controller
name: "Temperature external"
state_class: measurement
@@ -289,7 +301,7 @@ sensor:
value_type: S_DWORD
device_class: temperature
unit_of_measurement: "°C"
- platform: wifi_signal
name: "Wi-Fi Signal"
disabled_by_default: True
@@ -408,7 +420,7 @@ number:
step: ${${model}_voltage_multiplier}
lambda: !lambda return x * ${${model}_voltage_multiplier};
write_lambda: !lambda return x * (1/${${model}_voltage_multiplier});
- platform: modbus_controller
modbus_controller_id: powersupply
name: "Output current"
@@ -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"
+29 -17
View File
@@ -1,3 +1,5 @@
# Source: https://github.com/wildekek/rdtech-esphome
substitutions:
name: "riden-labornetzteil-6a"
friendly_name: "Riden Labornetzteil 6A"
@@ -8,7 +10,7 @@ substitutions:
device_friendly_name: "Riden RD6006"
device_description: "Monitor and control a RD6006 PSU via WiFi"
time_timezone: "Europe/Berlin"
# Model specific settings (Don't change these!)
RD6006_voltage_maximum: "60"
RD6006_voltage_accuracy: "2"
@@ -16,13 +18,17 @@ 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"
RD6006P_voltage_multiplier: "0.001"
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
@@ -76,7 +86,7 @@ logger:
# Enable Home Assistant API
api:
encryption:
encryption:
key: !secret apikey
ota:
@@ -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"
@@ -164,7 +176,7 @@ sensor:
register_type: holding
value_type: U_DWORD
accuracy_decimals: 0
- platform: modbus_controller
modbus_controller_id: powersupply
address: 3
@@ -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,10 +278,10 @@ 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"
device_class: temperature
@@ -279,7 +291,7 @@ sensor:
address: 4
value_type: S_DWORD
unit_of_measurement: "°C"
- platform: modbus_controller
name: "Temperature external"
state_class: measurement
@@ -289,7 +301,7 @@ sensor:
value_type: S_DWORD
device_class: temperature
unit_of_measurement: "°C"
- platform: wifi_signal
name: "Wi-Fi Signal"
disabled_by_default: True
@@ -408,7 +420,7 @@ number:
step: ${${model}_voltage_multiplier}
lambda: !lambda return x * ${${model}_voltage_multiplier};
write_lambda: !lambda return x * (1/${${model}_voltage_multiplier});
- platform: modbus_controller
modbus_controller_id: powersupply
name: "Output current"
+11 -1
View File
@@ -1,3 +1,5 @@
# 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",
@@ -9,6 +11,7 @@ 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:
@@ -16,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()
@@ -37,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 = {}
@@ -62,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):
@@ -84,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
+2 -2
View File
@@ -11,7 +11,7 @@
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.2.2.1.10.25
baseoid: .1.3.6.1.2.1.2.2.1.10.12
version: 2c
unit_of_measurement: "Octets"
- platform: snmp
@@ -20,7 +20,7 @@
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.2.2.1.16.25
baseoid: .1.3.6.1.2.1.2.2.1.16.12
version: 2c
unit_of_measurement: "Octets"