Getting Data from Solis Inverter

Thanks for those insights, Geoff. Once my new-ish system is fully handed over to me (I’m still haggling with the installer on a couple of minor points), I will use an RS485 to LAN converter (I think have a Moxa unit hanging around somewhere I could use) and start sniffing the traffic. I should be able to connect that in parallel with the WiFi stick as I don’t plan on writing anything to the inverter - all to well aware of possible nasty consequences! And yes, I know I mustn’t double-terminate the RS485.
Once I know what’s going on, I’ll probably go the same way as you and ditch the Cloud - although it’ll be quite a bit of work to replicate the nice graphs and long time data storage they offer.
Top of my ‘wish list’ is a simple display of battery SOC, easily visible to me and other people in the house, and HA should be a good way to go about that.

Hi all

I’ve got this working with just a new DLS-LAN stick (Serial number 1920xxxxxx) and the inbuilt modbus integration in HA. Details are here:

This is for a hybrid inverter. The registers would need updating for other types.

1 Like

FWIW, my bricked LAN stick has the following attributes:
The LAN stick serial number is 1918451071
another label on the board reads 55-0059-002
The board version reads ME-22X007-V31
It comes up at the LAN link level, but sends no packets, not even a DHCP discovery.
Its architecture seems to have an 8051 variant acting as an on-board programmer, presenting an I2C interface on the internal programming connector.
Solis have so far ‘not assigned’ my ticket for the last 16 days. Not impressive.

I’ve also had a nightmare - my installer came and finished up the battery install, came with an S3 Wi-Fi stick. I wasn’t really interested since my above setup works better for me but I disconnected my RS485 so he could install the Wi-Fi stick. It worked and I browsed the solis cloud app for a couple of days before deciding to switch back to my old setup. Except one big issue, he’d tightened the Wi-Fi stick so much that it’s completely stuck into the inverter port. I managed to get the screw thread loose (after much trying) but it seems the green port underneath is rotating with it so I still can’t remove the stick.
I’m now worried the entire port is dead as the Wi-Fi stick isn’t even powered now. To say I’m annoyed is an understatement.

Figuring out my next moves, it might involve a Dremel and some delicate cutting.

All good now, with a bit of surgery. If someone is interested in my setup:

First, as the above photo shows: Protoss PW21-H (£20 from Aliexpress) - it’s DIN mounted so shares the meter DIN rail and is powered by the same 240v AC supply as the meter. It is connected to Solis inverter via the Comm port. It’s been absolutely bulletproof and once configured (which takes 5 mins), I haven’t touched it.

I use nodered to poll modbus TCP every 10 seconds. I have about 50 or so registers that I read in sequential groups then deserialise into their respective values. They are sent to MQTT and my nodered flow also generates and sends HA MQTT Autodiscover messages so you don’t have to do anything in Home Assistant to see your Solis inverter. I prefer this decoupled setup so I can restart HA to my hearts content without nodered skipping a beat. I have attached the flow below if anyone is interested. There might still be some bugs as I’ve only played with it for the last few days. With a little digging you’ll see it’s quite easy to extend with extra sensors and registers for any of the Solis registers found here (thanks to whoever found this!):

I’ve exposed a force charge switch which will configure the inverter to go into charge mode which means I can trigger it to charge whenever my electric is cheap - it does this by setting the timed charge time to 24 hrs and enabling timed charge mode (if it isn’t already enabled)- when switching off, it defaults the timed charge times back to my tariffs offpeak period of 2330-0530. I can also stop it from discharging with another switch (sets the battery discharge amps to 1A, the lowest you can set it - so ~50W).

Thank you to all those who posted above and in other threads I’ve come across, in particular to @Biscuit who was the main inspiration behind this setup. It’s been a journey but it’s been fun and now I have a far better inverter than I thought I had!

1 Like

In case it helps someone… I have 3 Solis inverters, and get the hourly power from each using ModBus / ESPHome and use that in HA Energy. Only one ESP8266 + ModBus board required.

  1. I found the plastic bit (after removing the threaded piece) of a bulk standard 7 pin DIN socket was the perfect fit to the inverter data connection. I 3D printed a screw on cover - but this is not necessary. No need to spend money on the genuine connector :slight_smile:
  2. I used a WeMos D1 mini
  3. And a cheap RS485 adaptor XY-017 3.3v 5v 12v RS485 to TTL RS485 SP3485 RS-485 Breakout for Arduino RPI | eBay

