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

I have to fix the statistics for the total yield sensor, since it had a meter reset due to it dropping to 0.
But it’s not that hard to fix when the inverter is sleeping :wink:

UPDATE "statistics_short_term"
SET state = 3583.2, sum = 1613.2
WHERE metadata_id = 77
AND start > "2022-12-10 14:35:00.000000";

UPDATE "statistics"
SET state = 3583.2, sum = 1613.2
WHERE metadata_id = 77
AND start > "2022-12-10 14:00:00.000000";

The rename was a little inconvenient indeed, some automations, template sensors and dashboards broke. But I already changed those to the new name.

It’s always tricky trying to harmonise names, especially with the SolaX ones. As some of them are 3 years old now from when I started the “packaged” version before the Integration.
Some of the names aren’t ideal as they were before I fully understood what some of the sensors / entities actually are.

Hi there. I’ve been using the work from @wills106 for a long time now (ever since the manual yaml package).
After upgrading home assistant to 2022.12 (was using still 2022.05) I tried to update to the last version of the solax custom component (I was using a very old 0.3.3), but I can’t manage to put it to work.

I tried both the manual installation and via HACS (and did a lot of home assistant restarting just in case).
I always get the following:
unrecognized inverter type - serial number : unknown
13:01:42 – (ERROR) SolaX Inverter Modbus (custom integration)
SolaX: cannot find serial number, even not for MIC
13:01:42 – (ERROR) SolaX Inverter Modbus (custom integration)
SolaX: reading serial number from address 0x300 failed; other address may succeed
13:01:42 – (WARNING) SolaX Inverter Modbus (custom integration)
SolaX: reading serial number from address 0x0 failed; other address may succeed
13:01:42 – (WARNING) SolaX Inverter Modbus (custom integration)

I have a Gen3 Hybrid (including a battery). Version 0.3.3 keeps working fine in home assistant 2022.12.

Any hints?

EDIT: IP connection via ethernet

@smdx Did you completely remove the old integration before installing the new version ?

What I did:
Remove integration (old version) → reboot HA → remove files → reboot HA → add new files (either by HACS or manually) → reboot HA → add integration

When returned to the old version, HA was able to show me the history of the previous sensors, some data remained even after removing the integration.

As of 2022.12.8 and Home Assistant 2022.12.7 (maybe also an older version I’m not sure) most of the readings show “Unknown” and in the log there’s the following error after restarting Home Assistant:

SolaX error reading holding registers at device 1 position 0x206

It only shows up once, but after that there is also a longer entry that keeps occuring:

Something went wrong reading from modbus

Traceback (most recent call last):
  File "/config/custom_components/solax_modbus/__init__.py", line 320, in read_modbus_data
    res = self.read_modbus_registers_all()
  File "/config/custom_components/solax_modbus/__init__.py", line 397, in read_modbus_registers_all
    self.data[descr.key] = descr.value_function(0, descr, self.data )
  File "/config/custom_components/solax_modbus/const.py", line 182, in value_function_grid_import
    val = datadict["measured_power"]
KeyError: 'measured_power'

This is with a Gen3 X3-Hybrid (Serial: H3UE).

What version were you on previously?

I’m not sure, some other 2022.12.x version but I don’t remember if it was 2022.12.7 or 2022.12.6.

Is to do with extra BMS information. How many batteries do you have on your system?

I’m not sure why you are getting that. That’s you grid power. Unless you had a glitch from your Modbus Power Meter / CT clamp?

Just one battery and I’m getting readings from the grid on the inverter as usual (at least I guess so, there are values displayed that change and make sense so I think everything is normal).

The grid values are from a smartmeter that is connected via a cable to the inverter over RS485 by the way.

If you look as the second post there are a few more links to the same issue.

Thanks, went back to 2022.12.6 and now the values are showing up again.

1 Like

Can I just confirm you are using the built in ethernet on your Gen3 and not trying to connect via Pocket WiFi

Yes I am using the built in ethernet :slight_smile:

I just updated from 2022.12.8 to 2022.12.12, and that broke my total_yield (and the voltage and frequency entities) again.

They are showing 0 again when the inverter is Waiting. So I downgraded and fixed my statistics database (again)…

Sorry, Side effect of another correction. I will fix it very soon…

1 Like

Just released 2022.12.13

1 Like

Hello,

Thanks for your integration.

With a Solis hybrid everything works fine but someday I have incorrect values in energy dashboard.

I guess it is because I experience minor disconnection where Power Generation Total goes to 0 instead of unkown… so when value gets back energy dashboard sums it up. Any idea how to fix ?

I have also this error popping

Logger: custom_components.solax_modbus
Source: /config/custom_components/solax_modbus/__init__.py:417
Integration: SolaX Inverter Modbus
First occurred: 17:10:10 (1 occurrences)
Last logged: 17:10:10
RHI error reading holding registers at device 1 position 0xa86c

NoneType: None

Hi William / Jan,
I am still running ver c4dbf15 under HA Core 2022 12 6. and all is well. Given some of the recent discussion, I’m a little nervous of uninstalling the integration and moving to 2022 12 13.
As most (not all) of the development now centres around adding further inverters, is the attempt to make this a ‘universal’ Integration still the best choice given the risks of breaking things that ‘ain’t broke’?
btw: still not solved the Eastron SDM230 issue. SolaX China have told me that my meter is certainly not compatible, despite the assurances of the seller. SolaX UK claim that there should be a Solax logo on the side of the meter if it’s official…is that your experience?

The only issue recently in regard to SolaX is the behaviour of the X3 MIC and Inverters missing registers. Possibly due to them being on old Firmware versions.

If something becomes an issue with say the Sofar or Solis Inverters it shouldn’t greatly affect SolaX Inverters as it’s a separate plugin.

I can’t see one on my Eastron, but it depends when they introduced that logo?