Home Assistant & Inverter Integration video's

Hi Guys

I have put together some video’s for beginners to the Smart Home Scene on Inverter integrations that I thought some of you might be interested in.

First one is an introduction and some use cases for integrating them.

Then a guide playlist for users of the Solarman Dongle’s i.e. Older Sunsynk’s, DEYE & some Growat inverters I think.

and also a guide for users of the E-Linter/Sunsynk dongles - Sunsynk, Huawei, some Growatt, Sol-Ark, Goodwe, SMA & Alpha-Ess

Let me know what you guys think :slight_smile:

Awesome work, keep them coming.

Yes I like it. Already learned something I did not know, was not aware about the node-red software scraping the sunsynk website.

  1. I started off with the KellerZA plugin on a RaspPi connected with a USB-RS485 cable.
  2. Moved to Node-Red running off a Pi Zero with the same USB-RS485 cable as I did not want to have my Rasp Pi next to the inverter. Pi Zero connection not great either so moved to no 3
  3. I am now running an ESP32 with custom firmware and it is proving to be the most reliable method with no dropouts and been online for more than 3 weeks now.

A tip: get a microphone that can avoid the hollow sound

Thank you for the feedback guys, working on the Mic :slight_smile:

I am also on an ESP32, have been using it for more than 6 months now and very reliable apart from when I tried to position it in my inverter box and it went on strike :slight_smile:

Hi Everyone,

For those of you who are contemplating linking up your inverter to Home Assistant, I put out a video today of the process involved with setting up an ESP32. RS485 Module & home assistant.

It is a pretty cool integration as it allows you to change your “System Work Mode” battery settings from the Home Assistant Dashboard. I have another video planned for a new Dashboard for release early next week and after that a video to automate the changing of your battery settings based on the solar forecast fore the next day.

I have been trying to work out a way to maximise my battery usage whilst minimising the chance of getting stuck with flat batteries/ no sun & load shedding. An automation using the solar forecasting seems to be the best option, any other ideas are welcome :slight_smile:

I’ve considered doing something like this, changing the modbus interface of the Solis into a sunspec interface (it should not be too hard), but it was a fleeting idea that I’ll probably never have time for :slight_smile:

So @plonkster you might not actually need to change anything.

The Solis inverter also uses the SolarmanPV dongle and is listed as compatible on the website.

Have you seen the Solis Mobus Protocol document?
Am keen to try it out if you like, would be an interesting exercise.
Where about are you located?

RS485_MODBUS Communication Protocol_Solis Inverters.pdf (592.3 KB)

Found this Solis protocol document, I think that all you would need is the new addresses to query for the data.

Yup, I have that document, and I’ve managed to communicate with the PV-inverter. The Victron GX device can read it directly using a USB_modbus cable. The idea of using an ESP32 or ESP8266 to translate it into a sunspec device was an earlier idea that I’ve backburnered. I will probably never have time for that.

But IF you could make a device that easily changes other modbus protocols into sunspec… man would that be useful!

1 Like

A bit above my paygrade I am afraid Plonkster, definitely lacking the necessary skills for that :face_with_spiral_eyes:

That does sound interesting. I might be keen to build something like this.
I have not heard much about sunspec, so I am not sure what the advantages would be, and how it enables you to integrate different systems.

Thus far my efforts have been to translate everything from RS485 into home assistant and to let people use the data to create new applications to understand and control/integrate their inverters.
I see someone already built a sunspec integration for Home Assistant

I will add this to my list: as something to research.
Edit: Looked at the github repos… some haven’t been touched in 4 years. I think I will pass. Home assistant might not be any type of standard but I still think it is the future

SunSpec is a fairly old standard (in context), but it is also one that many Chinese companies don’t care for because it is considered to be American. That means that many of the more affordable PV inverters come with their own implementation, which may or may not be documented, and which makes it hard to integrate with other systems.

