Getting Data from Solis Inverter

I would suggest capturing it for a few days and putting into a spreadsheet - you’ll then be able to see trends to help identify what’s what.

Eg values that fluctuate up and down, values that are static, values that only increase, values that reset between sundown and sunup etc.

That is how I identified the data in the server B output.

1 Like

Checkout this project, I’ve been using it (albeit slightly modified to grab some extra values) to scrape the ginlong json data, there are some values already mapped but I took the extra mappings from the json data, there is a section in the json that maps those keys to something more useful.

This is fantastic - but you wouldn’t happen to stumble upon a solution for us WIFI-stick users?
I only have the following settings:
image
(the IP address is correct by the way)
and I have the following status:
image

I have setup the node-red flow and the entities are waiting to be fed.

Any help would be GREATLY appreciated!

4 Likes

I’d like to second this. Am stuck in the same boat, with a WIFI Stick setup. THanks for posting this

Hey @abinitio1980 , needless to say this is fantastic.
It did work for me - but only for a day or so? Maybe the stick upgraded their firmware or something, and now it send incompatible data? Who knows. My version right now is “ME-121001-V1.0.6(202006160928)”, don’t know what it was before.
It certainly appears that the data is incompatible; now it seems to send packets of 14 and 248 bytes length, so the flow ignores either.

So I wrote a program to receive data packets and a) log them to the console, b) write them to a file and c) retransmit them somewhere else (right now, the flow); mostly to log the data to file for further analysis. Also created a docker container for it for easier installation.

It seems to me a better coordination in decoding the data format is needed. It took me hours of Googling to find previous solutions (graham0’s and this one), and neither work for me anymore.
Maybe we should establish a proper documentation project, in order to maintain the offset/data field mapping in a more general form than python code or a node flow.
I’ll probably start one for what I find out about my current data; sadly I’m not really good at analysing this kind of binary data. If anyone feels like they can and want to contribute, let me know.

Hi @abinitio1980 I followed your “manual” and everything works fine. All sensors are showing in HA. THX.
The only regret is not being able to get the data in the new Energy tab. I’d guess that’s only for Integrations? It’s a shame, having the data but not able to enjoy the 2021.8 Energy update…

You need to adjust your nodes (eg. DailyGeneration) to contain the fields necessary for it to be recognized as “long term statistics” (Sensor Entity | Home Assistant Developer Docs).
I think the most important one is state_class: total_increasing. I wasn’t entirely sure what fields are needed exactly, so I just added all of them (eg native_unit_of_measurement and native_value). You can leave out last_reset, that’s calculated automatically when the value decreases for a total_increasing sensor.

Hi!

Thanks for this post. This is the first time that it almost seems that I got data from my inverter.

My setup → Pi, Home assistant, LAN stick, listeningport 9999. (server B setup as in posts before)

I’ve created the custom components, installed nodered, imported the flow so far so good.

Now I got an error at the extracting data flow. It says error parsing the message and I’m stuck. The sensors show op in the overview but have the value unknown. How can I troubleshoot this?

I have got an csv file with unknown solis messages. So it seems to have a connection.

Thanks for your help.
FrankProcessing: UnknownSolisMessages.csv…

The first number is probably a time stamp, of some sort. They increase in increments of about 150,000. How that translates to actual times depends upon the date of “zero” and the scale. To know that, you’ll need to know the time it takes for a new entry to show up.

One of the non-changing numbers will be the id of the inverter. Somewhere in there will probably be a kWh total (either of the life of the inverter or for the day). It will be a column that never decreases, and, to differentiate that for the current-power measurement, you’ll need to take some readings while the sun is going down or has set, as the current-power reading will be decreasing at that point. Unlike the time measurement, the number for kWh might exactly match what’s displayed on your inverter (if it has a screen).

The current-power reading, of course, will start going down after mid-day and should be zero at night.

I’d have to see more readings to get some idea of what other fields might be.

Hello! I am very new to all of this - got my Home Assistant Blue last week and just today finally up and running with my Solis Inverter data logging stick inputting data via Node-Red.

