Solution: Reading Solax SK-SU5000(E) inverters & SDM630V2 Modbus Power Meters

I just had a quick flick through your config - the inverter is reaching the cloud through the Wifi interface.

I now have full battery control on the X1 Hybrid Gen3 Inverters. Should also work on the X3 as I have found the extra 3 Phase registers.

https://github.com/wills106/homeassistant-config/blob/master/packages/solax_hybrid_g3.yaml

Full description on my Home-Assistant Post SolaX Inverter by Modbus (No Pocket WiFi) ( now a custom_component ) - #45 by wills106 - Share your Projects! - Home Assistant Community

I m just on a Normal Fixed Tariff ( USwitch Octopus 12M Fixed )
I have yet to look into any of the emon stuff yet. As I wanted to wait till I got battery control working, which I have now.

If you are using emonCMS, install the ‘App’ and do a comparison. I have no PV/Battery etc and my effective rate for the last 4 months would have been 10p/kWh as opposed to the 14p I am paying.

I did install emonCMS on a PI4 when trying the original Power Scraper on this thread.

I will look at installing the Docker version on my main server tonight save having the PI powered on.

I have started reading through the Octopus Agile emoncms thread.

2 posts were split to a new topic: Battery appears not to be charging

How I can read values from SMD630V2 smart meter when it is connected directly via Modbus wires to Solax X3 Hybrid inverter? I can easily read values from the inverter via the Modbus TCP connection. I’m using Loxone Miniserver with the Modbus server instance. This is not a problem, register numbers converted from hex to decimal are working. But I don’t understand how I can read values from SMD630V2 smart meter via inverter over Modbus TCP connection.

That’s because the 630 uses Modbus RTU which is raw serial data. i.e. it’s not encapsulated
in a TCP frame like Modbus TCP.

In fact, that’s essentially what Modbus TCP is. i.e. a Modbus RTU packet in a TCP frame.
A Modbus RTU to Modbus TCP gateway attached to the 630 should enable you to poll the 630 from your Modbus TCP connection.

Eastron_SDM630Modbus_V2_user_manual_2016_V1_3.pdf (1.7 MB)

https://www.ebay.com/itm/USR-K7-Industrial-Super-Port-UART-Ethernet-Module-Modbus-RTU-to-TCP-IP-Module/274441506664?hash=item3fe5fd0f68%3Ag%3AFHgAAOSwrTBfH8ux&LH_BIN=1

The SDM630v2 is not supported directly by the Solax inverters. It needs to be connected via RS485 to the machine running the scraper.

Hi @Pukka,
how did you get Solax running with node-red? May be could you share a flow?

Sam

I dont have the orignal node-red stuff as I moved over to this config a few years ago. If I remember correctly you just add the node red modbus and then you can read the registers.
Paul

I have just updated to the latest code and I am getting an error when trying to launch the program

sudo ./power_scraper.py
:0: UserWarning: You do not have a working installation of the service_identity module: 'cannot import name 'verify_ip_address' from 'service_identity.pyopenssl' (/usr/lib/python3/dist-packages/service_identity/pyopenssl.py)'.  Please install it from <https://pypi.python.org/pypi/service_identity> and make sure all of its dependencies are satisfied.  Without the service_identity module, Twisted can perform only rudimentary TLS client hostname verification.  Many valid certificate/hostname mappings may be rejected.
Setting up EmonCMS
not connected
not connected
err [Failure instance: Traceback: <class 'KeyError'>: 'max-power'
/usr/local/lib/python3.7/dist-packages/pymodbus/framer/socket_framer.py:181:_process
/usr/local/lib/python3.7/dist-packages/pymodbus/client/asynchronous/twisted/__init__.py:126:_handleResponse
/usr/local/lib/python3.7/dist-packages/twisted/internet/defer.py:460:callback
/usr/local/lib/python3.7/dist-packages/twisted/internet/defer.py:568:_startRunCallbacks
--- <exception caught here> ---
/usr/local/lib/python3.7/dist-packages/twisted/internet/defer.py:654:_runCallbacks
/home/pi/PowerScraper/Inputs/SolaxModbus.py:198:solaxRegisterCallback
./power_scraper.py:58:outputActions
/home/pi/PowerScraper/Outputs/SolaxBatteryControl.py:135:send
/home/pi/PowerScraper/Outputs/SolaxBatteryControl.py:62:setInverterPower
]
err [Failure instance: Traceback: <class 'KeyError'>: 'max-power'
/usr/local/lib/python3.7/dist-packages/pymodbus/framer/socket_framer.py:181:_process
/usr/local/lib/python3.7/dist-packages/pymodbus/client/asynchronous/twisted/__init__.py:126:_handleResponse
/usr/local/lib/python3.7/dist-packages/twisted/internet/defer.py:460:callback
/usr/local/lib/python3.7/dist-packages/twisted/internet/defer.py:568:_startRunCallbacks
--- <exception caught here> ---
/usr/local/lib/python3.7/dist-packages/twisted/internet/defer.py:654:_runCallbacks
/home/pi/PowerScraper/Inputs/SolaxModbus.py:198:solaxRegisterCallback
./power_scraper.py:58:outputActions
/home/pi/PowerScraper/Outputs/SolaxBatteryControl.py:135:send
/home/pi/PowerScraper/Outputs/SolaxBatteryControl.py:62:setInverterPower
]
^CShutdown

