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
I know very old thread but just looking into trying to get data from my Solis Inverter with the Solis Ethernet data logger using Python & no Home Assistant.
Wondered if @bonzo101 had any luck as think I have the same setup.
I have HA working well using the Modbus registers & yaml stuff (cannot remeber exactly how now) but can read everything & even write to battery start time etc.
However need/prefer python to get solar forecasts & then adjust start time to if going to be sunny next day etc. Works OK’ish but python via HA (which is on a Synology NAS) not easy to debug if an update or something messes with it & the data has to move between python & HA.
Any would like to use just python on a PC to write the start times.
Tried Andy Taylor code (Many thanks) but get the same error, unable to read Modbus.
Have correct IP & Serial (used in HA also so know that works) but pysolarmanv5 just not do any more.
Took out all the MQTT & just read the first Battery SOC, print (“here”) before & (“after”) & does not get to “after”
registers are the same numbers.
I am guess pysolarmanv5 does not work with the ethernet dongle although surprised as all the talk early on was the wifi dongle did not play nice with the modbus & HAS integration & the ethernet was the one to have.
To start just want to make sure I can read before I try to start writing registers.
When its working is it pretty much live info. in HA. I have the solar charge/use/battery gauges and update every few seconds so will continue to use for data display.
I was thinking it had to be a SolarMan oem dongle?