diff --git a/oekoboiler-interface.yaml b/oekoboiler-interface.yaml index 309e0b7..0372835 100644 --- a/oekoboiler-interface.yaml +++ b/oekoboiler-interface.yaml @@ -367,6 +367,28 @@ text_sensor: name: "Controller Status" lambda: |- int status = (int)id(controller_status_raw).state; + + // Special handling for Alarm status (8) + if (status == 8) { + // Check if only water temp warning is active (all other alarms should be 0) + bool only_water_temp_warning = + id(alarm_water_temp).state != 0 && + id(alarm_a1).state == 0 && + id(alarm_a2).state == 0 && + id(alarm_a3).state == 0 && + id(alarm_a4).state == 0 && + id(alarm_a5).state == 0 && + id(alarm_a6).state == 0 && + id(alarm_a8).state == 0 && + id(alarm_a9).state == 0; + + // If only water temp warning is active and not heating, show OK + if (only_water_temp_warning) { + return {"OK"}; + } + return {"Alarm"}; + } + switch(status) { case 0: return {"Power Off"}; case 1: return {"Standby"}; @@ -375,7 +397,6 @@ text_sensor: case 4: return {"Before Defrost"}; case 5: return {"Defrosting"}; case 6: return {"After Defrost"}; - case 8: return {"Alarm"}; default: return {"Unknown (" + to_string(status) + ")"}; }