diff --git a/docs/metric_group_deye_sg01hp3.md b/docs/metric_group_deye_sg01hp3.md index 4caee23..16f2b05 100644 --- a/docs/metric_group_deye_sg01hp3.md +++ b/docs/metric_group_deye_sg01hp3.md @@ -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| diff --git a/src/deye_sensors_deye_sg01hp3.py b/src/deye_sensors_deye_sg01hp3.py index ba4dffd..160b140 100644 --- a/src/deye_sensors_deye_sg01hp3.py +++ b/src/deye_sensors_deye_sg01hp3.py @@ -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"] ) @@ -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, @@ -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),