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

I have been busy working on moving over to reading multiple registers at once.
I am down to only 3 reads on the ModBus bus now, with added functionality.
I may add some more later depending on what else looks interesting.

Now you can see what mode your inverter is in, min / max battery charge values etc.

Sneak peak:

I am using temples to unpack the multiple registers.

2 Likes

Itā€™s possible the X1-Retrofit (or mine at least, from 2018) uses older software then. I can confirm that holding register 139 continues to indicate self use when switching if thereā€™s not been a recent authentication. Same issue when adjusting any of the charge/discharge/min charge parameters.

Iā€™ve had similar issues, when the inverter has been in Idle mode for too long, it becomes unresponsive to nearly all commands. Looking on the inverter itself, many of the menu items are missing when in this state and it reports a ā€œDSP-COMMS failureā€. It only wakes up when the inverter senses enough excess power to charge, thereā€™s a scheduled force-time use, or by activating ā€œBattery awakenā€ from the Advanced menu.

Iā€™ve not been able to determine a way to remotely wake it, so Iā€™ve implemented a simple workaround using a couple of automations to disable discharge a little above the min battery threshold, and re-enable it when itā€™s sufficiently charged above that point. This prevents entering Idle mode, Iā€™m assuming at the cost of some extra power drain that would normally be saved.

- id: '1604003579362'
  alias: Power down battery on low capacity
  description: ''
  trigger:
  - platform: numeric_state
    entity_id: sensor.solax_battery_capacity
    below: '14'
    for: 00:00:30
  condition:
  - condition: numeric_state
    entity_id: input_number.solax_battery_discharge
    above: '0'
  action:
  - service: input_number.set_value
    data:
      value: 0
    entity_id: input_number.solax_battery_discharge
  mode: single
- id: '1604004168651'
  alias: Power up battery on sufficient capacity
  description: ''
  trigger:
  - platform: numeric_state
    entity_id: sensor.solax_battery_capacity
    for: 00:03:00
    above: '14'
  condition:
  - condition: numeric_state
    entity_id: input_number.solax_battery_discharge
    below: '20'
  action:
  - service: input_number.set_value
    data:
      value: 20
    entity_id: input_number.solax_battery_discharge
  mode: single

@SteRN
@xavi104
Iā€™ll have another look to see if I can spot anything in the documentation that might help.

I have been busy moving everything over to reading multiple registers in a single transaction.
I am down to 2 Holding Register reads and 2 Input Register reads! This may increase as I find other values of interestā€¦
This obviously reduces the load on the ModBus bus by a significant amount!

Thatā€™s not every register showing, I only have a fraction of the EPS ones showing.
Still need to work on the extra write registers.

3 Likes

Hi!

I have the same problem. When the inverter goes to idle only the sunlight will wake it up :slight_smile: Doesnā€™t matter if I change charge, discharghe, battery min, force modeā€¦ etc.
When you put the discharge to 0 before battery min, wont the inverter go to idle? I donā€™t really understand the automation.

Not in my experience, it remains in Normal mode consistently over the past 10 days. Holding it above the limit keeps the system fully online, at the cost of some power drain by the inverter from the grid that hovers at 57-58W. Iā€™m not sure how that compares to idle mode.

Another side effect is when you do start charging, itā€™s immediately at full power, whereas I find the power ramps up slowly when the system reaches the minimum power and comes out of idle mode. Whether or not that is a good thing, Iā€™m not sure!

1 Like

Hi!

Hope your work is going well! Do you have some code that you can share? Really interested in speeding up my raspberry. It is pretty slow with all the readings for me.

/Fredrik

Have a look in my experimental folder https://github.com/wills106/homeassistant-config It wont work unless you make a custom_component of the above PR for ModBus though.
As the changes required to ModBus are not merged into Home Assistant yet though!

If you do use it bare in mind itā€™s WIP and I am planning on changing some names of the register groups.

I may also add and delete stuff as I finish it off, there is also Solcast forecasting code left over. So delete them sections if not using them.

I didnā€™t want to experiment with my main raspberry with all the automations so now I have bought one more :slight_smile:
I have made a custom component folder with your file from the experimental folder but how do I make a custom component to load of it? It should include the alternative modbus?
WIP?

