Communication with Solis inverter

Hi, I’ve got a Solis inverter from Ginlong. On my iPhone I have an app called Solis Home where I can check the status. Should it be possible to connect with HA?

If something you want to connect is not listed here: Integrations - Home Assistant then use Google search to see if someone has written a third party integration, (search words: home assistant solis).

If that fails then you need to search the manufacturer’s literature to see if an API (application programming interface) is available, e.g. restful, mqtt, etc

EDIT: also this was just posted, seems you can connect using the modbus integration:

You might also want to check out this
Solar PV intregration - Configuration - Home Assistant Community (home-assistant.io)

They are not using direct Modbus but scraping the web GUI for details.

275 / 5.000

Hello everyone, I am new to HA and come from Domoticz. Because I also want my Solis inverter visible in HA, I came to this thread. Now there is a good working script for domoticz based on python and I thought I’d share it here and maybe you can do something with it.

#!/usr/bin/python
import requests
import urllib, urllib2
import json

#config
username 			= '[email protected]'				#your username to log on to m.ginlong.com
password 			= 'P@ssw0rd!'				#your password to log on to m.ginlong.com
domain 				= 'm.ginlong.com' 			#webportal to read
plantId 			= '965529' 					#plant id (can be found on m.ginlong.com page information)
lan 				= '2' 						#language (2 = English)

#domoticz settings
domoticz_host      		= 'domoticzuser:[email protected]'				#Username/password and IP of Domoticz
domoticz_port      		= '8080'				#Port to connect to Domoticz
domoticz_url       		= 'json.htm'			#URL to post stats to Domoticz, does not require changes normally
domoticz_device_idx    		= '486'			#IDX of Watt meter in Domoticz
domoticz_device_onoff_idx   	= '485'			#IDX of on/off switch (to see whether its on or off for PV)

# Create session for requests
session = requests.session()

#building url
url = 'http://'+domain+'/cpro/login/validateLogin.json'
params = {
    "userName": username,
    "password": password,
    "lan": lan,		
    "domain": domain,
    "userType": "C"
}

#login call
resultData = session.post(url, params=params)
resultJson = resultData.json()
if resultJson['result'].get('isAccept') == 1:
    print("Login Succesful!")
else:
    print("Login Failed!!")
    Exit()

# Get plant details
url = 'http://m.ginlong.com/cpro/epc/plantview/view/doPlantList.json'

cookies = {'language': lan}
resultData = session.get(url, cookies=cookies)
resultJson = resultData.json()

# Uncomment lines below to write the exported json-file to the location noted
#out_file = open("/usr/local/bin/ZPExport.json", "w")
#json.dump(resultJson, out_file, indent = 6)
#out_file.close()

ActualPower = resultJson['result']['pagination']['data'][0].get('curPower')
ActualPowerNoSep = str(ActualPower).split(".")[0]
etoday = resultJson['result']['pagination']['data'][0].get('energyToday')
multiply='1000.0'
etotal1000 = float(etoday) * float(multiply)
etotalstr=str(etotal1000)
etotalstrNoSep = str(etotalstr).split(".")[0]
OnOrOff = resultJson['result']['pagination']['data'][0].get('status')

#logging values
print 'ActualPower: ' + str(ActualPowerNoSep)
print 'etoday: ' + str(etotalstrNoSep)
print 'Status: ' + str(OnOrOff)

#uploading values to domoticz
url = ("http://" + domoticz_host + ":" + domoticz_port + "/" + domoticz_url+ "?type=command&param=udevice&idx=" + domoticz_device_idx+ "&nvalue=0&svalue=" + str(ActualPowerNoSep))
urlonoff = ("http://" + domoticz_host + ":" + domoticz_port + "/" + domoticz_url+ "?type=command&param=udevice&idx=" + domoticz_device_onoff_idx+ "&nvalue=" + str(OnOrOff))
urllib.urlopen(url)
urllib.urlopen(urlonoff)
1 Like

I’ve done quite a bit with Solis inverters at work. We normally use modbus to directly communicate with the inverter. As such it should be pretty simple to knock together a ESP home integration that exposes all of the relevant information and settings. We can even set the inverter to change state from charge to discharge mode etc. The main issue with the web portal was the low sampling rate, and there was an issue with alerts coming from the device to the portal, but I understand this might have been solved now.

1 Like

If you’re looking to connect esphome to a solis inverter, I’ve just finished getting this working with an external component for my system (inverter is a ginlong solis S5 3phase).

For now, I’ve piggybacked and esphome device onto the existing wifi stick (as I still want this data to go to the solis cloud for my installer’s warranty support).

The esphome device listens in on the COM port to the messages already sent between the inverter and solis wifi stick, interprets the data and populates sensors for home assistant.

All you need is an esp (nodemcu or similar), a cheap rs485-ttl converter module (ebay/aliexpress they’re about $2). It fits in the existing wifi stick case (lots of spare room).

If anyone is willing to try this out on their own system, and find there’s a subtle difference in the protocol, or you want a standalone version (i.e. one that doesn’t need the existing wifi stick still attached) please feel free to raise an issue on the github and I’ll be happy to look into extending it (with your help to test & confirm).

github.com/grob6000/esphome-externalcomponents/

3 Likes

I have 3 different Solis Inverters in use all with wifi dongles attached so this is of great interest to me.
Any chance you could post a few photographs of the assembled parts?
Could a NodeMCU board such as this be used in place of the D1 mini

And is this correct

