Giter VIP home page Giter VIP logo

alienatedsec / solis-ha-modbus-cloud Goto Github PK

View Code? Open in Web Editor NEW
47.0 12.0 5.0 1.04 MB

This repo is a workaround for Solis inverters to connect Solis Cloud and the local Home Assistant regardless of the model of your Solis datalogger

Home Page: https://alienatedsec.github.io/solis-ha-modbus-cloud/

License: CERN Open Hardware Licence Version 2 - Strongly Reciprocal

home-assistant home-automation solis solis-pv-inverters soliscloud modbus-master modbus-slave modbus-tcp monitoring waveshare

solis-ha-modbus-cloud's Introduction

Purpose

A combination of Solis Cloud, Home Assistant via RS485 (Modbus) communication. This repo is a documented workaround for Solis inverters to connect Solis Cloud and the local Home Assistant based on my own experience. It includes references, examples of the code in Home Assistant, more about configuration, as well as wiring and all required components.

Limitations and some history

My PV installation commenced back in August 2022. Since then, I started my journey with Home Assistant, and several Solis integrations made by some clever folks out there. My main goal was to keep Solis Cloud functionality and allow for advanced monitoring, remote control, and general automation of my home equipment. As I was going through my journey, I found many obstacles and limitations with Solis Cloud, dataloggers, and its design. Therefore, to get over those obstacles, I have designed the below, which meets my requirements and it works quite well.

Most importantly, my design doesn't disconnect the Solis cloud, and works (coexists) with your local Home Assistant integration in combination with any Solis datalogger.

You can watch a great video from Gordon Markus summarising his 12-months experience and Solis inverters limitations - https://youtu.be/F7r12UjzZyU

Diagram

Diagram

Description

The main goal is to ensure that a datalogger can work as normal and without any distruption. The datalogger acts as the Master device, and it talks directly to the inverter (Slave). Having an additional Master (e.g., Waveshare Gateway) on the same RS485 network is to create collisions, which could affect all RS485 devices. Some dataloggers don't accept multiple TCP connections (e.g., S2-WL-ST), and those will disconnect the Solis Cloud whenever used with an integration; others don't support Modbus TCP (e.g., DLS-W, S3-WIFI-ST), and some will fully rely on the cloud (S3-WIFI-ST). Some obsolete dataloggers couldn't provide remote functionality via Solis Cloud (e.g., DLS-W, DLS-L).

However, there are reports that remote functionality started working with obsolete dataloggers after Solis' maintenance on 13 April 2023.

Here it comes the Waveshare gateway to query the inverter. It can serve multiple clients, keep the inverter's cloud reporting functionality, and is not limited by any supported datalogger. The below is my configuration, but the use case could differ per datalogger.

The main device is the Waveshare RS485 to PoE ETH (B) - the non-PoE version is described as per this guideline. There are no major differences between PoE and non-PoE devices, except for the convenience of powering those when you have multiple next in line.

I was trying different settings as I had some teething issues, and I noticed that it works better when the integration (I am using Home Assistant SolaX Modbus integration for my Solis inverter) is polling data more often (e.g., every 5 seconds). As much as no longer relevant, you can find more about those issues at the following address.

Solution Concepts

DLS-W - Solis Sensor, Home Assistant Solax Modbus, SolisMon3, Grafana

Diagram

S2-WL-ST - Solis Sensor, Home Assistant Solax Modbus

Diagram

Wiring

I recommend using one of the pairs from the Ethernet cable for RS485 wiring. e.g., A twisted pair of blue for RS485(A) and white-blue for RS485(B). There is no need for 120 Ohms resistors at each end of the RS485. Both, Waveshare and the Inverter have resistors built-in.

Wiring

Configuration

