Skip to content

Commit

Permalink
- New sensor for sg01hp3 that returns total DC power (a sum from mult…
Browse files Browse the repository at this point in the history
…iple PV strings)

- New sensor for sg01hp3 that reads the inverter status
  • Loading branch information
daniel-deptula committed Nov 29, 2024
1 parent e23277a commit fbab534
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/metric_group_deye_sg01hp3.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
|Metric|MQTT topic suffix|Unit|Modbus address (dec)|Modbus address (hex)|Modbus data type|Scale factor|
|---|---|:-:|:-:|:-:|:-:|:-:|
|Running status|`inverter/status`|N/A (0: standby, 1: selfcheck, 2: normal, 3: alarm, 4: fault)|500|1f4|U_WORD|1|
|PV1 Power|`dc/pv1/power`|W|672|2a0|U_WORD|10|
|PV2 Power|`dc/pv2/power`|W|673|2a1|U_WORD|10|
|PV3 Power|`dc/pv3/power`|W|674|2a2|U_WORD|10|
|PV4 Power|`dc/pv4/power`|W|675|2a3|U_WORD|10|
|DC Total Power|`dc/total_power`|W|672,673,674,675|2a0,2a1,2a2,2a3|U_WORD|10|
|PV1 Voltage|`dc/pv1/voltage`|V|676|2a4|U_WORD|0.1|
|PV1 Current|`dc/pv1/current`|A|677|2a5|U_WORD|0.1|
|PV2 Voltage|`dc/pv2/voltage`|V|678|2a6|U_WORD|0.1|
Expand Down
15 changes: 15 additions & 0 deletions src/deye_sensors_deye_sg01hp3.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,14 @@
from deye_sensor import (
SingleRegisterSensor,
DoubleRegisterSensor,
ComputedSumSensor,
SensorRegisterRange,
)

deye_sg01hp3_inverter_500 = SingleRegisterSensor(
"Running status", 500, 1, mqtt_topic_suffix="inverter/status", unit="", signed=False, groups=["deye_sg01hp3"]
)

deye_sg01hp3_solar_672 = SingleRegisterSensor(
"PV1 Power", 672, 10, mqtt_topic_suffix="dc/pv1/power", unit="W", signed=False, groups=["deye_sg01hp3"]
)
Expand Down Expand Up @@ -642,8 +647,16 @@
groups=["deye_sg01hp3_bms"],
)

total_pv_power_sensor = ComputedSumSensor(
"DC Total Power",
[deye_sg01hp3_solar_672, deye_sg01hp3_solar_673, deye_sg01hp3_solar_674, deye_sg01hp3_solar_675],
mqtt_topic_suffix="dc/total_power",
unit="W",
groups=["deye_sg01hp3"],
)

deye_sg01hp3_sensors = [
deye_sg01hp3_inverter_500,
deye_sg01hp3_solar_672,
deye_sg01hp3_solar_673,
deye_sg01hp3_solar_674,
Expand Down Expand Up @@ -723,9 +736,11 @@
deye_sg01hp3_inverter_635,
deye_sg01hp3_inverter_540,
deye_sg01hp3_inverter_541,
total_pv_power_sensor,
]

deye_sg01hp3_register_ranges = [
SensorRegisterRange(group="deye_sg01hp3", first_reg_address=500, last_reg_address=500),
SensorRegisterRange(group="deye_sg01hp3_ups", first_reg_address=514, last_reg_address=558),
SensorRegisterRange(group="deye_sg01hp3", first_reg_address=514, last_reg_address=558),
SensorRegisterRange(group="deye_sg01hp3_battery", first_reg_address=514, last_reg_address=558),
Expand Down

0 comments on commit fbab534

Please sign in to comment.