Solis Inverter Modbus integration

I have a working USR TCP232-410S adaptor connected between my Solis Hybrid Inverter and Home Assistant. This collects inverter data from the registers using Modbus over RS485, converted into Modbus over TCP.

Your adaptor is a different model, so I cannot provide you will all the details guaranteed to make it work, however the following information may help you move forward.

To make your arrangement work, you need to ensure the following:

  • Connect the adaptor to your local network, and using the web interface page, set the IP address to static, and enter an address (something that is not used by anything else on the network, and make a note). This is the IP address you will put into HA so HA can talk to your adaptor over the local network.

  • Go to the serial port setting page, and make sure your settings are correct for connection to the Solis Modbus (RS485) port

  • Baud rate 9600, data 8 bits, no parity, 1 stop bit

  • The local port number is the port that is exposed to the network, and USR devices default this to 23 which will be OK. If you want to keep to a standard, 502 is the usual port for Modbus, although you can usually safely use anything over 1000.

Once you have set the IP address and local port, you can use these in HA for host / port under modbus setup.

Now we need to ensure that the unit is in TPC server mode. A server (or slave) responds to requests from a client (or master). The Solis inverter is a slave/server, and your HA computer is a master/client. This means your HA will make a request (via the adaptor) and the inverter responds. The adaptor has two faces - the Ethernet side must in this situation pretend to be a server (faces the HA client), so it is set up as a TCP server. The serial side then acts like a client to the inverter, and no ‘ports’ are involved. The adaptor is just converting the physical carrier for the Modbus message, and looks like a plug-socket would in an extension lead.

[Only if the adaptor is set up as a TCP client do we need the remote server and port. In TCP server mode, the device listens to anything that connects to it (on the IP/port address). In TCP client mode however the device is doing the requesting and needs to know where the server is, hence the remote server IP /port address]

You should find that setting the operating mode to TCP server removes the need for remote port / remote server settings.

Now you need to ensure that the adaptor is connected correctly to the inverter Modbus port.

This should just be a pair of wires, connecting the Modbus A and B from the inverter RS485 port to the adaptor serial connection block (use the inverter comms port, not the meter port).

  • A must be connected to A, and B to B
  • Use twisted pair (network) cable. The earth is optional and for long cable runs. The standard uses blue and blue/white for A and B, another twisted pair (green) for the earth, earth connected only at one end (there is no earth on the inverter socket anyway).
  • Use a terminating resistor 120 ohms at the adaptor end. This must go between A and B. The interface will work without but you will get Modbus errors. RS485 requires a terminating resistor at each physical end of the bus, the inverter has this built in, the adaptor does not.

Note that you should not have anything else connected to the inverter. Running a Solis data logging stick as well as the adaptor will lead to issues as Modbus cannot support more than one master on the bus.

Register map.
Modbus is not forgiving, and requires exactly the right information otherwise no response will be issued.

  • the (register) address has to be valid
  • the read type (holding, input) must be correct for that register address

Different generations of Solis inverters have different register maps. The 5G (Hybrid) models have register maps as detailed elsewhere in this discussion. Earlier models have maps that can be found using Google. It is the ‘G’ that matters and not the kW power rating, and Hybrid models (with a DC battery) have additional quirks in the map to accommodate the battery and operating mode settings.

Good luck!

2 Likes

Thanks, comprehensive as usual!

I’m 99% right. I used a hacked up USB cable not CAT5, and I don’t have a resistor.

But apart from that I’m set up as you recommend.

From my reading rico365’s script should work for me.

So should madbobmcjims. Neither do.

Best go buy a resistor and have my friendly solderer warm his iron up.

Thanks so much

Tony

The resistor is not essential for short cable runs with only two devices, it just make things work better and stops erratic readings. I modified my wiring a couple of days ago and missed out the resistor at the adaptor end - result was Modbus errors at least once per hour. Resistor back and problems almost gone. With all the wiring and the inverter, there must be a lot of electrical noise.