Please use VirCom (not the Web Interface) to configure your Waveshare devices

  • Follow the prerequisite (Optional) - Waveshare firmware update to v1.486 - further discussed in this thread #14
  • The TCP Server on my diagram and presented here as 187 GW acts as a gateway for other network devices (e.g., the datalogger wired to TCP Client and for any compatible HA integration).
  • The Serial baud rate on the TCP Server is 9600 - default on the inverter; however, you can amend it independently to datalogger's settings - up to 38400 on the inverter, and match the same within TCP Server settings - increasing the baud rate is highly recommended.
  • The TCP Server - Modbus gateway type is set to Multi-host non-storage type - RS485 Multi-Host and Bus Conflict detection enabled.
  • The TCP Client - Modbus gateway type is set to Simple Modbus TCP to RTU - RS485 Multi-Host and Bus Conflict detection disabled.
  • You should use the IP address and the port number of your TCP Server when configuring any Modbus TCP compatible integration - e.g., like in the Home Assistant Solax Modbus installation notes.
  • Therefore, the TCP Client presented here as 171 DLG has its own IP address (irrevelevant), but within its Dest IP/Domain and Dest. Port config fields, it has to use the IP and the port of the TCP Server, and it needs the same Serial config as on a datalogger - baud rate 9600 - default for S2-WL-ST and S3-WIFI-ST dataloggers, where DLS-W baud rate can be amended via its hidden config web page http://IP/config_hide.html. The same applies to DLS-L under http://IP/hide_set.html, but it is password protected with username: admin, password: 8 characters linked with a datalogger
  • Both TCP Server and TCP Client - Transfer Protocol is set to Modbus_TCP Protocol - Waveshare is converting Modbus RTU messages to Modbus TCP and vice-versa - screenshots below.

TCP Server Config

server

More Advanced Settings for TCP Server

server-advanced

TCP Client Config

client

More Advanced Settings for TCP Client

client-advanced

  • The Waveshare used for the batteries connection is the same device, but the Transfer Protocol is set to None. I use VirCom to extend its connection to COMX on my laptop, so the software can connect to batteries and monitor them. Looking into using Modbus_TCP Protocol and integrating with HA via MQTT or even setting the MQTT on the Waveshare, but that is not my priority at the moment.

HA Integrations

Datalogger/Waveshare - Modbus TCP - direct connection - e.g., DLS-L, S2-WL-ST, Waveshare RS485 to PoE ETH (B)

Datalogger - Solarman based - direct connection - e.g., DLS-W

Cloud connection - any Solis datalogger

MQTT

  • SolisMon3 - advertising Solis' Inverter data to MQTT - compatible with DLS-W

Supported Solis Dataloggers

  • DLS-W
  • DLS-L
  • S2-WL-ST
  • S3-WIFI-ST

Table

Untested Solis Dataloggers

  • S1-W4G-ST (4-pin)

Incompatible and untested Solis Dataloggers

The below will be incompatible with the 4-pin Exceedconn EC04681-2023-BF Male/Female connector, but could still work with the above HA Integrations

  • S1-W4G-ST (USB)
  • S4-WIFI-ST (USB)

Devices and cost

image

  • 1 * £28.00 - PoE Switch - P-Link PoE Switch 5-Port 100 Mbps (TL-SF1005P)

image

  • 1 * £12.00 - Exceedconn EC04681-2023-BF Male/Female for Solis/Ginlong Inverter RS-485 port

image

  • 1 * £2.50 - DIN rail

image

  • 1 * £20.00 - Sourcingmap 240mm x 160mm x 90mm Plastic Dustproof IP65 DIY Junction Box Power Protection Case - I recommend a bigger box = more expensive

image

  • 1 * £6.00 - Pack M20 20mm IP68 Waterproof Red Cable Glands, Suitable for 6mm - 12mm Cables, Plastic Nylon Compression Glands Connectors with Locknut and Washer - AVARTEK

image

  • around £10.00 for some RJ45 cabling and connectors

Total Cost

£148.50 (pricing out of date) or £93.00 if you follow this discussion #24

Optional to connect batteries:

Final Result

Final

Future work

  • Compatibility with other brands and inverters
  • More Solution Concepts
  • Battery Monitoring - HA, MQTT

DISCLAIMER

I AM NOT RESPONSIBLE FOR ANY USE OR DAMAGE THIS DESIGN MAY CAUSE. THIS IS INTENDED FOR EDUCATIONAL PURPOSES ONLY. USE AT YOUR OWN RISK.