Had a new Solis hybrid inverter and Pylontech batteries installed last October - have been trying to get connected to them since! Project 1 - read from Pylontech (done via software on console port). Project 2 - read from Solis Inverter via data logging stick (now done). Project 3 - directly read Pylontech into Home Assistant (ongoing). Project 4 - connect to inverter via Modbus. Project 5 pull together display and control on house display (this where Home Assistant comes in). Project 6 - automate.

For the Solis Hybrid Inverter, proof of concept was done on a Raspberry Pi using Node-Red, and the hard part has been decoding the data message. For anyone interested, here is my current take on the data format. I have a LAN stick (which indeed exposes internal server B in the ‘manual setting’ page). I am using UDP not TPC to avoid timeout locking up the ports. Pointing the secondary server B to my Home Assistant IP/port with a Node Red listener, the messages can be read and parsed. Decoding was ‘Bletchley Park’ time and effort, fortunately over the year end so I could see the year totals and month totals roll over. After much checking back and forth, I believe I have 45 data values identified, with another 17 values to go, and lots more ‘holes’ out of a possible 100 missing.
Data messages for me are: - 14 bytes (probably a handshake with the cloud), 130 bytes (some data but almost incomprehensible at the moment). This may tie up with the 135 byte “communication” display on the inverter advanced information screen. Any ideas anyone? And - the valuable 250 byte message as follows:

Solis Inverter data logger message (for hybrid model with LAN data logging stick)
Message length 250 bytes: (message 14 bytes, message 130 bytes still to decode!)

Start:
<1byte 0xA5>
Header (13 bytes):
<1byte data length> <3byte flags> <2byte counter> <4byte logger serial number> <3byte flags>
Time data fields:
<4byte datestamp1 (running seconds)> <2byte data logger seconds> <2byte null> <3byte datastamp2 (‘restart’)> <2byte ?> <2byte message counter> <2byte null>
Inverter:
<16byte serial number ASCI + " ">
Data:
100 x 2byte values. Mostly unsigned integer little endian, with factor determined by inspection
offset / value
48: Inverter operating temperature
50: PV 1 voltage
52: PV 2 voltage
54: PV 1 current
56: PV 2 current
58: Inverter AC bus current (phase 1 - assume ph2/3 follow)
64: Inverter AC voltage (phase 1 - assume ph2/3 follow)
70: AC frequency (assume inverter, not meter)
72: ?unknown
74: ?signed integer flag (0/-1)
76: Yield today
78: Total Yield
88: ?
108: Solar Power watts
112: Yield this month
116: Yield last month
120: Yield yesterday
122: Yield this year
126: ?
130: ?
134: ?
138: ? - max inverter current? my model is 4.6kW so 100 amps?
140: date YY
142: date MM
144: date DD
146: time hh
148: time mm
150: time ss
152: Meter grid voltage
154: Meter grid current (don’t believe this value)
156: signed integer - power from/to grid (import is -ve)
158: signed integer flag 0/-1 (import is -1)
160: ?
162: Inverter Battery Voltage
164: Inverter Battery Current (I find this is incorrect - use BMS values)
166: ?
168: Voltage (think this is backup critical load)?
170: Current (ditto)?
172: BMS reported battery SOC
174: BMS SOH
176: BMS battery voltage
178: BMS battery current (agrees with what Pylontech is pushing out)
180: BMS recommended charge current
182: BMS recommended discharge current
188: Load power watts
190: ?
192: Total energy to battery
196: Energy to battery today
198: Energy to battery this month
200: Total energy from battery
204: Energy from battery today
206: ?
208: Total energy imported
212: Energy imported today
214: Total energy exported?
218: Energy exported today?
220: Total energy consumed (load)
224: Energy consumed today (load)
226: ?
229: Model number <1byte read as Hex>
230: Firmware version <3byte read as little endian Hex>
234: ?
244: ?

Ending: <1byte check digit?> <1byte 0x15>

I am missing:

  • any fields for phase 2 and 3 (U/V/W) as this is only domestic 1phase
  • most of the export values - only pushed out 1kWh for testing purposes so far as I have batteries!
  • any error/status fields - no problems with battery or inverter (so far…) so I assume error flags are all ‘0’
  • power meter values for apparent power/reactive power/ power factor etc. Solis cloud has them, so how are they getting from my inverter to the cloud?