Fixed text formattting - BT, Moderator

Whoops, I forgot to add that to the sample config. Add a max-power = 5000 to you inverter definitions. I’ll update the sample config now.

Just a heads up, I had 2 of my inverters fail recently with “Inv EEPROM fault”. Solax didn’t have replacements or engineers, so they sent me 2 of the new X1 hybrids + approximately equivalent hybrid batteries to replace my LG Chems which were not compatible (48V vs high voltage for the new inverters).

The latest patches reduce the number of writes to EEPROM to try and avoid this.

If you do get the fault, Solax will tell you to update the firmware on the inverter. This failed on both of mine, and bricked the units, which is why they replaced them.

If they do send out new hardware, great, if not, this is how I was able to repair my failed units:

Bad manager flash

  • Shut down the inverter & remove the cover
  • Remove the manager board, it’s the bottom one with the ethernet ports on it
  • Use an SWD programmer with ST-Util to flash the firmware manually. The SWD programmer should be connected to the JTAG port next to the display connector.

Bad Master Inverter Flash

  • Remove the inverter control board directly above the manager board.
  • There are 2 JTAG ports in the lower left. The horizontal one is for the slave controller (you don’t need to touch this), and the vertical one is for the master.
  • Connect an XDS100V2 or V3 programmer (cheap clones available from China) to the master port, and flash the inverter master firmware.

Fix INV EEPROM fault

  • You should be confident with SMD soldering to attempt this
  • Remove the inverter control board directly above the manager board.
  • Remove the failed EEPROM chip U1 next to the JTAG connectors
  • Replace it with a new Atmel AT24C08C chip
  • Reinstall the board & bring the inverter up
  • Reset Manager EEROM & Inverter EEROM in the settings
  • Restart the inverter

This should allow you to bring the inverter back online in the event of a failure.

Shipping from China can be slow, so I would recommend ordering a few cheap pieces in advance & keeping them aside in case something bad does happen:
https://www.aliexpress.com/item/32719963657.html

Thats sorted it :slight_smile:

Did you try and flash the inverter without switching it off? :wink:

If the inverter was working and now getting “Inv EEPROM fault” can you just replace the Atmel AT24C08C without needing to reflash the boards?

Paul

next error :frowning:

sudo ./power_scraper.py
:0: UserWarning: You do not have a working installation of the service_identity module: ‘cannot import name ‘verify_ip_address’ from ‘service_identity.pyopenssl’ (/usr/lib/python3/dist-packages/service_identity/pyopenssl.py)’. Please install it from https://pypi.python.org/pypi/service_identity and make sure all of its dependencies are satisfied. Without the service_identity module, Twisted can perform only rudimentary TLS client hostname verification. Many valid certificate/hostname mappings may be rejected.
Setting up EmonCMS
not connected
not connected
err [Failure instance: Traceback: <class ‘KeyError’>: ‘linked-batteries’
/usr/local/lib/python3.7/dist-packages/pymodbus/framer/socket_framer.py:181:_process
/usr/local/lib/python3.7/dist-packages/pymodbus/client/asynchronous/twisted/init.py:126:_handleResponse
/usr/local/lib/python3.7/dist-packages/twisted/internet/defer.py:460:callback
/usr/local/lib/python3.7/dist-packages/twisted/internet/defer.py:568:_startRunCallbacks
— —
/usr/local/lib/python3.7/dist-packages/twisted/internet/defer.py:654:_runCallbacks
/home/pi/PowerScraper/Inputs/SolaxModbus.py:198:solaxRegisterCallback
./power_scraper.py:58:outputActions
/home/pi/PowerScraper/Outputs/SolaxBatteryControl.py:209:send

Nope, it happened on all 3 machines. They were all running Manager 2.27 - so maybe it was a firmware bug? They did reflash properly over the network once upgraded to 2.31.

If the inverter is working, and getting “Inv EEPROM Fault”, you can follow the procedure I outlined to get the machine back online without having to reflash it.

I did notice that in the previous set of firmware, the inverter mis-reported “Inverter Power” when charging the batteries from the grid, reporting twice as much power draw than it should have. This is fixed in the latest set of firmware.

Hmm, you’re missing linked-batteries from the config, it should be in the sample.

I have listed in the config

[Solax-BatteryControl]
#source = “MainsMeter” # The data source for power consumption
linked-batteries = true # If set, all batteries charge/discharge at the same rate when trying to zero total power
timezone = “AEDT-10” # If set, always use this timezone for period calculations. This may be useful if your machine tracks daylight savings, but your energy provider does not