From c5427dedce6e4d667aafce55e09ef744afae8463 Mon Sep 17 00:00:00 2001 From: Al3x Zamponi <562324+alexz707@users.noreply.github.com> Date: Mon, 23 Oct 2023 13:18:24 +0200 Subject: [PATCH] Add calculated values to hass auto discovery (#509) Add battery P and E as well as panel I to auto discovery values of HA --- src/MqttHandlVedirectHass.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/MqttHandlVedirectHass.cpp b/src/MqttHandlVedirectHass.cpp index e5a9be5c2..8db755d2a 100644 --- a/src/MqttHandlVedirectHass.cpp +++ b/src/MqttHandlVedirectHass.cpp @@ -68,9 +68,12 @@ void MqttHandleVedirectHassClass::publishConfig() // battery info publishSensor("Battery voltage", NULL, "V", "voltage", "measurement", "V"); publishSensor("Battery current", NULL, "I", "current", "measurement", "A"); - + publishSensor("Battery power (calculated)", NULL, "P", "power", "measurement", "W"); + publishSensor("Battery efficiency (calculated)", NULL, "E", "efficiency", "measurement", "%"); + // panel info publishSensor("Panel voltage", NULL, "VPV", "voltage", "measurement", "V"); + publishSensor("Panel current (calculated)", NULL, "IPV", "current", "measurement", "A"); publishSensor("Panel power", NULL, "PPV", "power", "measurement", "W"); publishSensor("Panel yield total", NULL, "H19", "energy", "total_increasing", "kWh"); publishSensor("Panel yield today", NULL, "H20", "energy", "total", "kWh"); @@ -188,4 +191,4 @@ void MqttHandleVedirectHassClass::publish(const String& subtopic, const String& String topic = Configuration.get().Mqtt_Hass_Topic; topic += subtopic; MqttSettings.publishGeneric(topic.c_str(), payload.c_str(), Configuration.get().Mqtt_Hass_Retain); -} \ No newline at end of file +}