Universal Solar Inverter over Modbus RS485 / TCP custom_component (AlphaESS, Growatt, Sofar, SolaX, Solinteg, Solis, SRNE, Swatten, TIGO TSI & Qcells Q.Volt Hyb)

If the Inverter is locked you can’t write to it.

Press the Unlock Inverter Button

Default naming is: button.solax_unlock_inverter

Thank you for the help!
I am pretty sure I had unlocked it before - does it lock again after some time or should it now stay unlocked indefinitely?
Problem solved.

I think it becomes locked again following a power cycle or a firmware update?

Ok, so in my automation I should check probably for the state and change it in case of need to make it work. Thank you

I did not have to unlock my inverter since the initial installation, it has been running for 18 months now.

@tomcoleman @mlduncombe

I have just released 2023.03.2b9 which reintroduces an alternative “House Load Alt” this is using the old calculation.

Let me know if it seems better and doesn’t mirror the PV Curve as much.

Not sure what changed, but I tested again with 2023.03.2b18 and it doesn’t work anymore.
All sensors remain in state “Unknown”.
The logs don’t indicate any issue.

2023-04-05 10:34:04.234 INFO (MainThread) [custom_components.solax_modbus.sensor] adding register 0x400 pv_voltage_1 to block with start 0x400
2023-04-05 10:34:04.234 INFO (MainThread) [custom_components.solax_modbus.sensor] adding register 0x401 pv_voltage_2 to block with start 0x400
2023-04-05 10:34:04.234 INFO (MainThread) [custom_components.solax_modbus.sensor] adding register 0x402 pv_current_1 to block with start 0x400
2023-04-05 10:34:04.234 INFO (MainThread) [custom_components.solax_modbus.sensor] adding register 0x403 pv_current_2 to block with start 0x400
2023-04-05 10:34:04.234 INFO (MainThread) [custom_components.solax_modbus.sensor] adding register 0x404 grid_voltage_l1 to block with start 0x400
2023-04-05 10:34:04.234 INFO (MainThread) [custom_components.solax_modbus.sensor] adding register 0x405 grid_voltage_l2 to block with start 0x400
2023-04-05 10:34:04.234 INFO (MainThread) [custom_components.solax_modbus.sensor] adding register 0x406 grid_voltage_l3 to block with start 0x400
2023-04-05 10:34:04.234 INFO (MainThread) [custom_components.solax_modbus.sensor] adding register 0x407 grid_frequency_l1 to block with start 0x400
2023-04-05 10:34:04.234 INFO (MainThread) [custom_components.solax_modbus.sensor] adding register 0x408 grid_frequency_l2 to block with start 0x400
2023-04-05 10:34:04.234 INFO (MainThread) [custom_components.solax_modbus.sensor] adding register 0x409 grid_frequency_l3 to block with start 0x400
2023-04-05 10:34:04.234 INFO (MainThread) [custom_components.solax_modbus.sensor] adding register 0x40a grid_current_l1 to block with start 0x400
2023-04-05 10:34:04.234 INFO (MainThread) [custom_components.solax_modbus.sensor] adding register 0x40b grid_current_l2 to block with start 0x400
2023-04-05 10:34:04.234 INFO (MainThread) [custom_components.solax_modbus.sensor] adding register 0x40c grid_current_l3 to block with start 0x400
2023-04-05 10:34:04.234 INFO (MainThread) [custom_components.solax_modbus.sensor] adding register 0x40d inverter_temperature to block with start 0x400
2023-04-05 10:34:04.235 INFO (MainThread) [custom_components.solax_modbus.sensor] adding register 0x40e measured_power to block with start 0x400
2023-04-05 10:34:04.235 INFO (MainThread) [custom_components.solax_modbus.sensor] adding register 0x40f run_mode to block with start 0x400
2023-04-05 10:34:04.235 INFO (MainThread) [custom_components.solax_modbus.sensor] adding register 0x410 measured_power_l1 to block with start 0x400
2023-04-05 10:34:04.235 INFO (MainThread) [custom_components.solax_modbus.sensor] adding register 0x411 measured_power_l2 to block with start 0x400
2023-04-05 10:34:04.235 INFO (MainThread) [custom_components.solax_modbus.sensor] adding register 0x412 measured_power_l3 to block with start 0x400
2023-04-05 10:34:04.235 INFO (MainThread) [custom_components.solax_modbus.sensor] adding register 0x414 pv_power_1 to block with start 0x400
2023-04-05 10:34:04.235 INFO (MainThread) [custom_components.solax_modbus.sensor] adding register 0x415 pv_power_2 to block with start 0x400
2023-04-05 10:34:04.235 INFO (MainThread) [custom_components.solax_modbus.sensor] adding register 0x423 total_yield to block with start 0x400
2023-04-05 10:34:04.235 INFO (MainThread) [custom_components.solax_modbus.sensor] adding register 0x425 today_yield to block with start 0x400
2023-04-05 10:34:04.235 INFO (MainThread) [custom_components.solax_modbus.sensor] adding register 0x435 inverter_power to block with start 0x400
2023-04-05 10:34:04.235 INFO (MainThread) [custom_components.solax_modbus.sensor] adding register 0x437 total_grid_export to block with start 0x400
2023-04-05 10:34:04.235 INFO (MainThread) [custom_components.solax_modbus.sensor] adding register 0x439 total_grid_import to block with start 0x400
2023-04-05 10:34:04.235 INFO (MainThread) [custom_components.solax_modbus.sensor] adding register 0x43b today_grid_export to block with start 0x400
2023-04-05 10:34:04.235 INFO (MainThread) [custom_components.solax_modbus.sensor] adding register 0x43c today_grid_import to block with start 0x400
2023-04-05 10:34:04.235 INFO (MainThread) [custom_components.solax_modbus.sensor] SolaX X3-MIC returning input block: 0x400 0x43d [1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1044, 1045, 1059, 1061, 1077, 1079, 1081, 1083, 1084]
2023-04-05 10:34:04.235 INFO (MainThread) [custom_components.solax_modbus.sensor] computedRegs: {'pv_power_total': SolaXMicModbusSensorEntityDescription(key='pv_power_total', device_class=<SensorDeviceClass.POWER: 'power'>, entity_category=None, entity_registry_enabled_default=True, entity_registry_visible_default=True, force_update=False, icon='mdi:solar-power-variant', has_entity_name=False, name='PV Power Total', translation_key=None, unit_of_measurement=None, last_reset=None, native_unit_of_measurement=<UnitOfPower.WATT: 'W'>, options=None, state_class=<SensorStateClass.MEASUREMENT: 'measurement'>, suggested_display_precision=None, suggested_unit_of_measurement=None, allowedtypes=8192, scale=1, read_scale_exceptions=None, blacklist=None, register=-1, rounding=1, register_type=1, unit='_uint16', newblock=False, value_function=<function value_function_pv_power_total at 0x7fa4c54aff40>, wordcount=None, sleepmode=1, ignore_readerror=False), 'pv_total_power': SolaXMicModbusSensorEntityDescription(key='pv_total_power', device_class=<SensorDeviceClass.POWER: 'power'>, entity_category=None, entity_registry_enabled_default=False, entity_registry_visible_default=True, force_update=False, icon='mdi:solar-power-variant', has_entity_name=False, name='PV Total Power', translation_key=None, unit_of_measurement=None, last_reset=None, native_unit_of_measurement=<UnitOfPower.WATT: 'W'>, options=None, state_class=<SensorStateClass.MEASUREMENT: 'measurement'>, suggested_display_precision=None, suggested_unit_of_measurement=None, allowedtypes=8192, scale=1, read_scale_exceptions=None, blacklist=None, register=-1, rounding=1, register_type=1, unit='_uint16', newblock=False, value_function=<function value_function_pv_power_total at 0x7fa4c54aff40>, wordcount=None, sleepmode=1, ignore_readerror=False)}