Note:

  • almost all data items are little endian. eg the data logger serial number is 32 byte unsigned integer (read 4 bytes backwards, concatenate to hex, turn into decimal - bingo!)
  • the two timestamps are seconds from 1 Jan 1970. Adding both gives “now”, but I am finding that the ‘running time’ is actually going slow and loosing a few seconds every day, suggesting that the running time field is being incremented, and the ‘last reset’ date is actually back-calculated from now-running. Strange.

Hope this is of use to someone - and if anyone can fill in more of the blanks for me, great!

2 Likes

Thanks for sharing the node-red flow. I’ve configured it but seeing a different message length to what you have. From what I can see in node-red the length is 146 bytes each time rather than the 259 the flow expects. I’ve followed the same monitoring stick config as you used. Any tips on why I’d be seeing a smaller message length?

I too have attempted to utilise abinitio1980’s Node-Red flow but cannot get it working
I have a standard Solis Inverter (not hybrid) with a WiFi stick so do not have as many settings I can change as the LAN stick users appear to have
I have seen the listening node show a connection a couple of times but after about 10 seconds it changes from “1 connections” back to “0 connections”
Has anyone had success with a WiFi stick connected to a standard inverter that can offer assistance

Hi everyone, my first post on here and just got HA running on my NAS under a VM. I’m having PV installed in a couple of months with a Solis Hybrid 5G inverter & Pylontech batteries. My aim is to get all the relevant data into the HA energy dashboard in real time. Additionally the ability to command the inverter with some HA automation like solar prediction to control grid import/charing to maximise efficiency.

Having read countless threads on various forums I am a bit confused so any wisdom would be very much appreciated.

