Skip to content

Commit

Permalink
feat: Proper Alarm and Fault messaging
Browse files Browse the repository at this point in the history
  • Loading branch information
davidrapan committed Aug 14, 2024
1 parent 4442e78 commit 4b3f128
Show file tree
Hide file tree
Showing 4 changed files with 168 additions and 146 deletions.
97 changes: 36 additions & 61 deletions custom_components/solarman/inverter_definitions/deye_2mppt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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: ""
Expand Down Expand Up @@ -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
Expand Down
97 changes: 36 additions & 61 deletions custom_components/solarman/inverter_definitions/deye_4mppt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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: ""
Expand Down Expand Up @@ -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
Expand Down
60 changes: 48 additions & 12 deletions custom_components/solarman/inverter_definitions/deye_sg01hp3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1569,48 +1569,85 @@ 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: ""
uom: ""
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"
]
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"

# 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:
Expand All @@ -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"
Expand Down
Loading

0 comments on commit 4b3f128

Please sign in to comment.