This is the log from version 2023.02.6, which does work:

2023-04-05 11:00:35.163 INFO (MainThread) [custom_components.solax_modbus.button] hub.wakeuButton: SolaxModbusButtonEntityDescription(key='battery_awaken', device_class=None, entity_category=None, entity_registry_enabled_default=True, entity_registry_visible_default=True, force_update=False, icon='mdi:battery-clock', has_entity_name=False, name='Battery Awaken', translation_key=None, unit_of_measurement=None, allowedtypes=0, register=86, command=1, blacklist=None, write_method=1, value_function=None, autorepeat=None)
2023-04-05 11:00:35.163 INFO (MainThread) [custom_components.solax_modbus.sensor] adding register 0x400 pv_voltage_1 to block with start 0x400
2023-04-05 11:00:35.163 INFO (MainThread) [custom_components.solax_modbus.sensor] adding register 0x401 pv_voltage_2 to block with start 0x400
2023-04-05 11:00:35.163 INFO (MainThread) [custom_components.solax_modbus.sensor] adding register 0x402 pv_current_1 to block with start 0x400
2023-04-05 11:00:35.163 INFO (MainThread) [custom_components.solax_modbus.sensor] adding register 0x403 pv_current_2 to block with start 0x400
2023-04-05 11:00:35.163 INFO (MainThread) [custom_components.solax_modbus.sensor] adding register 0x404 grid_voltage_l1 to block with start 0x400
2023-04-05 11:00:35.163 INFO (MainThread) [custom_components.solax_modbus.sensor] adding register 0x405 grid_voltage_l2 to block with start 0x400
2023-04-05 11:00:35.163 INFO (MainThread) [custom_components.solax_modbus.sensor] adding register 0x406 grid_voltage_l3 to block with start 0x400
2023-04-05 11:00:35.163 INFO (MainThread) [custom_components.solax_modbus.sensor] Starting new block at 0x407
2023-04-05 11:00:35.163 INFO (MainThread) [custom_components.solax_modbus.sensor] adding register 0x407 grid_frequency_l1 to block with start 0x407
2023-04-05 11:00:35.163 INFO (MainThread) [custom_components.solax_modbus.sensor] adding register 0x408 grid_frequency_l2 to block with start 0x407
2023-04-05 11:00:35.163 INFO (MainThread) [custom_components.solax_modbus.sensor] adding register 0x409 grid_frequency_l3 to block with start 0x407
2023-04-05 11:00:35.164 INFO (MainThread) [custom_components.solax_modbus.sensor] adding register 0x40a grid_current_l1 to block with start 0x407
2023-04-05 11:00:35.164 INFO (MainThread) [custom_components.solax_modbus.sensor] adding register 0x40b grid_current_l2 to block with start 0x407
2023-04-05 11:00:35.164 INFO (MainThread) [custom_components.solax_modbus.sensor] adding register 0x40c grid_current_l3 to block with start 0x407
2023-04-05 11:00:35.164 INFO (MainThread) [custom_components.solax_modbus.sensor] adding register 0x40d inverter_temperature to block with start 0x407
2023-04-05 11:00:35.164 INFO (MainThread) [custom_components.solax_modbus.sensor] Starting new block at 0x40e
2023-04-05 11:00:35.164 INFO (MainThread) [custom_components.solax_modbus.sensor] adding register 0x40e measured_power to block with start 0x40e
2023-04-05 11:00:35.164 INFO (MainThread) [custom_components.solax_modbus.sensor] adding register 0x40f run_mode to block with start 0x40e
2023-04-05 11:00:35.164 INFO (MainThread) [custom_components.solax_modbus.sensor] adding register 0x410 measured_power_l1 to block with start 0x40e
2023-04-05 11:00:35.164 INFO (MainThread) [custom_components.solax_modbus.sensor] adding register 0x411 measured_power_l2 to block with start 0x40e
2023-04-05 11:00:35.164 INFO (MainThread) [custom_components.solax_modbus.sensor] adding register 0x412 measured_power_l3 to block with start 0x40e
2023-04-05 11:00:35.164 INFO (MainThread) [custom_components.solax_modbus.sensor] adding register 0x414 pv_power_1 to block with start 0x40e
2023-04-05 11:00:35.164 INFO (MainThread) [custom_components.solax_modbus.sensor] adding register 0x415 pv_power_2 to block with start 0x40e
2023-04-05 11:00:35.164 INFO (MainThread) [custom_components.solax_modbus.sensor] Starting new block at 0x423
2023-04-05 11:00:35.164 INFO (MainThread) [custom_components.solax_modbus.sensor] adding register 0x423 total_yield to block with start 0x423
2023-04-05 11:00:35.164 INFO (MainThread) [custom_components.solax_modbus.sensor] adding register 0x425 today_yield to block with start 0x423
2023-04-05 11:00:35.164 INFO (MainThread) [custom_components.solax_modbus.sensor] SolaX X3-MIC returning input block: 0x400 0x407 [1024, 1025, 1026, 1027, 1028, 1029, 1030]
2023-04-05 11:00:35.164 INFO (MainThread) [custom_components.solax_modbus.sensor] SolaX X3-MIC returning input block: 0x407 0x40e [1031, 1032, 1033, 1034, 1035, 1036, 1037]
2023-04-05 11:00:35.164 INFO (MainThread) [custom_components.solax_modbus.sensor] SolaX X3-MIC returning input block: 0x40e 0x416 [1038, 1039, 1040, 1041, 1042, 1044, 1045]
2023-04-05 11:00:35.164 INFO (MainThread) [custom_components.solax_modbus.sensor] SolaX X3-MIC returning input block: 0x423 0x427 [1059, 1061]
2023-04-05 11:00:35.165 INFO (MainThread) [custom_components.solax_modbus.sensor] computedRegs: {'pv_power_total': SolaXMicModbusSensorEntityDescription(key='pv_power_total', device_class=<SensorDeviceClass.POWER: 'power'>, entity_category=None, entity_registry_enabled_default=True, entity_registry_visible_default=True, force_update=False, icon='mdi:solar-power-variant', has_entity_name=False, name='PV Power Total', translation_key=None, unit_of_measurement=None, last_reset=None, native_unit_of_measurement=<UnitOfPower.WATT: 'W'>, options=None, state_class=<SensorStateClass.MEASUREMENT: 'measurement'>, suggested_display_precision=None, suggested_unit_of_measurement=None, allowedtypes=8192, scale=1, read_scale_exceptions=None, blacklist=None, register=-1, rounding=1, register_type=1, unit='_uint16', newblock=False, value_function=<function value_function_pv_power_total at 0x7f7009739000>, wordcount=None, sleepmode=1), 'pv_total_power': SolaXMicModbusSensorEntityDescription(key='pv_total_power', device_class=<SensorDeviceClass.POWER: 'power'>, entity_category=None, entity_registry_enabled_default=False, entity_registry_visible_default=True, force_update=False, icon='mdi:solar-power-variant', has_entity_name=False, name='PV Total Power', translation_key=None, unit_of_measurement=None, last_reset=None, native_unit_of_measurement=<UnitOfPower.WATT: 'W'>, options=None, state_class=<SensorStateClass.MEASUREMENT: 'measurement'>, suggested_display_precision=None, suggested_unit_of_measurement=None, allowedtypes=8192, scale=1, read_scale_exceptions=None, blacklist=None, register=-1, rounding=1, register_type=1, unit='_uint16', newblock=False, value_function=<function value_function_pv_power_total at 0x7f7009739000>, wordcount=None, sleepmode=1)}