solax_group_read.yaml
Goes in your packages folder.

In custom_components folder create another folder called modbus and copy all the files from the PR into that folder.

1 Like

Hm, maybe Iā€™m blind. Cant find the files you show. There is only four files in the experimental folder:
Radio-capitaluk
solax group read
solax test
turn pump on offā€¦

If you look at the earlier mentioned to PR (Pull Request) that @vzahradnik has worked on Improve custom datatype parsing in Modbus sensor and climate by vzahradnik Ā· Pull Request #42354 Ā· home-assistant/core Ā· GitHub

You will see a link to his proposed code upload.

After a bit of navigation you will find his code changes for the ModBus setup.
Copy them files into

Link to PR code changes https://github.com/JSC-electronics/home-assistant-core/tree/feature/modbus-custom-datatype-improvement/homeassistant/components/modbus

1 Like

Hi all, I have changed the configuration of my solax inverter throught the app. In the advanced menu, I have select ā€œMasterā€ in the ā€œParallel Settingā€ and Battery Awaken to ā€œNoā€. And now my system responds after been in Idle_mode when I change the mode to ā€œBackup_modeā€. I have to observe the behavier more time but I beleave this has solved my problem.
Hope it clould be useful for all.

Hi @xavi104,

Nice to hear there is progress! Got wills106 new group read to work a couple of days ago.
(Solved)
Now I have new problems. I have had problem with the batteries draining and charging from the net without my input (even with discharge 0A and charge 0A) I was asked by Solax to put in a new firmware version and now I cant write to modbus, only read :frowning: It just goes to ā€œunavailableā€ for some seconds and nothing changes. Have anyone seen that?
(Strange, now it is working againā€¦)

What firmware are you on? Anyone have some files of older to share?

I now have SkaĢˆrmavbild 2020-12-06 kl. 15.26.21

I havenā€™t received any files from SolaX. Do you just put them on a USB stick and it updates?

Have you seen any improvements since the update.

I received them from Solax in a mail, put them on a USB and put them in the inverter. I still have problem with battery percentage. I now think that it looks like the battery is draining but it doesnt in reality. Yesterday i stoped using the battery at 35%. Later in the evening the battery showed 12%. Tonight I charged it full again. With a known current and time it seems more like it charged the battery from 35% than 12%. So there is something with the variable battery charge that makes it slowly go down even when the battery is not used for some time. Especially when I have been using the battery a lot.

Now my installer has christmas vacation so I guess we will continue investigating next year.

Can someone give me a link to download the Modbus Map to achieve conecting one Solax A1 Hybrid inverter via Modbus TCP/RTU, please. Iā€™m using a WiFi pocked.

Thanks

You canā€™t get ModBus over Pocket Lan or Pocket WiFi.

You need to connect to your Inverter either by RS485 or Ethernet (Built in, not Pocket Lan) depending on your Inverter Model.

My inverter model is A1 Hybrid. It has a Built in Ethernet connection. Would you tell me where to find the Modbus Map for this or other Solax models, please.

I have been using wills106 solax package for a couple of weeks with great results.
Today I updated to the new release with modbus group read. Everything is running OK, except for the new solcast_post sensor which is throwing out two errors, and it is in unavailable state.

error1: https://pastebin.com/yYj7FE2J
error2: https://pastebin.com/EfpkV9tR

any hints?
Thanks

EDIT: homeassistant is updated to the latest stable versions (2012.12.1)

@smdx

You need a time date sensor in iso format.

sensor:
  - platform: time_date
    display_options:
      - 'date_time_iso'

I am also using the ā€œnormalā€ time else where so I am using:

sensor:
  - platform: time_date
    display_options:
      - 'time'
      - 'date_time_iso'

@ejberrio

I donā€™t have specific documentation for the USA A1-ESS so I donā€™t know how to read 3rd or 4th MPPT string but you should be able to get started.
Also I canā€™t verify if the battery control uses the same registers, so use at your own risk.

Either check the third post of this thread or check my profile for the link to my GitHub.

In the packages folder there is solax_x1_hybrid_g3_triplepower.yaml that lists most of the registers as individual register numbers.

Or look at solax_x1_hybrid_g3_group_read.yaml to see how to read multiple in one go.

Is that what you are referring to as a map?