DONATIONS

IF YOU FOUND THIS USEFUL, YOU CAN BUY ME A BEER

paypal

solis-ha-modbus-cloud's People

Contributors

alienatedsec avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

solis-ha-modbus-cloud's Issues

TCP Client & Server - S2-WL-ST Troubleshooting and Config changes

Discussed in #14

Originally posted by solarjones May 21, 2023
I've been running 2x Waveshares together with a per the design for just over 2 months and during that time have had a few issues.

The Solis data stick I've used since installation (S2-WL-ST) with Solis Cloud had been flawless during that time until very recently where it went offline. I power cycled my PoE hub which brought it back online briefly, but in the end had to unscrew the data stick to power it off entirely (which makes sense since it would still receive power directly from the inverter). This is the first time the Solis data stick has 'hung' since installation.

Previously the anomalies have been with the HA data spiking on battery SOC, export & import values, which in turn produces bad energy stats.

I'm running Solax Modbus 2023.05.2b3 with the following configs on Waveshare:

image

image

Server
image
image

Client
image
image

The pattern I've observed is everything works well for a few weeks then hits an issue.
Any suggestions?
Thanks.

Implementation Question

Hi - not so much an issue but some questions and I'm not that familiar with Github so unsure of where to ask them!
I received the Waveshare modules today and am in the process of getting things setup.

I have both Server and Client on my network but my first question relates to the Device and Destination Port numbers. The default on the units seems to be 4196. Do I need to change this to 502 or some other port or does it matter as long as they talk to each other?

Second question: I haven't connected the RS485 sides yet but does the attached VirCom look OK?

Lastly, I guess I could confirm the above myself but I'm afraid to pull the datalogger from the inverter! I'm thinking power down - unscrew logger - connect TCP Server - power up and see if I can poll some registers. If I come up against issues then power down again - reinsert the logger - power up and try again another day. I guess my question is will the logger hold all its settings and just power up properly or will I have to set it up again? I would have no idea how to do the latter hence my reticence in disconnecting it :(

Any comments or tips appreciated at this stage.

VirCom1

Din rail screws

Hi, I was wondering if you had some more info on which din rai l/ screws to get for the Sourcingmap 240mm x 160mm x 90mm Plastic Dustproof IP65 DIY Junction Box Power Protection

Wiring diagram

Hi

thank you for this GH page, it looks amazing!!! Nice work!!! I am currently in the same situation as you are with my Solis inverter and the combination Home Assistant / SolisCloud.

I was looking at your setup but the only thing that is not really clear for me is the wiring... How did you do the wiring? Is it possible to add a photo or something like that of the wiring?

Thank you!

Regards
Matthias

USR-W610 Support

          Hi

Firstly great article and it clarified a few things for me re HA connectivity . Would it be possible to achieve the same thing if I used a single (USR-W610 Serial to WiFi Ethernet Wireless Converter RS232 RS485 Serial Server Support WatchDog Modbus Gateway TCP UDP) to replace the waveshare devices

In essence I want to still use the s3 dongle if possible and use the 610 to integrate the inverter with with HA . I am not quite clear how the 485 wiring would be between the inverter - W610 - S3 dongle

Regards

Nigel

Originally posted by @wymes in #2 (comment)

How do you wire the connector?

Hi, sorry for the silly question. I can see the connector with the 4 pins both female and male. I can see which cable connects to which but how do you keep the cable making connection without moving from the pin holes?

Battery Setup

Can you please share a little more information on how you have set up the battery with the 3rd Waveshare device? Is that also linked into Home Assistant?

Modbus stops working to HA when battery turned on.

Hi,

Firstly, many thanks gor helping with my ha integration on the other thread. I'm happy I get figures except the ct pv generation value.

I have replicated your setup. Thanks for the great detail. I get values into HA, except, when I turn the power switch on my battery on! I then get no new values. For example, Meter active power stays old and the minutes since update count up. There is little to no flashing of the activity blue led.

Turn off the battery and within 30seconds the values update.

Ip comms work ok to the modbus adapters throughout

Any ideas please?

Inverter is solis ac.

Thanks
Mike

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.