R0 on the adaptor needs to be populated with a 0ohm resistor (a blob of solder) - this connects in the in-built 120ohm resistor across A and B. I also connected the ‘ground’ contact (Chinese characters) on the ModBus end of the adaptor to the ‘ground’ pins on the inverter data socket (but not to the ground or common on the ESP8266).

substitutions:
  device_name: "ESP8266 ModBus"

esphome:
  name: esp8266-modbus

globals:
   - id: my_global_int
     type: int
     restore_value: no
     initial_value: '0'

esp8266:
  board: d1_mini

# Enable logging
logger:
  level: VERBOSE #makes uart stream available in esphome logstream
  baud_rate: 0 #disable logging over uart

# Enable Home Assistant API
api:
  encryption:
    key: "xxxxxxxxxxxxxxxxxxx"

ota:
  password: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Esp8266-Modbus Fallback Hotspot"
    password: "xxxxxxxxxxxxxxxxxxxxxxxxxxx"

captive_portal:

uart:
  id: uart_modbus
  tx_pin: TX
  rx_pin: RX
  baud_rate: 9600

time:
- platform: homeassistant
  id: hatime
  timezone: Etc/GMT+0 

modbus:
  id: modbus1
  uart_id: uart_modbus

modbus_controller:
  - id: modbus1_01
    address: 0x0001
    modbus_id: modbus1
    update_interval: 10s
    setup_priority: -10
    
  - id: modbus1_02
    address: 0x0002
    modbus_id: modbus1
    update_interval: 10s
    setup_priority: -9   
    
  - id: modbus1_03
    address: 0x0003
    modbus_id: modbus1
    update_interval: 10s
    setup_priority: -8    

sensor:
  - platform: wifi_signal
    name: "${device_name} WiFi Signal Sensor"
    update_interval: 60s

  - platform: modbus_controller
    modbus_controller_id: modbus1_01
    id: today_power_p1
    name: "${device_name} Phase 1 Power Generated Today"
    address: 3014
    unit_of_measurement: "Wh"
    register_type: read
    value_type: U_WORD
    filters:
      - multiply: 100 
    state_class: total_increasing
    device_class: energy  

  - platform: modbus_controller
    modbus_controller_id: modbus1_02
    id: today_power_p2
    name: "${device_name} Phase 2 Power Generated Today"
    address: 3014
    unit_of_measurement: "Wh"
    register_type: read
    value_type: U_WORD
    filters:
      - multiply: 100
    state_class: total_increasing
    device_class: energy          

  - platform: modbus_controller
    modbus_controller_id: modbus1_03
    id: today_power_p3
    name: "${device_name} Phase 3 Power Generated Today"
    address: 3014
    unit_of_measurement: "Wh"
    register_type: read
    value_type: U_WORD
    filters:
      - multiply: 100    
    state_class: total_increasing
    device_class: energy     

My first post on this excellent and very informative site … so please go easy on me :slightly_smiling_face:

Thought I’d share plans for my next project, which is to be able to control/access my Solis RHI inverter while not interfering (I hope) with the SolisCloud data access in any way, and to do this in a very low cost manner. On this thread I can see solutions using RS-485 multiplexers to solve the issue of multiple MODBUS masters, but I plan a different approach which I haven’t come across … although that’s not say it hasn’t been tried, since I may have missed it in the forums.

I have a Solis RHI inverter with WiFi data logging stick and like many people I also want some basic local control of the inverter. The only thing I plan to control (from an ESP32) is whether the “Time of day” charge/discharge setting is RUN or STOP based on the Octopus Agile import/export prices.

My plan is to hack the WiFi stick to add an M5Stamp-Pico (an ESP32 from M5Stack) in between UART TXD and RXD signals that run from the WiFi sticks microcontroller (whatever it is) and the RS-485 driver (SP3485 chip). I’ll use one of the ESP32s UARTs to connect to the WiFi sticks microcontroller and another of the ESP32s UARTs to connect to the RS-485 driver on the 3.3v logic side. I only need to cut two traces on the PCB (or lift pins 1 and 4 on the RS-485 driver) and solder on 4 wires to the ESP32 two UART pins.

Here’s a picture of the RS-485 driver chip on the WiFi stick I have. It looks like it’s simple for me to do the mods to insert ESP32 where I need it.

Initially I plan to just forward the UART0_RXD to UART1_TXD and UART1_RXD to UART0_TXD so actually everything should continue to work as standard … it’s just that all the data is now going via the ESP32.

