From 4b3f128c3173c9ae9a3601de9acca1fd2d10dc08 Mon Sep 17 00:00:00 2001 From: David Rapan Date: Thu, 15 Aug 2024 00:47:36 +0200 Subject: [PATCH] feat: Proper Alarm and Fault messaging --- .../inverter_definitions/deye_2mppt.yaml | 97 +++++++------------ .../inverter_definitions/deye_4mppt.yaml | 97 +++++++------------ .../inverter_definitions/deye_sg01hp3.yaml | 60 +++++++++--- .../inverter_definitions/deye_sg04lp3.yaml | 60 +++++++++--- 4 files changed, 168 insertions(+), 146 deletions(-) diff --git a/custom_components/solarman/inverter_definitions/deye_2mppt.yaml b/custom_components/solarman/inverter_definitions/deye_2mppt.yaml index 244e47a8..af827f06 100644 --- a/custom_components/solarman/inverter_definitions/deye_2mppt.yaml +++ b/custom_components/solarman/inverter_definitions/deye_2mppt.yaml @@ -247,12 +247,12 @@ parameters: registers: [0x0023] icon: "" - - group: Inverter + - group: Device items: # Device - Operating (Running) state - name: "Device State" update_interval: 30 - class: "" + class: "enum" state_class: "" uom: "" scale: 1 @@ -497,6 +497,40 @@ parameters: - group: Alert items: + - name: "Device Alarm" + class: "enum" + state_class: "" + uom: "" + scale: 1 + rule: 3 + registers: [0x0065, 0x0066] + icon: "mdi:message-alert-outline" + options: + [ + "Ok", + "Fan failure", + "Grid phase failure", + "Meter communication failure", + "Battery loss", + "Parallel communication quality", + "Error" + ] + lookup: + - key: 0x0000 + value: "Ok" + - key: 0x0002 + value: "Fan failure" + - key: 0x0004 + value: "Grid phase failure" + - key: 0x0008 + value: "Meter communication failure" + - key: 0x40000000 + value: "Battery loss" + - key: 0x80000000 + value: "Parallel communication quality" + - key: "default" + value: "Error" + - name: "Fault information Word 1" class: "" state_class: "" @@ -549,65 +583,6 @@ parameters: - key: 0x0000 value: "OK" - - name: "Warning Code" - class: "" - state_class: "" - uom: "" - scale: 1 - rule: 6 - registers: [0x0065, 0x0066] - icon: "mdi:information-slab-circle-outline" - lookup: - - key: 0x0000 - value: "None" - - key: W01 - value: "W01 reserve" - - key: 0x1 - value: "W01 reserve" - - key: W02 - value: "W02 FAN_WARN" - - key: 0x2 - value: "W02 FAN_WARN" - - key: W03 - value: "W03 Grid phase wrong" - - key: 0x3 - value: "W03 Grid phase wrong" - - key: W04 - value: "W04 meter_Comm_Fail" - - key: 0x4 - value: "W04 meter_Comm_Fail" - - - name: "Alert" - class: "" - state_class: "" - uom: "" - scale: 1 - rule: 3 - registers: [0x0075, 0x0076] - icon: "mdi:message-alert-outline" - options: - [ - "Ok", - "Fan failure", - "Grid error", - "Battery loss", - "Parallel communication quality", - "Error", - ] - lookup: - - key: 0x0000 - value: "Ok" - - key: 0x0001 - value: "Fan failure" - - key: 0x0002 - value: "Grid error" - - key: 0x4000 - value: "Battery loss" - - key: 0x8000 - value: "Parallel communication quality" - - key: "default" - value: "Error" - - group: Control items: # Device - On/Off Switch diff --git a/custom_components/solarman/inverter_definitions/deye_4mppt.yaml b/custom_components/solarman/inverter_definitions/deye_4mppt.yaml index 50907d67..536cde03 100644 --- a/custom_components/solarman/inverter_definitions/deye_4mppt.yaml +++ b/custom_components/solarman/inverter_definitions/deye_4mppt.yaml @@ -304,12 +304,12 @@ parameters: registers: [0x0023] icon: "" - - group: Inverter + - group: Device items: # Device - Operating (Running) state - name: "Device State" update_interval: 30 - class: "" + class: "enum" state_class: "" uom: "" scale: 1 @@ -554,6 +554,40 @@ parameters: - group: Alert items: + - name: "Device Alarm" + class: "enum" + state_class: "" + uom: "" + scale: 1 + rule: 3 + registers: [0x0065, 0x0066] + icon: "mdi:message-alert-outline" + options: + [ + "Ok", + "Fan failure", + "Grid phase failure", + "Meter communication failure", + "Battery loss", + "Parallel communication quality", + "Error" + ] + lookup: + - key: 0x0000 + value: "Ok" + - key: 0x0002 + value: "Fan failure" + - key: 0x0004 + value: "Grid phase failure" + - key: 0x0008 + value: "Meter communication failure" + - key: 0x40000000 + value: "Battery loss" + - key: 0x80000000 + value: "Parallel communication quality" + - key: "default" + value: "Error" + - name: "Fault information Word 1" class: "" state_class: "" @@ -606,65 +640,6 @@ parameters: - key: 0x0000 value: "OK" - - name: "Warning Code" - class: "" - state_class: "" - uom: "" - scale: 1 - rule: 6 - registers: [0x0065, 0x0066] - icon: "mdi:information-slab-circle-outline" - lookup: - - key: 0x0000 - value: "None" - - key: W01 - value: "W01 reserve" - - key: 0x1 - value: "W01 reserve" - - key: W02 - value: "W02 FAN_WARN" - - key: 0x2 - value: "W02 FAN_WARN" - - key: W03 - value: "W03 Grid phase wrong" - - key: 0x3 - value: "W03 Grid phase wrong" - - key: W04 - value: "W04 meter_Comm_Fail" - - key: 0x4 - value: "W04 meter_Comm_Fail" - - - name: "Alert" - class: "" - state_class: "" - uom: "" - scale: 1 - rule: 3 - registers: [0x0075, 0x0076] - icon: "mdi:message-alert-outline" - options: - [ - "Ok", - "Fan failure", - "Grid error", - "Battery loss", - "Parallel communication quality", - "Error", - ] - lookup: - - key: 0x0000 - value: "Ok" - - key: 0x0001 - value: "Fan failure" - - key: 0x0002 - value: "Grid error" - - key: 0x4000 - value: "Battery loss" - - key: 0x8000 - value: "Parallel communication quality" - - key: "default" - value: "Error" - - group: Control items: # Device - On/Off Switch diff --git a/custom_components/solarman/inverter_definitions/deye_sg01hp3.yaml b/custom_components/solarman/inverter_definitions/deye_sg01hp3.yaml index 4508b627..d0cbc6a0 100644 --- a/custom_components/solarman/inverter_definitions/deye_sg01hp3.yaml +++ b/custom_components/solarman/inverter_definitions/deye_sg01hp3.yaml @@ -1569,7 +1569,7 @@ parameters: value: "Power Supply" # Device - Alarm message (word 1 & 2) [0, 65535] - - name: "Device Alert" + - name: "Device Alarm" update_interval: 30 class: "enum" state_class: "" @@ -1577,12 +1577,13 @@ parameters: scale: 1 rule: 3 registers: [0x0229, 0x022A] - icon: "mdi:alert-circle" + icon: "mdi:message-alert-outline" options: [ "Ok", "Fan failure", - "Grid error", + "Grid phase failure", + "Meter communication failure", "Battery loss", "Parallel communication quality", "Error" @@ -1590,13 +1591,15 @@ parameters: lookup: - key: 0x0000 value: "Ok" - - key: 0x0001 - value: "Fan failure" - key: 0x0002 - value: "Grid error" - - key: 0x4000 + value: "Fan failure" + - key: 0x0004 + value: "Grid phase failure" + - key: 0x0008 + value: "Meter communication failure" + - key: 0x40000000 value: "Battery loss" - - key: 0x8000 + - key: 0x80000000 value: "Parallel communication quality" - key: "default" value: "Error" @@ -1604,13 +1607,47 @@ parameters: # Device - Fault message (word 1, 2, 3 & 4) [0, 65535] - name: "Device Fault" update_interval: 30 - class: "" + class: "enum" state_class: "" uom: "" scale: 1 - rule: 6 + rule: 3 registers: [0x22B, 0x022C, 0x022D, 0x022E] - icon: "mdi:alert" + icon: "mdi:alert-outline" + options: + [ + "Ok", + "DC/DC Soft Start failure", + "Auxiliary power supply failure", + "Working mode changed", + "AC Over-current failure", + "Tz_Integ_Fault failure", + "DC Over-current failure", + "AC current leakage failure", + "Temperature is too high", + "Error", + ] + lookup: + - key: 0x0000 + value: "Ok" + - key: 0x0040 + value: "DC/DC Soft Start failure" + - key: 0x0200 + value: "Auxiliary power supply failure" + - key: 0x1000 + value: "Working mode changed" + - key: 0x00020000 + value: "AC Over-current failure" + - key: 0x00040000 + value: "Tz_Integ_Fault failure" + - key: 0x00080000 + value: "DC Over-current failure" + - key: 0x00400000 + value: "AC current leakage failure" + - key: 0x8000000000000000 + value: "Temperature is too high" + - key: "default" + value: "Error" - group: Battery items: @@ -1630,7 +1667,6 @@ parameters: validation: min: 1 max: 99 - invalidate_all: # Battery - The voltage of battery 1 (L:0.01V, H:0.1V) - name: "Battery Voltage" diff --git a/custom_components/solarman/inverter_definitions/deye_sg04lp3.yaml b/custom_components/solarman/inverter_definitions/deye_sg04lp3.yaml index 50ddd8c0..50e8b1e4 100644 --- a/custom_components/solarman/inverter_definitions/deye_sg04lp3.yaml +++ b/custom_components/solarman/inverter_definitions/deye_sg04lp3.yaml @@ -1577,7 +1577,7 @@ parameters: value: "Power Supply" # Device - Alarm message (word 1 & 2) [0, 65535] - - name: "Device Alert" + - name: "Device Alarm" update_interval: 30 class: "enum" state_class: "" @@ -1585,12 +1585,13 @@ parameters: scale: 1 rule: 3 registers: [0x0229, 0x022A] - icon: "mdi:alert-circle" + icon: "mdi:message-alert-outline" options: [ "Ok", "Fan failure", - "Grid error", + "Grid phase failure", + "Meter communication failure", "Battery loss", "Parallel communication quality", "Error" @@ -1598,13 +1599,15 @@ parameters: lookup: - key: 0x0000 value: "Ok" - - key: 0x0001 - value: "Fan failure" - key: 0x0002 - value: "Grid error" - - key: 0x4000 + value: "Fan failure" + - key: 0x0004 + value: "Grid phase failure" + - key: 0x0008 + value: "Meter communication failure" + - key: 0x40000000 value: "Battery loss" - - key: 0x8000 + - key: 0x80000000 value: "Parallel communication quality" - key: "default" value: "Error" @@ -1612,13 +1615,47 @@ parameters: # Device - Fault message (word 1, 2, 3 & 4) [0, 65535] - name: "Device Fault" update_interval: 30 - class: "" + class: "enum" state_class: "" uom: "" scale: 1 - rule: 6 + rule: 3 registers: [0x22B, 0x022C, 0x022D, 0x022E] - icon: "mdi:alert" + icon: "mdi:alert-outline" + options: + [ + "Ok", + "DC/DC Soft Start failure", + "Auxiliary power supply failure", + "Working mode changed", + "AC Over-current failure", + "Tz_Integ_Fault failure", + "DC Over-current failure", + "AC current leakage failure", + "Temperature is too high", + "Error", + ] + lookup: + - key: 0x0000 + value: "Ok" + - key: 0x0040 + value: "DC/DC Soft Start failure" + - key: 0x0200 + value: "Auxiliary power supply failure" + - key: 0x1000 + value: "Working mode changed" + - key: 0x00020000 + value: "AC Over-current failure" + - key: 0x00040000 + value: "Tz_Integ_Fault failure" + - key: 0x00080000 + value: "DC Over-current failure" + - key: 0x00400000 + value: "AC current leakage failure" + - key: 0x8000000000000000 + value: "Temperature is too high" + - key: "default" + value: "Error" - group: Battery items: @@ -1638,7 +1675,6 @@ parameters: validation: min: 1 max: 99 - invalidate_all: # Battery - The voltage of battery 1 (L:0.01V, H:0.1V) - name: "Battery Voltage"