Options and questions:

  1. Some people are screen scraping data from the Solis cloud website, 6 minute delay, and read only, so no ability to command the inverter. I’m discounting this.

  2. What hardware? Someone took their wifi data logger apart to splice in a USB connection to a Raspberry Pie. Soldering adapters via [USB] (https://smile.amazon.co.uk/gp/product/B08CGXBSTF/ref=ppx_yo_dt_b_asin_title_o02_s00?ie=UTF8&psc=1) / convertors… Is this really needed?

Guessing having the LAN data logger plugged in the RS485 isn’t sufficient to receive and send data/commands? MQTT bridge cable? And another option found was serial/MQTT. Confused.

  1. MODBUS / MQTT / Reading & Writing Registers… I’m guessing this is how the data is captured and interpreted into HA? Then there’s some Python code into the mix, not sure what’s needed.

  2. NodeRed - I think the flow of logic from the inverter is: RS485-LAN module → HA NodeRed instance → HA dashboard. But how any of the above plays into this, I’m not sure.

  3. Are there any predefined templates/integrations for all this? I know every element can be bespoke, but anything would be a start. Found some sensor integration.

  4. Solis LAN or wifi stick? From what i’ve read on this thread, wifi isn’t great?

  5. Apart from the Solis inverter and data logging stick, do I need other hardware/adapters?

  6. Having telemetry in HA energy dashboards would be great and some have succeeded! eg: dashboard

I know its supposed to be a fun learning opportunity, just need to get the ball rolling with a nudge in the correct direction as I’m not sure if I’m reading older forum posts to get data into HA via their own dashboard or if a lot of this isn’t needed since HA released the Energy dashboard integrations.

I will start with reading all of @abinitio1980 posts and would really appreciate a steer from those of you that have some/all of this working.

Thanks!

1 Like

Not really an answer, but this is what I found when I was looking for integrating my Solis inverter with HA (sorry, got a bit long).

Basically my Solis inverter talks MODBUS on an RS485 connection on a custom round 4 pin connector. You can hook into that directy or connect a Wifi/LAN stick to it and then use the apis/data from those sticks.

Direct MODBUS gives most power, but comes with great responsibiliy :slight_smile:
You need to know what registers there are and which ones to read/write. There are several lists floating around, but it was not clear to me which ones apply to what devices. Next to that it was unclear how badly I could damage my equipment by writing wrong values, so I abandoned the direct MODBUS idea.

The Wifi stick I have reports to the cloud and there is an HA integration that scrapes that website (actually there seem to be multiple websites). I did not like the cloud depency, so did not use that.

However the Wifi stick also has a local website which is can be read by the OmnikInverter custom component (apparently those Wifi sticks are used by multiple brands). It still only updates once every 5 minutes though.

That being said, the Wifi stick also has a hidden config menu which seems to allow for configuring additional (local) cloud servers, changing the mode (Datacollection/Transparency) or server parameter settingsprotocol (TCPServer/TCPClient/UDP).
I suspect that it is possible to do MODBUS over TCP or UDP by tweaking those settings, which would avoid additional wiring, but never tried it and there is no documentation about all the parameters.
I have seen a lot of posts of people trying to decode all kind of protocols of which some can probably be configured through this configuration page, but there seem to be several different versions of those protocols and Wifi stick firmwares with different capabilities.

In the end I decided to use the OmnikInverter integration with HA as it is local and easy to setup. The downside of only updating every 5 minutes is not a problem for me.


Some answers to the questions.

  1. Solis LAN or wifi stick? From what i’ve read on this thread, wifi isn’t great?

I don’t know the LAN stick, but the Wifi stick has been working fine for me.

  1. Having telemetry in HA energy dashboards would be great…

If you provide the data to HA correctly it can be used in the standard HA energy dashboard. If you find/use an recent HA integration that probably works out of the box. Otherwise you need to play around a bit with the unit (should be kWh I think) and state_class (check the docs on options when needed)


It sounds like you are getting lost in options, for me it helps when comparing options to make an Excel/Google sheet with the requirements/features of each option and score them (sometimes I score with actual numbers, sometimes just plus and minus) so it is easy to compare.

In the end the basic flow is always (excluding NodeRed as I don’t have experience with it):
Inverter talks MODBUS on RS485 > “some solution” > HA

Where “some solution” can be something that requires custom cables and the knowledge on what registers to read/write on MODBUS (e.g. like MQTT bridge). Or as simple a getting Wifi/LAN stick and installing an integration in HA like the Solis-sensor or Omnik Inverter integrations.

1 Like

This integration fetches direct from Solis’ API, it is not a web scrape. The 6 minutes thing is because that is how often the datalogger sends data to the Solis backend. The only way to do better I’d have thought is to do the whole rs485 thing … someone pointed me to Reading Ginlong Solis inverter over serial and importing in Home Assistant over MQTT :: Sequr today … the real trick is gonna be finding/writing the decode.

1 Like

Thanks for your pointers. I’ve had a bit more of a play and now have the NodeRed implementation running. I should clarify, this is all in preparation for my Solis Hybrid & Pyltontec batteries (4x US2000C) installation, so no actual data as yet.

Taking onboard what @Michel has said, I think step one is to get the data via the LAN data module and can live with a few minutes delay, although I note its possible to set the Server B refresh interval to 1 minute. This way I retain the Solis Cloud portal data too. Initial operation would be to set timers directly on the inverter control panel to charge the batteries at a set time using OctopusGo tariff (cheap rate 00:30-04:30).

The next stage depending on how that works out would be to command the inverter to import based on solar forecast and/or dynamic pricing via OutgoingOctopus smart tariff, but the Solis inverter doesn’t do anything that smart out the box, and as you explained, MODBUS would be the way to go to command it.

However in the interests of walking before running, I’ve got the newly exposes entities visible in HA but I’m stuck at getting HA Energy dashboard to recognise them. Earlier in this thread @daniu mentions using Long term stats with state-class set to total-increasing, but assume i’m doing something wrong as when editing the Energy dashboard I get ‘No matching statistics found’.

Key items needed for HA Energy dashboard:

  • Electricity Grid - Consumed Energy (kWh)
    Would this be Solis_DailyGeneration state class set to total_increasing ? Its not making itself visible to HA Energy dashboard drop down option for this area.

  • Electricity Grid - Returned to the Grid (kWh)

  • Solar - Solar Production (kWh)

  • Battery - Energy going to the battery (kWh)

  • Battery - Energy coming out of the battery (kWh)

Do I need to insert something in ‘configuration.yaml’ to expose the inverter in some way or should HA Energy be happy since HA entities are visible? Or do I set certain entity nodes with something to make this all flow and work?

@abinitio1980 - thanks for the NodeRed flow (brilliant, saved lots of effort!) and compared your sensor values to what @Biscuit listed and could see there is an offset of 14 (eg. GridImport 156 vs 142). Is this due to message length or something else?
I’ve added some additional sensors to the NodeRed flows based on the additional values @Biscuit had found, specifically the BMS since I’m getting batteries.

Thanks again for any help!

I have made good progress since my first posting in January, and it seems appropriate (hopefully useful) to provide an update for the record, on where I am with my Solis inverter data logging project.

I have my original Solis data stick. I have also purchased a second stick (for spare/parts), and have further recently purchased a data logging box.

Stick one – LAN type, serial number 19 13…. Rust coloured circuit board ME-12X007-VB11, firmware ME-121-1-V1.0.6. This must be a very old board/software. It has the manual tab option to set a second server, which I have successfully directed to my Raspberry Pi or my HA box (see last post), and it does not have the config_hidden page. Notably the status info page does not have the current invert (power) details working.

My data logging stick is now playing up. Connection to the cloud is intermittent and only for a few minutes at a time. I also lose my local server connection, and cannot get to the stick configuration web page. I suspect that this is a stick-to-Solis network issue rather than stick-to-inverter but I have been unable to shed light on this. Power recycling immediately sorts the issue, but sadly only for a short time. Interestingly the down periods are almost always identical in length. Yesterday, for example, connectivity was lost at 4:30, 8:10, 11:15, 14:20, and 19:50 and every time for exactly 2 hours 50 minutes before reconnecting. Must be a timeout issue…

Stick two – LAN type, serial number 19 18…. Dark green circuit board (quite different) ME-22X007-V31 (I think this is 3 and not B, difficult to read) firmware MA-0A-0501-5.05. I assume this is the latest running V5 protocol. This stick, although a LAN stick, thinks it is a WiFi one – web config software is quite different but centred on WiFI settings. Second B server does not work, config_hidden page does exist but I have made no progress in getting this to work. Status page does have the inverter power figures!

My problem here is that, in the interest of experimentation, I tried to swap over the sticks using the replace datalogger option. New stick registered (tick). Old stick disappeared (tick). New stick connects to inverter – computer says NO. New stick happy, talks to Solis Cloud, I can get to web config, just not connecting to the inverter. Inverter thinks it is connected to itself! Swapping back to the original stick does work and old stick miraculously reappears with all data and settings intact, and nicely connected to the inverter.

New Data Logging Box – WiFi (and LAN), serial number 28…. Firmware is H4.01.52MW2.01W1.0.91. This is clearly a more industrial Solarman device built to connect to a wide range of different makes, not just Ginlong. I had hoped that this would be more robust, reliable, and useable. The WiFi connection is, bluntly, near impossible to setup and to get working. The LAN cable option does connect, but the box frustratingly still continues to think it is a WiFi device. Web config is entirely different again. Unfortunately, even with a second replacement box (I assumed the first was faulty) I have been entirely and utterly unable to get this to connect to the inverter. I can only suspect that this is an old box with old software that does not (yet) recognise the newer Solis Hybrid inverter.

So, I am only keeping the first Solis stick running because after spending hundreds of hours working on this I am reluctant to throw it and my work in the bin. Very very tempted though. My focus is elsewhere, but at some point I may try asking Solis to help sort this out. In the meantime I have successfully implemented Modbus polling direct to the inverter registers, and am now getting data directly from that and by listening in on the CAN bus connection between Pylontech battery and inverter.

The advantage of listening to the data logging stick is that it is a passive approach, whereas Modbus mean actively talking to the inverter. However, the Modbus route allows me to control the polling rate (currently every 25 seconds) and also allows direct inverter control, which is my current phase of the grand plan project.

My summary thoughts:

Can I successfully connect to a Solis Inverter using the data logging stick? A. Perhaps, depends on the version of stick / software you have. Some versions allow a second B server, some have hidden options that may allow a second B server. I may just have been ‘lucky’ to get an old version that does work.

How easy is it to get the data out of a stick? A. If your stick permits a second server, using Node Red to set up a listening TCP/UDP node is not difficult. Decoding the resulting data buffer is difficult – there appear to be several different protocol versions with different data constructs (and little information available as to what the data is).

What hardware do I need? A. To listen to the stick second server no hardware is required other than a working instance of Node Red on the same network (I use my Raspberry Pi as a development machine, and move the Node Red flow over to my Home Assistant box for production).

What do I have to set up on the stick? A. The stick has settings for a A server which should be the Solis cloud server. You are looking for options for a B or local server which needs to be set to the IP address of your Node Red hardware. Set the port also, and match these in the TCP/UDP-in node.

Where does Modbus come in to all of this? A. The inverter only understands Modbus commands (a protocol) over RS485 (serial communication hardware). The data stick talks ‘Modbus’ to the inverter at one end (the plug/socket) collects data, and speaks TCP over the LAN/WiFi other end. We can ask the stick, as well as talking to the cloud, to talk TCP (or UDP) to us (we are passively listening for data) and/or we can connect to the inverter and talk Modbus directly.

Can I control the inverter using the stick? A. No. To change settings on the inverter requires a direct Modbus connection (and a cool nerve). The stick is a one-way data collection approach. Modbus connection to the inverter can, of course, be used to only collect (read) data.

What do I need to connect to the Modbus end of the inverter? A. Some means of connecting to the proprietary socket to get at the RS485 A and B lines, and something to connect a computer to RS485 (USB or ethernet converter).

Can I run the Solis data stick at the same time as a Modbus connection to the inverter? A. Modbus over RS485 only allows for one master’on the system at a time. The inverter is a slave and the stick the master, and any connected PC device also has to be a master. To avoid the two masters conflicting, either do away with the stick, or use a hardware device that allows two masters to operate on the same Modbus network.

How do I get my data from Node Red into Home Assistant? A. I use the entity node, which will both create a new entity in HA and update when the data changes. I have not used MQTT for anything (yet). Note that the entity device class must be correct for the data being collected! Power is Watts (or kW), and energy is kWh. The energy dashboard requires energy, and thus additional new integration sensors may have to be added in the config file https://www.home-assistant.io/docs/energy/faq/ if you are getting power W, not energy used kWh data from the inverter.

Can I buy electricity from Octopus Go at 5p per kWh during the night, charge my batteries, and then sell it back to them at 55p per kWh during the afternoon peak? A. No. At the time of writing I am buying electricity from Octopus standard variable tariff at 27.5p, and selling the occasional excess not going into my batteries at 7.5p on Octopus Outgoing Fixed. Having Octopus Outgoing precludes not only being on Go but also being able to take part in the recent reduce your usage and we will give you electricity for free trial. There is no such thing as a free lunch.

As before, I hope this is of some use to those of you attempting to extract information from your Solis inverter!

my wifi stick has firmware version MW3_15_0501_1.18 and while it has a server B option it completely ignores anything I put in there
image
it does have the config_hide page with Server A and optional server setting


So I could obviously point Server A to my own server if I wanted to … not sure when the optional server is used though.

I have exactly the same firmware and configuration. The Wifi logger is installed on a SOL-RHI-3P10K-HVES-5G-DC. After some tries I was able to Point Server B to my local ha installation. But Node Read doesn’t receive data on tcp - in stream. Than I saw in stick config side that the stick isn’t connected to my ha anyway.Bildschirmfoto
I got information that on some solis loggers server B connection won’t work anyway … which semes to be strange Ginlong Solis solar inverter monitoring - #43 by planetmarshall - Tutorials & Examples - openHAB Community

Would appreciate more information about receiving data from the solis inverter. This 3 Phase inverter has also a second wifi interface. Looks like this is the interface for modbus configuration.


Many interfaces and a lot of configuration stuff… hope it is possible to receive data local.
Meanwhile I render some date with REST-api from status.html output of the logger.

Thank you for your help.

I only have the problem, when NodeRED is not running, that the Solis LAN Stick does not respond anymore.
Does anybody else have this problem?