My next plan is to then send MODBUS commands to the inverter during the time when the WiFi sticks microcontroller isn’t using the RS-485 so there is no risk of a data clash. I’m expecting the WiFi stick microcontroller to only poll the inverter around every 5 minutes. I’ll have the ESP32 monitor the traffic on the WiFi stick microcontroller side to detect when it’s completed its 5 minute poll, then I should have a safe period to send various commands to inverter before next 5 minute poll, when I’ll switch back to simple data forwarding. If there’s a risk of the WiFi stick microcontroller sending a command at random times, then I can just buffer the command and forward it when at a safe time.

The total cost of this should just be the M5Stamp-Pico which is £6.00 … unless I destroy my WiFi stick of course :unamused: … or worst still, I brick my inverter :weary:

If anyones interested I’ll update the thread with my progress and share my Arduino code.

Hoping my M5Stamp-Pico arrives this week, then I can get started.

Just realised that I’ll also need to cut track to pins 2 (receiver enable) and 3 (driver enable) on the SP3485 since ESP32 will need to control the SP3485 direction, so I’ll have a couple more wires to the ESP32 GPIOs for this. I might just take SP3485 off the board and solder it back on at an angle with only pins 5, 6, 7, and 8 soldered, since this makes it extremely simple to then solder on my wires to the ESP32.

As you might have guessed, I’m much more of a hardware engineer than a software engineer (although my embedded firmware is not too shabby), so making mods to boards is no problem for me. I would say that if you’re not confident doing such mods than please don’t … I’d hate to be (even indirectly) responsible for someone breaking their WiFi stick or even worse their inverter !!

Hi All,

Does anybody have issues with the SolaX modbus integration showing on Node-RED?

I am trying to set up an automation to charge the batteries from grid during the Octopus agile low rates.
Although the entities appear fine, the integration is nowhere to be found under the “Domain” in the “call service” node.

I have tried a couple off the shelf troubleshooting like removing and installing the integration again to no avail…

Any help would be greatly appreciated!

Thanks in advance.

Hi everyone,

Anyone tried out the new S1-W4G-ST loggers at all? Perhaps it now allows TCP through a Port like you could for the S2-WL-ST.

If so it would be awesome to be able to send Modbus commands from HA with the latest loggers :slightly_smiling_face:

Here’s hoping!
C

Can I confirm with you that this is with a S2-WL-ST wifi stick?

Thanks so much @megakid & @Biscuit !! This thread has saved so many hours!! (I was on the webscraping Solis cloud route)
A combination of waveshare RS485 to ethernet from Pihut & this plug/socket Exceedconn EC04681-2023-BF Male/Female for Solis/Ginlong Inverter RS-485 port | eBay meant I was up & running for < £37.
I do have some questions though, @megakid , why do you decode the values from Modbus in the extract nodes when they are available in the responsebuffer array or payload array?
The battery SOC is correctly entered in the MQTT but refuses to show on my HA dashboard (the other values do show) If I choose History & the inverter in HA, the SOC does show up correctly.

Finally, might be my setup but I only noticed the following now I’m looking at the data more closely, wondered if others have the same?
In Solis cloud, the total house consumption for the day is shown(& based on emporia is correct). Using the phone Solis app, it shows as zero. In the inverter reports ( & if I query Modbus) the daily energy import & export is always zeros, the total energy imported/exported does increase correctly .

Editing my post to reflect my better understanding now.

Hi,

This is great, works straight off my 3.6 S5 Solis hybrid. Original LAN data logger
No extra equipment & can keep the cloud as well.

Changing the update time means can do even faster, 20 seconds seems OK. I will slow down but handy to workout what the data means for sure.

“Solis Inverter DC power” is the Solar generation, my mistake not seeing it so have everything I could possibly want a the moment.

No doubt good reason but others seem to go to a lot of work & coding & even buy equipment to get these readings but this all seems very easy using the above github yaml in HA.
Done in minutes. Fortunately I did have the LAN data logger as he does say not work with the S3 Wifi so perhaps that’s the reason but would think almost worth buying the S2 dual Wifi & Lan logger if indeed it does work as advised
Solis advised me to get the S2 or S3 logger as more feature but not sure what I am missing.

I can’t see to buy the S2 logger in the UK though but guess available if you look hard enough.

I can read & set all the features via Solis cloud so not sure I will risk adding Send Settings via HA but perhaps would be handy to e.g force charge with a quick flick of a switch in HA.

Sorry for late answer.