Do you think it would work flashed with Tasmota instead of ESPHome as I already have lots of other items using Tasmota

I’ve used the second board you posted successfully to connect to Solis inverter. I can actually supply the correct plugs and modbus tables too if there is a need for them. Send me a DM if interested.

Sorry Robert I’m not quite grasping what you mean, modbus tables is something I’ve not been involved with but I have flashed several NodeMCU boards with Tasmota to use as sensors
Do you think the 2 items I’ve put links to above connected together as per you Github drawing would work with the solis wifi dongle
A photo of your completed unit showing to soldered / connected wires would be a great help

You don’t need the wifi module. You connect directly to the inverter and bypass the wifi module. you can use an RS485 to TTL converter, connected to an ESP32 dev board, and then ESPHome to get the data over modbus. I have a YAML file that will get you started with that. It’s actually pretty simple to do.

1 Like

Sounds cool! If you don’t want the stick, as you suggest the modbus route is probably the easiest option.

I do believe what’s going on for me is slightly different: (a) I noticed the inverter was not communicating using modbus with the wifi stick (as per a few concepts I’ve seen on the net), so was not sure whether this was going to work with my inverter (maybe it’s changed with the S5) - so figured I’d give reverse-engineering a go, and (b) I have a reason to keep the wifi stick running in parallel.

Robert - have you considered publishing your yaml config for the modbus connection on github or similar so we can have a look?

Hello! Those two look ideal.

  • Any node-mcy/wemos board should do (smaller the better though). The only requirement is it must accept 5V input (anything with a usb on it should).
  • The TTL RS-485 converter you’ve shown there is perfect; same one I used.
1 Like

I’d really like to go down this avenue but I also really don’t want to loose the official Solis Cloud feature, has anyone achieved both without it being overly complex

Hi, I did write a scraper that would pull the data from the solis cloud into your software, but this was a few years ago and might not work anymore. Might be another way to achieve what you want. We had some issues with the way the solis cloud did the alerting which meant we had to look at other custom solutions, but again, this might be fixed now.

1 Like

The solis wifi stick hardwares & firmwares vary so much that it seems impossible to get 1 system working for all. Across mine & my parents systems we have 4 different solis inverters and 3 different solis sticks (all wifi)
All upload to the solis cloud ok
The oldest stick (1 of mine) is not working with the http://xxx.xxx.xxx/status.html web scrape method
My newest 2 (only bought about 4 months ago) are working using that method
My parents 1 (bought about 2 months ago and looks identical to my newer 2) is not working and has a much more limited web interface
All very strange & annoying!!

If I recall there is an option on the wifi stick to also supply another endpoint for it to send the data too. I never got this working on my system, but perhaps with a little perseverance, that could work. You would then just need to set up a local endpoint to receive the data from the data stick.

Hi Robert & Co

It sounds like you have had good success and experience in directly connecting to Solis inverters via 485 Modbus. I’ve had success connecting an Arduino to a Solis G4 Mini to broadcast values on 433mhz to remote displays or to Ubidots MQTT etc.

However! Now after just upgrading to a Solis S6-GR1P3.6k-M I am having zero luck interrogating Modbus I get no responses. I’m using same cable / connector, gone back to basics using a USB to 485 adapter and ‘Modbus Poll’ app. I send 04 function commands to read registers (in 30nn range) and get nothing - just a time out - absolutely no reply from the S6…I move connector to my G4, it works perfect! It seems i’m not the only one having a problem. (tried swapping A-B, differnt bauds etc)

Have you or anyone managed to successfully connect to a Solis S6 via 485 Modbus? Any ideas why it doesn’t respond?
Cheers Steve

check the slave address is in settings on the inverter?

Address in all devices etc is set to 01 …and tried others.

I still haven’t managed to get a response from this new S6 ! Its driving me nuts as the 4G is working fine with the same interrogation set-up.

Either my brand new S6 has a fault, OR there is some quirk like this which showed the need for pull up /down resistors, OR my USB- 485 signals are marginal (maybe that’s why those resistors had an effect), OR i’m doing something really stupid - all are possibilities.

In desperation today I’ve ordered a wifi stick to simply prove the comms port works!.

I have been using the blue USB-485 adapter in the photo but i have to say its output signals look pretty poor & noisy on a scope - (although it does work happily on my Solis 4G mini!) i’ve also tried my arduino setup with a MAX485 which has cleaner signals. Still Nothing!!

I’ve also ordered the black adaptor to try plus the module board which I can drive from an FTDI USB-UART device.

I’ve never seen a Register assignment list which specifically mentions a Solis S6 or any online evidence of anyone connecting to an S6. I’ve been mainly trying to use function 04 reads on addresses in the 3000 upwards range. Is this correct? Could the S6 use completely different addressing ? if the address is wrong I thought it should throw and error response.

I’ve also tried 33000 upwards as i’ve seen that mentioned.

I think my next step is to see what the WIFI stick does when it arrives… unless someone spots that i’m being an idiot!

I’ve used one like the black on in the middle to connect to a 4g successfully. I have not tried a 6g. You can always contact their help department, they are quite useful if you can get through to the right person. One thing I would look for is compatibility between the solis dongles. I would think if the wifi dongle says it can be used on a 4g/5g/6g model then in theory (there could be some software detection), the comms are probably the same. If there are different dongles for different generations then you might be out of luck. The Wifi dongle used to allow you to set a second endpoint to also send the data to, to you might be able to use that technique.

I’m assuming you’ve seen this for the modbus info?