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

I don’t know if this is the best/safest way but I shut down the inverter and afterwards cut the power at the fuse box. Just shutting down the inverter wasn’t enough in my case.

Hello, I’m trying to set SolaX Export Control User Limit when price is low. If I set a new value using entity slider, it works ok. Setting a value using Node Red is very strange - new value is set but it also sets (as a side effect?) other values, i.e. SolaX Battery Charge Max Current and others. I’ve uploaded 2 videos showing the case. Does anyone have any idea if the problem is on my side, Node Red or the plugin itself? I have the latest version of HA, Node Red, Solax inverter, Solax integration.

Video 1 - setting the value to 0 or some low value: HA - Solax - Set Export Control User Limit - YouTube
Video 2 - setting the value to 10000 or some high value: HA - Solax - Set Export Control User Limit 2 - YouTube

I prefer not to use Node Red, but I do have HA automations that set the export_control_user_limit to near zero (100) if prices are negative. I have not experienced that any other parameters would change in such a case.
Example automation:

alias: Negative Price
description: ""
trigger:
  - platform: numeric_state
    entity_id: sensor.ecopower_injection_price
    below: -0.001
condition:
  - condition: numeric_state
    entity_id: number.solax_export_control_user_limit
    above: 100
action:
  - service: number.set_value
    data:
      value: "100"
    target:
      entity_id: number.solax_export_control_user_limit
mode: single

1 Like

It’s already raised as an issue I don’t know what the register is for it and I haven’t come across any updated docs yet.

I confirm that HA automation works for me, too. Thank you, I will use that instead of Node Red.

The inverse automation to revert to normal is:

alias: Positive Price
description: ""
trigger:
  - platform: numeric_state
    entity_id: sensor.ecopower_injection_price
    above: -0.001
condition:
  - condition: numeric_state
    entity_id: number.solax_export_control_user_limit
    below: 101
  - condition: numeric_state
    entity_id: sensor.ecopower_injection_price
    above: 0
action:
  - service: number.set_value
    data:
      value: "8800"
    target:
      entity_id: number.solax_export_control_user_limit
mode: single

2023.08.1

Growatt:

  • General Improvements to entities. #471
  • Redefined all Growatt variations, corrected a number of missing entities.

Sofar:

  • Button to set Sofar - Reflux control.

Set select ‘reflux_control’ & number ‘reflux_power’ and then press button ‘reflux_control’
Number values will return to previously set value if button not pressed within 120 seconds of being changed.

Solis:

  • Added serial ‘1801’ PV Only S6-GR1P 1-3K, configured as a Hybrid at the moment. #444

Solis PV Inverters need further work to understand which sensors are relevant only to Hybrid vs PV.

  • Reverted “sleepmode = SLEEPMODE_NONE,” back to “sleepmode = SLEEPMODE_LASTAWAKE,” #453

I am trying to connect an RPI4 to a Solax X1-Hybrid-G3 with an ethernet cable between the RJ45 socket labelled ‘LAN’ in the inverter and the RPI’s RJ45 socket.

After completing the setup on the Integrations page these entries appear in the log:

Connection to (192.168.1.8, 502) failed: [Errno 113] Host is unreachable
14:33:55 – (ERROR) SolaX Inverter Modbus (custom integration)
unrecognized inverter type - serial number : unknown
14:33:52 – (ERROR) SolaX Inverter Modbus (custom integration)
SolaX: cannot find serial number, even not for MIC
14:33:52 – (ERROR) SolaX Inverter Modbus (custom integration)
SolaX: reading serial number from address 0x300 failed; other address may succeed
14:33:52 – (WARNING) SolaX Inverter Modbus (custom integration)
SolaX: attempt to read serialnumber failed at 0x0
14:33:52 – (WARNING) SolaX Inverter Modbus (custom integration) - message first occurred at 14:33:49 and shows up 2 times
Connection to (192.168.1.8, 502) failed: [Errno 113] Host is unreachable
14:33:52 – (ERROR) SolaX Inverter Modbus (custom integration) - message first occurred at 14:33:49 and shows up 2 times
SolaX: reading serial number from address 0x0 failed; other address may succeed
14:33:49 – (WARNING) SolaX Inverter Modbus (custom integration)

I have deleted the integration and the downloaded custom component files and then cleared the cache and reset the Integrations page (CTRL+F5). Repeating the installation has the same outcome.

I have previously been accessing the inverter through the Solax API.

