Skip to content

Commit 86d5b58

Browse files
committed
Fix GEN6 scaling of Total Yeild/Total Solar Energy
For proto>=100 the scaling is incorrect for GEN6.
1 parent 460c2f8 commit 86d5b58

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

custom_components/solax_modbus/plugin_solax.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7163,6 +7163,21 @@ def value_function_battery_voltage_cell_difference(initval: int, descr: Any, dat
71637163
register_data_type=REGISTER_U32,
71647164
allowedtypes=HYBRID | GEN3 | GEN4 | GEN5,
71657165
),
7166+
SolaXModbusSensorEntityDescription(
7167+
name="Total Yield",
7168+
key="total_yield",
7169+
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
7170+
icon="mdi:solar-power",
7171+
device_class=SensorDeviceClass.ENERGY,
7172+
state_class=SensorStateClass.TOTAL_INCREASING,
7173+
register=0x52,
7174+
scale=0.1,
7175+
rounding=2,
7176+
register_type=REG_INPUT,
7177+
register_data_type=REGISTER_U32,
7178+
modbus_min=100,
7179+
allowedtypes=HYBRID | GEN6,
7180+
),
71667181
SolaXModbusSensorEntityDescription(
71677182
name="Total Yield",
71687183
key="total_yield",
@@ -7175,6 +7190,7 @@ def value_function_battery_voltage_cell_difference(initval: int, descr: Any, dat
71757190
rounding=2,
71767191
register_type=REG_INPUT,
71777192
register_data_type=REGISTER_U32,
7193+
modbus_max=99,
71787194
allowedtypes=HYBRID | GEN6,
71797195
),
71807196
SolaXModbusSensorEntityDescription(
@@ -7678,6 +7694,21 @@ def value_function_battery_voltage_cell_difference(initval: int, descr: Any, dat
76787694
rounding=1,
76797695
allowedtypes=AC | HYBRID | GEN3 | GEN4 | GEN5,
76807696
),
7697+
SolaXModbusSensorEntityDescription(
7698+
name="Total Solar Energy",
7699+
key="total_solar_energy",
7700+
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
7701+
icon="mdi:solar-power",
7702+
device_class=SensorDeviceClass.ENERGY,
7703+
state_class=SensorStateClass.TOTAL_INCREASING,
7704+
register=0x94,
7705+
register_type=REG_INPUT,
7706+
register_data_type=REGISTER_U32,
7707+
scale=0.1,
7708+
rounding=1,
7709+
modbus_min=100,
7710+
allowedtypes=AC | HYBRID | GEN6,
7711+
),
76817712
SolaXModbusSensorEntityDescription(
76827713
name="Total Solar Energy",
76837714
key="total_solar_energy",
@@ -7690,6 +7721,7 @@ def value_function_battery_voltage_cell_difference(initval: int, descr: Any, dat
76907721
register_data_type=REGISTER_U32,
76917722
scale=0.001,
76927723
rounding=1,
7724+
modbus_max=99,
76937725
allowedtypes=AC | HYBRID | GEN6,
76947726
),
76957727
SolaXModbusSensorEntityDescription(

0 commit comments

Comments
 (0)