From 2b86032adfff5115df272fdf7fc3184d5c5e7821 Mon Sep 17 00:00:00 2001 From: Ryan McLean Date: Mon, 15 May 2023 09:54:40 +0100 Subject: [PATCH] Fix Change in SolarEdge Modbus Multi Device v2.3.0 https://github.com/ryanm101/hasolarcfg/issues/6 --- packages/energy_stats.yaml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/packages/energy_stats.yaml b/packages/energy_stats.yaml index 8bbef40..432b83d 100644 --- a/packages/energy_stats.yaml +++ b/packages/energy_stats.yaml @@ -102,10 +102,15 @@ template: unique_id: solaredge_b1_status_text state: > {% set status = states('sensor.solaredge_b1_status') %} - {% if status == '1' %}Off - {% elif status == '3' %}Charging - {% elif status == '4' %}Discharging - {% elif status == '6' %}Preserve Charge + {% if status == 'B_STATUS_OFF' %}Off + {% elif status == 'B_STATUS_STANDBY' %}Standby + {% elif status == 'B_STATUS_INIT' %}Initialise + {% elif status == 'B_STATUS_CHARGE' %}Charging + {% elif status == 'B_STATUS_DISCHARGE' %}Discharging + {% elif status == 'B_STATUS_FAULT' %}Fault + {% elif status == 'B_STATUS_PRESERVE_CHARGE' %}Preserve Charge + {% elif status == 'B_STATUS_IDLE' %}Idle + {% elif status == 'B_STATUS_POWER_SAVING' %}Power saving {% else %}{{ states('sensor.solaredge_b1_status') }} {% endif %}