In the new version all registers are in one block, while in the old version there are multiple blocks, with a gap between 0x416 and 0x423.

Does it mention a register it’s failing on reading?

Edit: Possibly 0x435 inverter_power ?

No, it kinda surprised me too, but I don’t see any indication of failures to read registers. But that register (and the registers following that) are indeed not present on my firmware, so I would expect a read failure on this block.

I have just released 2023.03.2b19 with a newblock on 0x435 as that’s where I would expect it to fail.

Could you try that and let me know?

@wills106 2023.03.2b19 works like a charm!

I’ll add a note in the source code to not remove that ‘newblock’ as it’s needed for Inverters on FW lower than v1.38

1 Like

Good Afternoon (well it is in Australia when I write this), I have been reading through all your documentation and git-hub to setup HA and Solax (completely new at this) and I love your work.
I have an X1-Hybrid-G3 (X1-Hybrid-5.0-N-I) I connect through it via and nginx vm and can pull live data but the registers are different to everything I can find.
i.e. for SOC% on the G4 it is (‘sensor.solax_local’, ‘Data’)[18] but for my model of the G3 it is actually 20 instead.

I was wondering, was it purely trial and error testing to find the correct values or did you source the mapping info from somewhere?

  • I ask as I can’t find the correct config in any of the community setups.

