From b25cf39f45664468f0ceb8e5a8d8c827c4067f7a Mon Sep 17 00:00:00 2001 From: Kars de Jong Date: Mon, 2 Dec 2024 13:37:27 +0100 Subject: [PATCH 1/9] Correct inverter and measurement entities for older SolaX MIC inverters - The Measured Power entity for Gen1 and Gen2 MIC inverters is actually the Inverter Power. - The Inverter Power entity for Gen1 and Gen2 MIC inverters is actually the Measured Power. - The Measured Power Lx entity for Gen1 X3-MIC inverters is actually the Lx Inverter Power. --- .../solax_modbus/plugin_solax.py | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/custom_components/solax_modbus/plugin_solax.py b/custom_components/solax_modbus/plugin_solax.py index b968fc8c..aa5f3c41 100644 --- a/custom_components/solax_modbus/plugin_solax.py +++ b/custom_components/solax_modbus/plugin_solax.py @@ -6381,8 +6381,8 @@ def value_function_battery_voltage_cell_difference(initval, descr, datadict): entity_category = EntityCategory.DIAGNOSTIC, ), SolaXModbusSensorEntityDescription( - name = "Measured Power", - key = "measured_power", + name = "Inverter Power", + key = "inverter_power", native_unit_of_measurement = UnitOfPower.WATT, device_class = SensorDeviceClass.POWER, state_class = SensorStateClass.MEASUREMENT, @@ -6405,8 +6405,8 @@ def value_function_battery_voltage_cell_difference(initval, descr, datadict): icon = "mdi:run", ), SolaXModbusSensorEntityDescription( - name = "Measured Power L1", - key = "measured_power_l1", + name = "Inverter Power L1", + key = "inverter_power_l1", native_unit_of_measurement = UnitOfPower.WATT, device_class = SensorDeviceClass.POWER, state_class = SensorStateClass.MEASUREMENT, @@ -6415,8 +6415,8 @@ def value_function_battery_voltage_cell_difference(initval, descr, datadict): allowedtypes = MIC | GEN | X3, ), SolaXModbusSensorEntityDescription( - name = "Measured Power L2", - key = "measured_power_l2", + name = "Inverter Power L2", + key = "inverter_power_l2", native_unit_of_measurement = UnitOfPower.WATT, device_class = SensorDeviceClass.POWER, state_class = SensorStateClass.MEASUREMENT, @@ -6425,8 +6425,8 @@ def value_function_battery_voltage_cell_difference(initval, descr, datadict): allowedtypes = MIC | GEN | X3, ), SolaXModbusSensorEntityDescription( - name = "Measured Power L3", - key = "measured_power_l3", + name = "Inverter Power L3", + key = "inverter_power_l3", native_unit_of_measurement = UnitOfPower.WATT, device_class = SensorDeviceClass.POWER, state_class = SensorStateClass.MEASUREMENT, @@ -6568,8 +6568,8 @@ def value_function_battery_voltage_cell_difference(initval, descr, datadict): icon = "mdi:solar-power-variant", ), SolaXModbusSensorEntityDescription( - name = "Inverter Power", - key = "inverter_power", + name = "Measured Power", + key = "measured_power", native_unit_of_measurement = UnitOfPower.WATT, device_class = SensorDeviceClass.POWER, state_class = SensorStateClass.MEASUREMENT, @@ -6641,8 +6641,8 @@ def value_function_battery_voltage_cell_difference(initval, descr, datadict): icon = "mdi:home-import-outline", ), SolaXModbusSensorEntityDescription( - name = "Inverter Power", - key = "inverter_power", + name = "Measured Power", + key = "measured_power", native_unit_of_measurement = UnitOfPower.WATT, device_class = SensorDeviceClass.POWER, state_class = SensorStateClass.MEASUREMENT, From 28c6b4004f6a96c93354d8a30a4bb47d046e43c0 Mon Sep 17 00:00:00 2001 From: Kars de Jong Date: Mon, 2 Dec 2024 13:47:08 +0100 Subject: [PATCH 2/9] Enable house load entity for MIC inverters House load can be calculated for MIC inverters that have a meter connected. --- custom_components/solax_modbus/plugin_solax.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/solax_modbus/plugin_solax.py b/custom_components/solax_modbus/plugin_solax.py index aa5f3c41..3dd4a0d7 100644 --- a/custom_components/solax_modbus/plugin_solax.py +++ b/custom_components/solax_modbus/plugin_solax.py @@ -6017,7 +6017,7 @@ def value_function_battery_voltage_cell_difference(initval, descr, datadict): native_unit_of_measurement = UnitOfPower.WATT, device_class = SensorDeviceClass.POWER, state_class = SensorStateClass.MEASUREMENT, - allowedtypes = AC | HYBRID | GEN2 | GEN3 | GEN4 | GEN5, + allowedtypes = AC | HYBRID | MIC | GEN | GEN2 | GEN3 | GEN4 | GEN5, icon = "mdi:home-lightning-bolt", ), SolaXModbusSensorEntityDescription( From fef7079ff64276c48701a0cba4e35b3551e5ebd1 Mon Sep 17 00:00:00 2001 From: Mikael Andersson Date: Wed, 20 Nov 2024 14:49:04 +0100 Subject: [PATCH 3/9] Add entity Main Breaker Current Limit --- .../solax_modbus/plugin_solax.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/custom_components/solax_modbus/plugin_solax.py b/custom_components/solax_modbus/plugin_solax.py index b968fc8c..abc86fac 100644 --- a/custom_components/solax_modbus/plugin_solax.py +++ b/custom_components/solax_modbus/plugin_solax.py @@ -803,6 +803,18 @@ def value_function_battery_voltage_cell_difference(initval, descr, datadict): allowedtypes = AC | HYBRID | GEN4 | GEN5, icon = "mdi:battery-charging-high", ), + SolaxModbusNumberEntityDescription( + name = "Main Breaker Current Limit", + key = "main_breaker_current_limit", + register = 0x71, + fmt = "i", + native_min_value = 10, + native_max_value = 250, + native_step = 1, + native_unit_of_measurement = UnitOfElectricCurrent.AMPERE, + device_class = NumberDeviceClass.CURRENT, + allowedtypes = AC | HYBRID | GEN4 | GEN5, + ), SolaxModbusNumberEntityDescription( name = "Feedin On Power", key = "feedin_on_power", @@ -2842,6 +2854,13 @@ def value_function_battery_voltage_cell_difference(initval, descr, datadict): allowedtypes = HYBRID | GEN4 | GEN5, internal = True, ), + SolaXModbusSensorEntityDescription( + name = "Main Breaker Current Limit", + key = "main_breaker_current_limit", + register = 0xD7, + allowedtypes = AC | HYBRID | GEN4 | GEN5, + internal = True, + ), SolaXModbusSensorEntityDescription( name = "Battery Install Capacity", key = "battery_install_capacity", From 67904426a69b06a0f26f9732a50affb22f7d9ff5 Mon Sep 17 00:00:00 2001 From: Kars de Jong Date: Fri, 6 Dec 2024 15:28:38 +0100 Subject: [PATCH 4/9] Enable Inverter Power Lx entities for X3 Gen2 --- custom_components/solax_modbus/plugin_solax.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/custom_components/solax_modbus/plugin_solax.py b/custom_components/solax_modbus/plugin_solax.py index 3dd4a0d7..bc9b5f17 100644 --- a/custom_components/solax_modbus/plugin_solax.py +++ b/custom_components/solax_modbus/plugin_solax.py @@ -6412,7 +6412,7 @@ def value_function_battery_voltage_cell_difference(initval, descr, datadict): state_class = SensorStateClass.MEASUREMENT, register = 0x410, register_type = REG_INPUT, - allowedtypes = MIC | GEN | X3, + allowedtypes = MIC | GEN | GEN2 | X3, ), SolaXModbusSensorEntityDescription( name = "Inverter Power L2", @@ -6422,7 +6422,7 @@ def value_function_battery_voltage_cell_difference(initval, descr, datadict): state_class = SensorStateClass.MEASUREMENT, register = 0x411, register_type = REG_INPUT, - allowedtypes = MIC | GEN | X3, + allowedtypes = MIC | GEN | GEN2 | X3, ), SolaXModbusSensorEntityDescription( name = "Inverter Power L3", @@ -6432,7 +6432,7 @@ def value_function_battery_voltage_cell_difference(initval, descr, datadict): state_class = SensorStateClass.MEASUREMENT, register = 0x412, register_type = REG_INPUT, - allowedtypes = MIC | GEN | X3, + allowedtypes = MIC | GEN | GEN2 | X3, ), SolaXModbusSensorEntityDescription( name = "PV Power 1", From 5a792102b90cf912c0e43b667895366edc08d6b8 Mon Sep 17 00:00:00 2001 From: GC Date: Wed, 11 Dec 2024 08:24:51 +0100 Subject: [PATCH 5/9] add proper rounding to some sensors --- custom_components/solax_modbus/plugin_solinteg.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/custom_components/solax_modbus/plugin_solinteg.py b/custom_components/solax_modbus/plugin_solinteg.py index d7e77799..876733b5 100644 --- a/custom_components/solax_modbus/plugin_solinteg.py +++ b/custom_components/solax_modbus/plugin_solinteg.py @@ -563,7 +563,6 @@ def __init__(self, **kwargs): device_class = SensorDeviceClass.POWER, state_class = SensorStateClass.MEASUREMENT, register = 11062, - #scale = 0.001, unit = REGISTER_U32, scan_group = SCAN_GROUP_MPPT, icon = "mdi:solar-power-variant", @@ -785,6 +784,7 @@ def __init__(self, **kwargs): device_class = SensorDeviceClass.BATTERY, register = 33000, scale = 0.01, + rounding = 2, allowedtypes = HYBRID, scan_group = SCAN_GROUP_MEDIUM, ), @@ -794,6 +794,7 @@ def __init__(self, **kwargs): native_unit_of_measurement = PERCENTAGE, register = 33001, scale = 0.01, + rounding = 2, allowedtypes = HYBRID, icon = "mdi:battery-heart", entity_category = EntityCategory.DIAGNOSTIC, @@ -836,6 +837,7 @@ def __init__(self, **kwargs): native_unit_of_measurement = UnitOfElectricPotential.VOLT, register = 33015, scale = 0.001, + rounding = 3, allowedtypes = HYBRID, icon = "mdi:battery-heart", entity_registry_enabled_default = False, @@ -855,6 +857,7 @@ def __init__(self, **kwargs): native_unit_of_measurement = UnitOfElectricPotential.VOLT, register = 33013, scale = 0.001, + rounding = 3, allowedtypes = HYBRID, icon = "mdi:battery-heart", entity_registry_enabled_default = False, @@ -1070,6 +1073,7 @@ def __init__(self, **kwargs): register = 11004, #0? unit = REGISTER_U32, scale = 0.01, + rounding = 2, entity_registry_enabled_default = False, icon = "mdi:home-import-outline", ), @@ -1082,6 +1086,7 @@ def __init__(self, **kwargs): register = 11002, #0? unit = REGISTER_U32, scale = 0.01, + rounding = 2, entity_registry_enabled_default = False, icon = "mdi:home-export-outline", ), From f3ecccecb384982fbeb2c8de759610969e7686ac Mon Sep 17 00:00:00 2001 From: GC Date: Wed, 11 Dec 2024 09:24:21 +0100 Subject: [PATCH 6/9] add battery hw version --- custom_components/solax_modbus/plugin_solinteg.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/custom_components/solax_modbus/plugin_solinteg.py b/custom_components/solax_modbus/plugin_solinteg.py index 876733b5..daf85432 100644 --- a/custom_components/solax_modbus/plugin_solinteg.py +++ b/custom_components/solax_modbus/plugin_solinteg.py @@ -784,7 +784,7 @@ def __init__(self, **kwargs): device_class = SensorDeviceClass.BATTERY, register = 33000, scale = 0.01, - rounding = 2, + rounding = 1, allowedtypes = HYBRID, scan_group = SCAN_GROUP_MEDIUM, ), @@ -794,7 +794,7 @@ def __init__(self, **kwargs): native_unit_of_measurement = PERCENTAGE, register = 33001, scale = 0.01, - rounding = 2, + rounding = 1, allowedtypes = HYBRID, icon = "mdi:battery-heart", entity_category = EntityCategory.DIAGNOSTIC, @@ -821,6 +821,16 @@ def __init__(self, **kwargs): icon = "mdi:information", entity_category = EntityCategory.DIAGNOSTIC, ), + SolintegModbusSensorEntityDescription( + name = "Battery Hardware", + key = "battery_hardware", + register = 32004, + #unit = REGISTER_U16, + scale = lambda v, *a: _bytes_str(v.to_bytes(2)), + allowedtypes = HYBRID, + icon = "mdi:information", + entity_category = EntityCategory.DIAGNOSTIC, + ), SolintegModbusSensorEntityDescription( name = "Battery Rated Capacity", key = "battery_rated_capacity", From 6480ef59113d3df66107288f819822db40542697 Mon Sep 17 00:00:00 2001 From: Wouter Date: Sat, 14 Dec 2024 22:13:13 +0100 Subject: [PATCH 7/9] Update compatible-adaptors.md Added a Wifi - RS485 option --- docs/compatible-adaptors.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/compatible-adaptors.md b/docs/compatible-adaptors.md index 8c07d7a3..abe2b4ea 100644 --- a/docs/compatible-adaptors.md +++ b/docs/compatible-adaptors.md @@ -66,6 +66,14 @@ Note that port 8899 is also open on the LSW-3 logger, but any ModBus TCP connect - Pocket WiFi 3.0 with Firmware V3.004.03 and above is only officially supported. - SolaX only mentions Gen4 Hybrid, other inverters may work? +## Wifi - RS485 + +### [Tasmota modbus bridge on ESP8266](https://tasmota.github.io/docs/Modbus-Bridge) + +An ESP8266 dongle with Tasmota installed and setup as a modbus bridge works great. +Use a RS485 module to convert the modbus serial interface to RS485. +This works flawless for my Solis hybrid inverter. + ## Untested but should work according to the specs... ### [USR-N510 RS485 to Ethernet](https://www.pusr.com/products/1-rs485-serial-port-etherne-device-servers-usr-n510.html) @@ -115,4 +123,4 @@ This RS485 adaptor is very problematic: **Not to be confused with the DIN Rail mounted Waveshare RS485 TO ETH (B) mentioned above.** - This adaptor does not support "Modbus Transmission" it is a passive device. - You can't submit requests to the Inverter. -- It does not work! \ No newline at end of file +- It does not work! From 6587e9d4ce4a14664b71ebb1092edc6fe3431ee1 Mon Sep 17 00:00:00 2001 From: GC Date: Tue, 17 Dec 2024 09:04:13 +0100 Subject: [PATCH 8/9] add empty units, for graphs --- custom_components/solax_modbus/plugin_solinteg.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/custom_components/solax_modbus/plugin_solinteg.py b/custom_components/solax_modbus/plugin_solinteg.py index daf85432..c9247943 100644 --- a/custom_components/solax_modbus/plugin_solinteg.py +++ b/custom_components/solax_modbus/plugin_solinteg.py @@ -11,7 +11,8 @@ """ Gabriel C. Plugin for Solinteg inverter, using ModbusTCP - Only basic functionality for now + Also works for identical devices: M-TEC Energy Butler, Wattsonic + Most basic functionality implemented """ """ ============================================================================================ @@ -856,6 +857,7 @@ def __init__(self, **kwargs): SolintegModbusSensorEntityDescription( name = "Bat. Min Cell Voltage ID", key = "battery_min_cell_voltage_id", + native_unit_of_measurement = "", register = 33014, allowedtypes = HYBRID, entity_registry_enabled_default = False, @@ -876,6 +878,7 @@ def __init__(self, **kwargs): SolintegModbusSensorEntityDescription( name = "Bat. Max Cell Voltage ID", key = "battery_max_cell_voltage_id", + native_unit_of_measurement = "", register = 33012, allowedtypes = HYBRID, entity_registry_enabled_default = False, From 899108ec043acc183c24787b43489ac5fa6ae20f Mon Sep 17 00:00:00 2001 From: GC Date: Tue, 17 Dec 2024 12:09:18 +0100 Subject: [PATCH 9/9] increase soc/soh precision --- custom_components/solax_modbus/plugin_solinteg.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/custom_components/solax_modbus/plugin_solinteg.py b/custom_components/solax_modbus/plugin_solinteg.py index c9247943..e6a9a213 100644 --- a/custom_components/solax_modbus/plugin_solinteg.py +++ b/custom_components/solax_modbus/plugin_solinteg.py @@ -785,7 +785,7 @@ def __init__(self, **kwargs): device_class = SensorDeviceClass.BATTERY, register = 33000, scale = 0.01, - rounding = 1, + rounding = 2, allowedtypes = HYBRID, scan_group = SCAN_GROUP_MEDIUM, ), @@ -795,7 +795,7 @@ def __init__(self, **kwargs): native_unit_of_measurement = PERCENTAGE, register = 33001, scale = 0.01, - rounding = 1, + rounding = 2, allowedtypes = HYBRID, icon = "mdi:battery-heart", entity_category = EntityCategory.DIAGNOSTIC,