Universal Solar Inverter over Modbus RS485 / TCP custom_component (Growatt, Sofar, SolaX, Solis)

I haven’t worked out which register shows the work mode yet.

I want to do more work on this and expand it into a proper integration, but I have been to busy with work over the past few months.

Great Wills, I am working on this too, I will share here my progress. Thanks again for your work.

Hi there,

i’ve recently bought a solax X1 3.3 air and I’m also trying to monitor it via the 485 port.

So, I was wondering does the modbus implementation of python also register itself correctly?

Does someone know what is a good tool to do some experiments by hand?

Edit:
I discoverd CAS Modbus Scanner as a tool and scanned the bus for devices. With a baudrate of 19200 I found nothing. However, with baudrate 9600 I get two ‘hits’ with the exception “illegal data value”. Investigating this now to get the correct slave ID

Have you tried the config for the X1-AC in my GitHub?
It uses a baud of 115,200

Hi Wills106!

Thanks for sharing the solution with Solax and modbus! I have the hybrid X3 with batteries and got all the sensors mapped from your files. I haven’t had time to try the automations for the batteries yet. I miss a sensor for the house consumption but I think I manage to make it on my own from the other sensors.

One thing you might know. I am interested in the values from the smart meter in my electrical cabinet. It measures all the phases (power, PF etc) and I would like to see how the loads are in my house on the 3 phases. Is it possible to retrieve the values from the smart meter from the Solax inverter?

Best regards

@fandersson

Are you using solax_x3_hybrid_g3_triplepower.yaml from my GitHub?

As register 106 - 117 should be the Voltage, Current and Power for each of the three phases.
My Setup uses the single phase Eastron SDM230 you should have an equivalent three phase version.

Yes I am using your file. I have a Eastron SDM630 for three phase. I don’t know if register 106-117 is the actual Eastron measurement. In the attached picture I put the owen on to compare. On Solax they are all the same but on the Eastron shows the load to the actual phases.

Some more question :slight_smile:

  1. Is it possible to add the “feed in” work mode. I only see the backup and force mode in the file. In sweden there are days with very high energy prices when I would like to sell as much as possible in day time and load in force mode in the night.

  2. In the below thread it’s discussed about “Couldn’t there be an issue with wear flash/eeprom cycles?” How is your solution implemented? Risk for this with a lot of changes or just software changes?

  3. I looked into the file SolaxModbus.py on the link and some values isn’t the same as in your .yaml file. Are there other modbus adresses for our values? (for example feed in energy (48->72), consumed energy, measured power…)
    https://github.com/InfernoEmbedded/PowerScraper/tree/master/Inputs

  4. I think I found the answer to my question about the phase load in the smart energy meter. It is not possible according to this page where you also are active:
    https://community.openenergymonitor.org/t/solution-reading-solax-sk-su5000-e-inverters-sdm630v2-modbus-power-meters/8214/92

1, Off top of my head you will want the following:

  - alias: Solax Feed In
    trigger:
      platform: state
      entity_id: input_boolean.solax_feed_in
      to: 'on'
    action:
    - service: modbus.write_register # Feed In Mode
      data_template:
        hub: SolaX
        unit: '255'
        address: '31'
        value: '3'

2,3 The inverter he is using is quite a bit older than ours. So some values and control methods no longer work.

He is also working in Hex, compared to the Decimal I am using.

1 Like

Thanks! @wills106

I have tried the automations but can’t change the work mode on the inverter. I have tried both force mode and feed in but nothing happens. Do I need to change anything more?

Also tried to change the discharge/charge rate and minimum battery power. No change on the inverter display when I change the values in Home assistant.

For grid charging have you follwed SolaX Inverter by Modbus (No Pocket WiFi) (Post 45)

Not yet since I just want to see that everything works. Seems like I can’t change any values at all from home assistant.

Another thing I noticed is that when I try to change settings remote in the solax cloud I always get time out. Maybe I have something wrong in my installation…

edit: Somehow I solved it :slight_smile: I put in the wifi dongle also to check the grid charging status. It was already activated. I left the wifi dongle in and tried to activate feed in mode and now it works. Haven’t changed anything else…

It might be coincidence with the Portal playing up. I have noticed over the past couple of days it timing out quite a bit when I wanted to check something.

Joys of cloud based portals!

Also “Force Grid Charge” wont work if your battery is almost full.

Ok.

Yesterday I found a new problem. I tried to save som battery for monday morning and put the battery on 40%. Later that night I changed to 30% but then the inverter was already in “Idle”. I could not wake it. I tried to change values and work mode but nothing happened. Not even when I logged in locally on the inverter and changed to Force mode. It started again on the morning when the sun rose.

Try reducing how often the ModBus sensors get checked.

Ie increase:
scan_interval: 1
to say 5 or even 10 (seconds)

The problem with the current method of using the inbuilt ModBus setup in Home Assistant. Every value gets read independently, so all the extra 3 Phase sensors are probably overwhelming it a bit.

That’s another reason I want to turn this into a proper component when I get chance. Instead of reading Register 0 and then read Register 1 and then read Register 2 etc. I can read register 0 and x registers after in a single block.

Something like:
read_input_registers(unit=unit, address=0, count=38)

Ok, I will try that.

Why would the time between readings affect the possibility to wake it? Is it to busy sending values?

Sorry for asking so many questions :slight_smile: I appreciate your work and are curious to learn more!

I don’t know 100% but it does seem like the extra traffic prevents it from responding.
That’s why I add a delay and resend some commands. As it doesn’t always pickup the command.


  - alias: Solax ForceTime
    trigger:
      platform: state
      entity_id: input_boolean.solax_forcetime
      to: 'on'
    action:
    - service: modbus.write_register # Force Time Mode
      data_template:
        hub: SolaX
        unit: '255'
        address: '31'
        value: '1'
    - delay: '00:00:01'
    - service: modbus.write_register # 2nd Force Time Mode incase Inverter missed first
      data_template:
        hub: SolaX
        unit: '255'
        address: '31'
        value: '1'

Hopefully I will get more time over the next few months to learn python enough to turn it into a proper component.

1 Like

@fandersson I hope you don’t mind me asking, but what country are you from? I don’t want region specifics. I am just interested in what countries that use 3 Phase power for Solar Installations.

I know Australia is one country that has 3 Phase supply to homes and it also used with Solar Setups. I think Sweden is possibly another?

In the UK most homes only have Single Phase, possibly the only time a house would have access to 3 Phase would be the likes of Farm Houses possibly?

No problem. I will gladly help you if there is anything I can do. You are correct :slight_smile: I live in Sweden and everyone uses three phases here.

2 Likes

Thank you @wills106 for your good work.

I have a SOLAX X1 Hibrid G3. that I have tried to integrate into the HA with no success. So, after seeing your topic I removed the pocket wifi and connected an ethernet cable to the inverter. I pasted your code into my configuration.yaml and it is still not functional. Do you have any idea if something is missing me?
Thanks a lot for the help.