Thank you for your time.

James

my curl command returns.
{“sn”:“xxxxxxxxxx”,“ver”:“2.035.01”,“type”:3,“Data”:[2457,13,170,4055,2821,16,15,646,404,5007,2,58091,4,52,0,0,20230,410,820,30,15,1,27591,0,28,0,0,0,0,0,0,0,0,0,0,0,0,100,0,45,4186,0,0,357,2480,15,0,0,65485,65535,27114,25,27260,36,221,40,256,2352,1568,250,200,266,248,36,35,544,1,1,21288,0,34669,1,59917,4,27,0,65372,65535,239,0,0,0,0,0,0,0,0,0,33,0,1045,0,0,27,0,62,11,23,0,0,0,0,0,0,0,0,0,0,1,22016,11061,1804,5892,0,0,0,0,1107,515,8995,8995,0,0,4369,0,273,2019,37,747,3635,3512,55908,210,21302,19778,18003,12597,16689,12610,12338,21302,13110,14641,13616,12593,12610,14387,21302,13110,14641,12849,14128,12354,14392,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,769,513,1794,1539,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], “Information”:[5.000,3,“xxxxxxxxxxxxx”,1,3.42,0.00,3.35,1.05,0.00,1]}

On another note, i have the X1-Hybrid-G3 & an X1-Mini (both with 6.6kW of panels both accessible), I am trying to get HA to read both and be able to do math from both lots of local and cloud data. I did think it would be as easy as doubling up the secrets & sensor yaml file definitions correctly with

