From 230126248d35353fe4a06385ebb1cba533c20f27 Mon Sep 17 00:00:00 2001 From: Commander1024 Date: Sun, 16 Aug 2026 15:16:17 +0200 Subject: [PATCH] Display Daily Energy Metrics --- esphome/energymonitor.yaml | 39 +++++++++++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) diff --git a/esphome/energymonitor.yaml b/esphome/energymonitor.yaml index 2ce58b8..729dcb3 100644 --- a/esphome/energymonitor.yaml +++ b/esphome/energymonitor.yaml @@ -152,6 +152,18 @@ sensor: id: balcony_solar_power entity_id: sensor.balkonkraftwerk_power internal: true + - platform: homeassistant + id: solar_energy_daily + entity_id: sensor.energy_solar_daily + internal: true + - platform: homeassistant + id: grid_import_energy_daily + entity_id: sensor.energy_import_daily + internal: true + - platform: homeassistant + id: grid_export_energy_daily + entity_id: sensor.energy_export_daily + internal: true - platform: wireguard latest_handshake: name: 'WireGuard Latest Handshake' @@ -248,12 +260,33 @@ display: "-- W"); } - it.printf(12, 99, id(font_small), Color::WHITE, "Balkonkraftwerk"); + + if (id(grid_import_energy_daily).has_state()) { + it.printf(12, 96, id(font_small), Color::WHITE, "Bezug: %.2f kWh", + id(grid_import_energy_daily).state); + } else { + it.printf(12, 96, id(font_small), Color::WHITE, "Bezug: -- kWh"); + } + if (id(grid_export_energy_daily).has_state()) { + it.printf(12, 116, id(font_small), Color::WHITE, "Einspeisung: %.2f kWh", + id(grid_export_energy_daily).state); + } else { + it.printf(12, 116, id(font_small), Color::WHITE, "Einspeisung: -- kWh"); + } + + it.printf(12, 138, id(font_small), Color::WHITE, "Balkonkraftwerk"); + // Daily solar energy is aligned to the left of the current solar-power reading. + if (id(solar_energy_daily).has_state()) { + it.printf(12, 180, id(font_small), Color(255, 215, 0), "Solar: %.2f kWh", + id(solar_energy_daily).state); + } else { + it.printf(12, 180, id(font_small), Color(255, 215, 0), "Solar: -- kWh"); + } if (id(balcony_solar_power).has_state()) { - it.printf(308, 119, id(font_value), Color(255, 215, 0), TextAlign::TOP_RIGHT, + it.printf(308, 158, 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, + it.printf(308, 168, id(font_value), Color(255, 215, 0), TextAlign::TOP_RIGHT, "-- W"); } } else {