Any and all help very gratefully received … pleeease.

I never tried without setting up with connecting to a proper network.

But at a minimum you would need to use a crossover cable and not a normal patch lead. You would have to set a fixed address on the Inverter LCD (The default is to use DHCP, but you are not providing one). Then on the PI manually assign it an IP address in the same range. How are you connecting to the PI if you are dedicating the Ethernet port to the Inverter? Are you connecting to it over WiFi?

Very prompt reply! Many thanks.

Yes, the PI has a wifi connection to a BT router.

I’m venturing into unknown territory.

I’ve ordered a crossover cable from Amazon.

I used nmcli to open wlan0 on the PI, not having included wifif in the initial PI setup. I can also use nmcli (e.g. How to Configure Network Connection Using 'nmcli' Tool) to setup a static ip address on the PI?

The inverter is in my daughter’s home so it might be a couple of days before I can try setting a static ip address.

My BT router tells me it assigns ip addresses in the range 192.168.1.64 - 192.168.1.253. So I could use 192.168.1.50 and 192.168.1.51 for the Pi and inverter?

No, the link to the inverter is on a separate network interface, so you absolutely must use a different subnet for this interface: eg 192.168.100.0/24 with for example the PI on additional address 192.168.100.1 and the inverter on 192.168.100.20

Thank you, to both @wills106 and @infradom. Magic happens on this forum when generous people freely share their expertise with strangers.

Trying to set reflux power gives an error:

Logger: homeassistant.util.async_
Source: util/async_.py:166
First occurred: 21:50:13 (582 occurrences)
Last logged: 23:52:49

Detected blocking call to sleep inside the event loop. This is causing stability issues. Please report issue to the custom integration author for solax_modbus doing blocking calls at custom_components/solax_modbus/__init__.py, line 336: return self._client.read_holding_registers(address, count, **kwargs)
Detected blocking call to sleep inside the event loop. This is causing stability issues. Please report issue to the custom integration author for solax_modbus doing blocking calls at custom_components/solax_modbus/__init__.py, line 420: return self._client.write_registers(address, payload, **kwargs)
Detected blocking call to sleep inside the event loop. This is causing stability issues. Please report issue to the custom integration author for solax_modbus doing blocking calls at custom_components/solax_modbus/__init__.py, line 379: return self._client.write_registers(address, payload, **kwargs)

The blocking calls aren’t an error to do with writing to a register. You can get rid of them by following…

Edit: There aren’t any active developers using a RS485-USB adaptor to look into a proper fix #379. Most people who need to connect over RS485 are using an Ethernet adaptor which turns the connection into Modbus over TCP.

Edit 2:

To set reflux power you need to set select"Reflux Control" & number"Reflux Power" then you can press the button “Reflux Control” to program the Inverter.

Some controls need to use write_registers and not write_register (two different functions) so you need to program multiple registers at once, hence the button to send the command sequence.

Do I understand right that Reflux Control for Sofar is not working properly at the moment?
When I press the button HA says:
failed to call service button/press.connection lost.
Or is there a question in using RS485-USB adaptor? Should I use Modbus over TCP?

If you have set values for select"Reflux Control" & number"Reflux Power" before pressing the button it should work ok.

It shouldn’t matter if using a USB adaptor or Ethernet.

Edit: If you are having issues getting it to work you are probably best asking here #421 I have had confirmation it works. But I don’t have any documentation written yet.
So I don’t know what the difference is between : “Enabled” & “Enabled - Set Value”

Hopefully once I get enough feedback I can update the Wiki on my GitHub for the Sofar Inverters.

I press the buttons in right order (reflux power slider sometimes jumps back to 0) and when I press Reflux control button, I get the error about calling service button/press and nothin happens.

You are best putting a proper error log onto that GitHub issue including the exact HA version you are running etc. Trying to troubleshoot on here soons gets a mess as you end up with other conversations mixed between.

You’ll also have a more focused user group to Sofar owners on that specific issue page.

When charging my EV (Tesla) I don’t want the Solax batteries to be used/discharged. My plan is to have an automation that triggers on the EV charger starting and set the Modbus Power Control mode “Enabled No Discharge” and autorepeat to 3600 seconds. When the EV charger stops charging I would like the inverter to return back to “default” (Work Mode=Self Use). Would the best solution be to just have a trigger when EV charging stops and set the autorepeat to 0?

Would you be able to share your automation for this?