Skip to content

Commit 8a137db

Browse files
authored
Adjust scale for battery_*_energy_total sensors in GEN6 Solax inverters
1 parent 6c4a794 commit 8a137db

1 file changed

Lines changed: 30 additions & 2 deletions

File tree

custom_components/solax_modbus/plugin_solax.py

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4678,7 +4678,21 @@ def value_function_battery_voltage_cell_difference(initval, descr, datadict):
46784678
scale=0.1,
46794679
unit=REGISTER_U32, # REGISTER_ULSB16MSB16,
46804680
entity_registry_enabled_default=False,
4681-
allowedtypes=AC | HYBRID,
4681+
allowedtypes=AC | HYBRID | GEN2 | GEN3 | GEN4 | GEN5,
4682+
),
4683+
SolaXModbusSensorEntityDescription(
4684+
name="Battery Output Energy Total", # Need revisit these
4685+
key="battery_output_energy_total",
4686+
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
4687+
device_class=SensorDeviceClass.ENERGY,
4688+
state_class=SensorStateClass.TOTAL, #1300
4689+
icon="mdi:battery-arrow-down",
4690+
register=0x1D,
4691+
register_type=REG_INPUT,
4692+
scale=0.001,
4693+
unit=REGISTER_U32, # REGISTER_ULSB16MSB16,
4694+
entity_registry_enabled_default=False,
4695+
allowedtypes=AC | HYBRID | GEN6,
46824696
),
46834697
SolaXModbusSensorEntityDescription(
46844698
name="Battery Input Energy Total",
@@ -4719,7 +4733,21 @@ def value_function_battery_voltage_cell_difference(initval, descr, datadict):
47194733
scale=0.1,
47204734
unit=REGISTER_U32, # REGISTER_ULSB16MSB16,
47214735
entity_registry_enabled_default=False,
4722-
allowedtypes=AC | HYBRID | GEN3 | GEN4 | GEN5 | GEN6,
4736+
allowedtypes=AC | HYBRID | GEN3 | GEN4 | GEN5,
4737+
),
4738+
SolaXModbusSensorEntityDescription(
4739+
name="Battery Input Energy Total",
4740+
key="battery_input_energy_total",
4741+
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
4742+
device_class=SensorDeviceClass.ENERGY,
4743+
state_class=SensorStateClass.TOTAL, #1300
4744+
icon="mdi:battery-arrow-up",
4745+
register=0x21,
4746+
register_type=REG_INPUT,
4747+
scale=0.001,
4748+
unit=REGISTER_U32, # REGISTER_ULSB16MSB16,
4749+
entity_registry_enabled_default=False,
4750+
allowedtypes=AC | HYBRID | GEN6,
47234751
),
47244752
SolaXModbusSensorEntityDescription(
47254753
name="Battery Package Number",

0 commit comments

Comments
 (0)