Skip to content

Commit cf7876e

Browse files
authored
Merge pull request #1475 from mpi/patch-1
Adjust total and daily sensors for GEN6 Solax inverters
2 parents 90636a1 + 8a137db commit cf7876e

1 file changed

Lines changed: 61 additions & 5 deletions

File tree

custom_components/solax_modbus/plugin_solax.py

Lines changed: 61 additions & 5 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",
@@ -4992,6 +5020,20 @@ def value_function_battery_voltage_cell_difference(initval, descr, datadict):
49925020
unit=REGISTER_U32,
49935021
allowedtypes=HYBRID | GEN3 | GEN4 | GEN5,
49945022
),
5023+
SolaXModbusSensorEntityDescription(
5024+
name="Total Yield",
5025+
key="total_yield",
5026+
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
5027+
icon="mdi:solar-power",
5028+
device_class=SensorDeviceClass.ENERGY,
5029+
state_class=SensorStateClass.TOTAL_INCREASING,
5030+
register=0x52,
5031+
scale=0.001,
5032+
rounding=2,
5033+
register_type=REG_INPUT,
5034+
unit=REGISTER_U32,
5035+
allowedtypes=HYBRID | GEN6,
5036+
),
49955037
SolaXModbusSensorEntityDescription(
49965038
key="lock_state",
49975039
register=0x54,
@@ -5468,6 +5510,20 @@ def value_function_battery_voltage_cell_difference(initval, descr, datadict):
54685510
rounding=1,
54695511
allowedtypes=AC | HYBRID | GEN3 | GEN4 | GEN5,
54705512
),
5513+
SolaXModbusSensorEntityDescription(
5514+
name="Total Solar Energy",
5515+
key="total_solar_energy",
5516+
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
5517+
icon="mdi:solar-power",
5518+
device_class=SensorDeviceClass.ENERGY,
5519+
state_class=SensorStateClass.TOTAL_INCREASING,
5520+
register=0x94,
5521+
register_type=REG_INPUT,
5522+
unit=REGISTER_U32,
5523+
scale=0.001,
5524+
rounding=1,
5525+
allowedtypes=AC | HYBRID | GEN6,
5526+
),
54715527
SolaXModbusSensorEntityDescription(
54725528
name="Today's Solar Energy",
54735529
key="today_s_solar_energy",
@@ -5479,15 +5535,15 @@ def value_function_battery_voltage_cell_difference(initval, descr, datadict):
54795535
register_type=REG_INPUT,
54805536
scale=0.1,
54815537
rounding=1,
5482-
allowedtypes=AC | HYBRID | GEN3 | GEN4 | GEN5,
5538+
allowedtypes=AC | HYBRID | GEN3 | GEN4 | GEN5 | GEN6,
54835539
),
54845540
SolaXModbusSensorEntityDescription(
54855541
name="Today's Export Energy",
54865542
key="today_s_export_energy",
54875543
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
54885544
device_class=SensorDeviceClass.ENERGY,
54895545
state_class=SensorStateClass.TOTAL_INCREASING,
5490-
allowedtypes=AC | HYBRID | GEN3 | GEN4 | GEN5,
5546+
allowedtypes=AC | HYBRID | GEN3 | GEN4 | GEN5 | GEN6,
54915547
register=0x98,
54925548
register_type=REG_INPUT,
54935549
unit=REGISTER_U32,
@@ -5506,7 +5562,7 @@ def value_function_battery_voltage_cell_difference(initval, descr, datadict):
55065562
unit=REGISTER_U32,
55075563
scale=0.01,
55085564
rounding=2,
5509-
allowedtypes=AC | HYBRID | GEN3 | GEN4 | GEN5,
5565+
allowedtypes=AC | HYBRID | GEN3 | GEN4 | GEN5 | GEN6,
55105566
icon="mdi:home-import-outline",
55115567
),
55125568
SolaXModbusSensorEntityDescription(

0 commit comments

Comments
 (0)