I bouught this at eBay, Protoss PE11-H.
image
But I can’t get into the web page to set ut the device.
Can someone help me to get the IP adress to the device?
The device is not showing as in router as DHCP device, so I cant find it.

Please help.

There is a manual available via a google search.

Have you tried to find it? Have you factory reset the device?

Was it new or second hand? If second hand the IP address may have been set to work on a different address range to the one you are using.

If you have tried all of the above and its second hand it may be defective.

Best of luck with getting modbus to work if you aren’t able to get the ethernet to RS485 device to appear on your network.

I have taken a break from modbus and will be back on it soon.

Tony

Tony

If anyone is interested I have started to add in Solis registers into my custom_component there are only 33 sensors at the moment, but once it’s confirm it’s working I can add in the rest.

So far it will only recognise the Hybrid 5G version, assuming it works correctly.

Lesson leaned, and perhaps for others as ignorant as me.

RS485 isn’t necessarily modbus.

The USR adapter I bought talks RS485 but not modbus.

The price of non-conformance as they used to say back in the day.

However the serial to USB adapter I bought has been tested and does read modbus from the inverter.

Small steps.

Tony

Wills106 is the (wo)man!

SOLIS RHI-3.6K-48ES-5G 3.6KW HYBRID SOLAR INVERTER

Mostly working via serial in the UK with homeassistant-solax-modbus.

Let me add, that Will also made Solis RHI-3P10K-HVES-5G working quite well already by adding your model. :slight_smile: I use a Serial to RTH adapter. This is going to be good! :slight_smile:

Post deleted

I have a Solis Hybrid which i am able to control the “charge from grid” register to remotely turn on grid charging.
I also have a configuration.yaml code that figures out the cheapest 2/3/4/5 hour time slots from my Agile rates card. This returns a date/time formatted like this: “2022-11-21T22:30:00Z”

Can anyone help with a way to run a script when current time is within that 2/3/4/5 time slot?

Thanks

I’m running on a different track reading the Solis modbus registers using an Arduino which sends MQTT to my HA (GitHub - PhillyGilly/SolarisS6ArduinoMqtt: Solaris S6 RS485 modbus to Arduino to MQTT) and I am disappointed at the precision of the returned data e.g. active power returned to the nearest 20W. Are you getting better precision with your implementation?

1 Like

I have tried to do exactly this but could successfully get the setup.sh to install. I kept complaining it could find requirements.txt. I copy/pasted all the commands straight from GitHub.

I did this on a Raspberry Pi Zero W with the latest OS Lite flashed with Raspi Imager. Can I ask what version of the OS you used? As I’d like to get this nailed!

Cheers.

I have the same problem. Did you work out how to mitigate this clashing between adapters issue?

I gave this up as I can pull straight from my logger via modbus tcp, no adapter needed.
This way it sends to the cloud and I pull locally as well.
Using this: GitHub - jmccrohan/ha_pyscript_pysolarmanv5: A HA PyScript wrapper for pysolarmanv5
But you have to be lucky for your stick to be supported, not all of them are.

pysolarmanv5 is based on SolarmanV5 protocol which is something like Modbus RTU rather than Modbus TCP; however, it is supported by DLS-W datalogger, which I also have.

How do you get the wrapper feed into HA? Did you build anything to show on the dashboard?

You could also try this repo GitHub - StephanJoubert/home_assistant_solarman: Home Assistant component for Solarman collectors used with a variety of inverters.

Here is my setup after many attempts to connect multiple devices. It is still to be tuned, but the initial work is done. Happy to share more information if needed

I like this out of the box thinking - great solution

Are you then just point the native modbus/solax integration at it ?

Craig

Hi @craigcurtin yes that’s correct

It became a project since. You can check it at

@alienatedsec I’m not sure if I sold you a connector on eBay Exceedconn EC04681-2023-BF Male/Female for Solis/Ginlong Inverter RS-485 port | eBay but my price is now £14 for a m/f pair due to extra costs of shipping from China. Cheers