Skip to content

Commit

Permalink
inverter_power_g5
Browse files Browse the repository at this point in the history
Compute Inverter Power for Gen5 Hybrids
  • Loading branch information
wills106 committed Jan 28, 2025
1 parent e563c47 commit fa92b3e
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion custom_components/solax_modbus/plugin_solax.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,14 @@ def value_function_house_load_alt(initval, descr, datadict):
)


def value_function_inverter_power_g5(initval, descr, datadict):
return (
datadict.get("inverter_power_l1", 0)
+ datadict.get("inverter_power_l2", 0)
+ datadict.get("inverter_power_l3", 0)
)


def value_function_software_version_g2(initval, descr, datadict):
return f"DSP v2.{datadict.get('firmware_dsp')} ARM v2.{datadict.get('firmware_arm')}"

Expand Down Expand Up @@ -3906,7 +3914,7 @@ def value_function_battery_voltage_cell_difference(initval, descr, datadict):
register=0x2,
register_type=REG_INPUT,
unit=REGISTER_S16,
allowedtypes=AC | HYBRID | GEN2 | GEN3 | GEN4 | GEN5,
allowedtypes=AC | HYBRID | GEN2 | GEN3 | GEN4,
),
SolaXModbusSensorEntityDescription(
name="PV Voltage 1",
Expand Down Expand Up @@ -6245,6 +6253,15 @@ def value_function_battery_voltage_cell_difference(initval, descr, datadict):
entity_registry_enabled_default=False,
icon="mdi:home-lightning-bolt",
),
SolaXModbusSensorEntityDescription(
name="Inverter Power",
key="inverter_power",
value_function=value_function_inverter_power_g5,
native_unit_of_measurement=UnitOfPower.WATT,
device_class=SensorDeviceClass.POWER,
state_class=SensorStateClass.MEASUREMENT,
allowedtypes=AC | HYBRID | GEN5,
),
SolaXModbusSensorEntityDescription(
name="PV Power Total",
key="pv_power_total",
Expand Down

0 comments on commit fa92b3e

Please sign in to comment.