Yes, it looks like this model. I’ts the one with green 4 wire plug (solis home page: WiFi-Adapter DLS-W)

@Tonygadget glad you got it up and running. It is very powerful and I was glad to get shot of the SolisCloud rubbish!

To your question, the only real reason I decode the values like that is to standardize the code within my Node-Red functions. Some values come through within the other array just fine (the uint16 ones if memory serves me right) but the larger values take up 2 registers and therefore combining two decoded numbers into one gets messy. Might as well just use the same deserialization code and give it how many registers the number takes up (e.g. 1 or 2) - that way the code the same either way.

Hi,

I have just ordered this plug + USB adapter since I will have a Solis inverter running in my garage very soon.

I have a Solis WiFi stick also (Generation 3) that I will use to test things but then my plan is to go with a Raspberry Pi Zero W (first model that I had in box just collecting dust…) to read the data from the inverter to HA, as little cloud as possible is my goal, using this project GitHub - incub77/solis2mqtt: Modbus RTU / RS485 to MQTT bridge for Solis Mini solar inverter.

Since I don’t speak german I used Google translate to help with that image @sticilface posted (See image here), I have 0 experience with modbus so far but as I understood the text on the image I just choose either D- och D+ and connect the Ground pin to either? (Not both obviously :slight_smile: )

Is that a correct assumption or did my translation end up horribly wrong?

I also plan to run the Pi Zero W from the connector on the inverter since I read the WiFi stick can use up to ~5W in the technical details, that should be plenty for the Pi Zero W as I understand it, or can someone tell me that is a bad plan before I even try it?

Huh. Interesting. I have a Solis S6 inverter and the S2-WL-ST data logger, however, I don’t see any open ports other than 53 (dns):

% nmap -PN -p1-9999 192.168.1.205
Starting Nmap 7.93 ( https://nmap.org ) at 2023-06-14 23:38 BST
Nmap scan report for 192.168.1.205
Host is up (0.000021s latency).
Not shown: 9998 filtered tcp ports (no-response)
PORT   STATE SERVICE
53/tcp open  domain

Curiously, there was a (very crude) web interface on port 80 protected with basic auth there a few days ago, but it seems to have disappeared. Not that there was anything of note on there, just a status page with zero values against everything, some wifi settings (I’m using LAN), and a couple of other completely non-functional pages. Data appears to be going to Solis Cloud just fine.

I did try hooking the inverter up to my Waveshare PoE Modbus device on the inverters com port but I couldn’t get it to connect let alone read any registers at all.

I’m using an approach that hasn’t been mentioned yet to non-invasively log data from my solis inverter. Rather than redirect Server A, or use Server B (which doesn’t seem to work for me) I’m just creating a copy of all the network traffic from inverter on my router and sending it to the machine I want to have log it.

I’m using these IPTables rules:
On the router:

iptables -t mangle -A PREROUTING -s <IP address of inverter> -j TEE --gateway <IP address of logging server>

And on the logging machine:

iptables -N inverter_log_and_drop
iptables -A FORWARD -s <IP address of inverter> -j inverter_log_and_drop

# log packets destined for the solis cloud monitoring endpoint
iptables -F inverter_log_and_drop
iptables -A inverter_log_and_drop -p tcp --dport 10000 -j NFLOG --nflog-prefix "SOLIS-PACKET"
iptables -A inverter_log_and_drop -j DROP

which copies all packets with destination port 10000 (the solis cloud monitoring port) to the nflog buffer and then drops all packets.

Packets can then be read from nflog in userspace. I’m using Perl’s Linux::Netfilter::Log, but there are similar libraries for pretty much every major language.

This read only access is enough for me for the moment, but I may look at exploring some avenue of modbus write access in the future, there’s a lot of things I can think of that might be money saving if I could dynamically change how and when the batteries charge. It just annoys me that all this has to be so hacky rather than a proper, well supported local network API for this sort of thing.

I was hoping to switch from my 2x Waveshare adaptor and WiFi Logger (2x POE and 1x Wifi) to a single ethernet connection simply to tidy things up a little.

I got an S2-WL-ST to try but I had the similar problem…only Port 80 was listening so it was useless for modbus.

Sticking with the Waveshare method for now as it’s pretty solid once it’s working.

The solar panel company have upgraded the firmware in my batteries and solis inverter. They also gave me a new wifi datalogging stick. I have been using solismon3 and MQTT without issue.

The new logger has a SN 5AnnnnnnnnnnnnnE , all the software I have looked at expects the SN to be numeric
Any suggestions please?