I recently had a solar setup installed at home, including a Solis 5G inverter and it includes the remote monitoring stick that seems to be common with these.
Obviously I wanted to log the data from the inverter myself, I know it produces plenty of juicy information, and the Solis Cloud is… well it has good information but the 6 mins refresh time just doesn’t do it for me, I wanted the kind of resolution that I am used to from my eMonPi setup.
This lead me down a few interesting rabbit holes (I am sure the same has been true for many of you with Solis / Ginlong devices / sticks etc etc…)
The options most people seem to go for, are replace the stick with a new RS-485 adapter or to just use the normal one and put up with the 6 min resolution.
After a whole lot of poking at the stick, and trying (and failing) to work out how it works, I found some excellent work by another GitHub user J McCrohan who wrote a Python3 tool “pysolarmanv5” that actually speaks the weird wrapped modbus, superb!
With that in hand, I bashed up a quick python script of my own to read the data I want and put it to eMonPi’s MQTT instance - and hey presto, much improved data resolution!
Hi Andy
I am grateful for your contribution and have installed the code on a rpi other than my emonpi. I’ve set the mqtt address accordingly and also populated the MODBUS server with the appropriate data.
I find that on running solis2mqtt.py with debug=1 I get the following:
INFO:root:Connecting to MQTT Server
INFO:root:Connected to MQTT 192.168.0.112:1883
INFO:root:Reading MODBUS
SENT: a5 17 00 10 45 00 00 09 15 08 72 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 04 81 73 00 01 e8 2d 15 15
ERROR:root:Unable to read data from MODBUS
I am able to read the Modbus adapter with a modbus simulator, albeit with some errors.
Could you suggest anything to allow me to debug what’s failing?
Reading back over this, sounds like you COULD talk to the stick, but with some errors already, so it’s possible that your stick is different enough that its not using the SolarManV5 protocol, or that your inverter is different enough to use different registers - assuming the port number you used with your modbus test was the same one used in the python script?
Well there are differences with the f/w as the config info is at the http root. The default port was set to 30003 that gave the same result that I’m currently seeing so I changed it to match your example of 8899, just in case there was something internal in the SolarManV5 module.
Does your stick have the hidden config page at all?
The serial number I use is the device serial number (stick) and not the inverter serial number at the top.
For me - the MODBUS port is only settable in the hidden settings page, its not shown anywhere in the main config, as you can see, the remote servers are also not available to be set either (although they are in the hidden config).
What other protocol types are there, my script does not work with ModBus/TCP (that actually should be easier to work with if you want to roll your own).
My stick uses the Solarmanv5 protocol (it may not be called that in the drop-down).
I’ve disconnected the stick as I’m connecting directly to the RS485 port instead and reading register values so that’s progress. I’ll swap back to the stick later and post the options it offers for protocol.
Yep seen that, but I wanted to retain the cloud connection, and sure I can piggyback the RS-485 connection, but where is the fun in that, when I can just talk to the stick