solax_cloud2_api/solax_rest_cloud2 & solax_local2_ip/solax_rest_local2 and then do my math :-

state: “{{ state_attr(‘sensor.solax_rest_cloud’, ‘yieldtoday’) + state_attr(‘sensor.solax_rest_cloud2’, ‘yieldtoday’) }}”

Just wondering in your years of experience if this would be the way to go or it can’t be accomplished this way without a rewrite of the code from your modbus module?

This integration is setup to use Modbus and not the local web api built into the Pocket WiFi.
So I can’t offer any help I’m afraid, as I don’t own a Pocket WiFi.

As your Hybrid is a Gen3 why don’t you use the built in Ethernet and connect fully locally using this Integration?

With your X1-Mini if you upgrade your firmware to Arm 1.37 or above, you can connect via a RS485 - Ethernet adaptor.

I just checked my X1-Hybrid the Ethernet port cable runs down and is connected to the BMS on the battery.

As I am using nginx to access the X1-Hybrid through the dongle to pull data I can’t connected with the local connection to the software and read the curl output and the local at the same time, unless i can think of a way to connect through my ubuntu machine with some trickery.

That’s a RS485/CAN Bus cable.

There is an Ethernet Port internally.

How exactly are you connecting to your Pocket WiFi? Through 5.8.8.8?

Yeah i setup a VM on my Ubuntu box with a wifi dongle and setup nginx as a reverse proxy and so i can access the api from my local lan and then pointed modbus at it but the curl output doesn’t match with any of the configs from other people on here, I have been trying to figure it out and found a few of them, most seem to be 2 out from mine although in settings [28] was actually [31] for min SOC %.

Thank you for the picture that is great, but will i hit the same issue with the output being different?

As for the X1/Mini i have direct API access without having to setup nginx so i scored on that one.

This Integration is designed to work with Modbus. So it will work with the built in Ethernet port as that Provides Modbus over TCP. I own an X1 Gen3 Hybrid and that is how this Integration was developed.
It was later expanded to support other Inverters than only support Modbus RTU / RS485 connection.
Either through an RS485 - USB adaptor or a RS485 - Ethernet adaptor.

You don’t need any Nginx messing about or the Pocket WiFi

I think you are right I will run some ethernet cables to both inverters, check the X1-Mini firmware and order a RS485-Ethernet adapter and run them both off ethernet.

Any suggestions on the best adapter to us?

Also will I be able to pull both inverters cloud & local data in this way?