SunSpec usually runs on top of Modbus-TCP, but it doesn’t have to. It can also run on Modbus-RTU, or essentially anything else if you wanted to, but usually it is modbus. I haven’t seen anything else.

It has a standard starting register, which is 40000 (but there are a few alternatives). If you read two registers from 40000, you will always get 0x53 0x75 0x6E 0x53, or ‘SunS’ in ascii. This indicates that the device supports sunspec.

Following from 40002 onwards, you have so called “models”. Each model has a standard number and length. Some models are mandatory (your device must have them), but most are optional. Each model starts with its number, and it’s length. So if you read register 40002 and will almost always return the value 1 (model 1), and register 40003 will return 66, because model 1 has a standard length of 66.

This way, where each model (or block of registers) has a number and a length, means that any algorithm can read two registers, decide whether it can do anything with this block, and if it cannot, it can simply use the length register to skip OVER that block and read the next one.

When you read 0xFFFF, you’re done. No more models.

This makes it extremely easy to extend with new models, and for your readers to skip over stuff they don’t understand.

With all that said, PV-inverters will usually publish model 1 (which is mandatory, that has the manufacturer name and serial number and all that stuff), model 120 (the nameplate ratings), and then a single phase inverter will publish model 101 (the voltage, current and power stuff), and a 3-phase inverter will publish model 103.

Additionally many values have scale factors, which allows you to specify what power of ten the value is scaled by. Essentially, you can say how far left or right the decimal comma moves in the published value.

The layout of these models are defined in a set of documents you can download from sunspec.org.

The job of a translator will basically be to present a basic sunspec map (with models 1, 120 and 101/103), and then fetch the register from the non-standard device, rescale it if necessary, and put it into the standard map.

With this in place, any sunspec compliant device can read that PV inverter without requiring anything special to be done. In a Victron system, it will simply be detected automatically (if the slave id is 126) and just work out of the box.

Edit: For example, here is a python script that traverses the models and prints out the model numbers.

import sys
from pymodbus.client.sync import ModbusTcpClient as ModbusClient

host = sys.argv[1]
unit = int(sys.argv[2]) if len(sys.argv) > 2 else 126

modbus = ModbusClient(host=host)
modbus.connect()

start = 40002 # Start at 40000, first two registers have 'Su' and 'nS'.
while True:
	r = modbus.read_holding_registers(start, 2, unit=unit)
	if r.registers[0] == 0xFFFF: break
	print ("model {} length {} at {}".format(r.registers[0], r.registers[1], start))
	start += r.registers[1] + 2
1 Like

LOL, circling around in the threads, just realised you told me about Sunspec :face_with_open_eyes_and_hand_over_mouth:

… going to have to read this again and again.
and then for sh$t and giggles just call the interface on the Victor and see what comes back, interate over the registers.

… looking at Plonkster.
G

1 Like

Love the screen… curious how much/how difficult it would be to make this work with Victron.
G

1 Like

Have some more video’s up

2 Likes

Loving the videos!!
Already using quite a few of them.
This one however gets me!
I’ve managed to get the ESP32 into ESPHome, but can’t get it to read the data from the inverter.
What am I doing wrong?!?!

hi Scoobs.

Like the RS485/Sunsync/ESP32 setup,
I want to make sure I don’t order the wrong unit, I got spare ESP’s.
Can you maybe share a link to the correct RS485 for me.
Helping a friend Smartly his new sunsync.
G

As per previous, long term plan is to do the 485 to esp32 with esp home as per your build, short term… is there a way to integrate with the Sunsync via NodeRed, believe I’ve heard there is a option, could this be node red on HA accessing the Sunsync remotely or does it need to be hard wired ?

Curious further, I have the Victron, which is of course network connected… have you done any integration/HA/Dashboards for that ? you def seem to be better building dashboards than me :wink:

G

… where do I start looking…
There is sun and there is grid, this dashboard look a bit empty.
Sunsync.
Node red deployment done,
and configured into HA.
G