Giter Site home page Giter Site logo

saidlm / domoticz-solax-plugin Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 4.01 MB

Plugin to monitor and control Solax inverter from Domoticz via ModBUS over TCP/IP

License: MIT License

Python 100.00%
domoticz domoticz-plugin home-automation solar solar-energy solar-system solax solax-inverter modbus modbus-tcp

domoticz-solax-plugin's Introduction

Domoticz-Solax-plugin

It is primary developed to be able to monitor Solax inverter from Domoticz software via Mod-bus over TCP/IP. Base on the requests from users I decided to implement also control functionality to the plugin. Finally current version support monitoring and remote control as well. The implementation works with registers which are dealing with real-time operation only. Basically it means that there are no configuration functions which are writing data into EEPROM of the device as a part of permanent configuration. Finally it means that there is no issue with limited number od write cycles to EEPROM. In the other hand if device is restarted remote control configuration will disappear.

Monitoring

All the standard operational information which are collected by default version are visible on pictures below.

Utility tab

Utility tab

Temperature tab

Temperature tab

Switches tab

Switches tab

Remote Control

Remote control functions are controlled by Domoticz devices on Utility tab which shown on picture.

Switches tab

Mode selection of the remote control and trigger button can be find on Switches tab. See picture below.

Switches tab

The whole process can be monitored via number od Domoticz devices shown on picture below.

Switches tab

Detail description of remote control modes is on: (https://kb.solaxpower.com/solution/detail/2c9fa4148ecd09eb018edf67a87b01d2)

Prerequisites

  • Running Domoticz software
  • The installation of additional python3 library โ€“ pymodbus is necessary.
sudo pip3 install -U pymodbus

The current version of the plugin was tested with Domoticz version 2024.4, python 3.11.2, libpython 3.11 and pymodbus 3.6.8

Installation

  • Place the folder inside Domoticz plugin folder e.g. :
/home/domoticz/plugin/Solax
  • Copy plugin.py from repository folder to the folder created in previous step.
  • Restart Domoticz.
sudo service domoticz.sh restart

or

docker restart domoticz

The exact command depends on your installation.

Configuration

Hardware configuration

domoticz-solax-plugin's People

Contributors

averter avatar saidlm avatar

Stargazers

 avatar

Watchers

 avatar

domoticz-solax-plugin's Issues

TCP-IP SOLAX

Hello,

Use Modbus TCP-IP with LAN dongle didn't work.
Do you ask to solax technical support if they can't to open a port for the next Update (LAN Dongle)?

Regard,

Romain BERNARD

Question modbus address

Hello Martin,

I am very interested in you plugin. Could you please tell me what line is the modbus address of the inverter please ?
Because I think this is the reason why it is not working here. My solax address is 3, not 1.

Today I turnaround using solax modbus integration in Home Assistant. The inverter is connected with RS485 cable to a N510 USR in TCP.

Thank you for you kind help,

Best regards,

JFH

Call to function 'onHeartbeat' failed error

Hello,

Thanks for this amazing plugin! I am using a X1-Hybrid-G4 solax inverter and am unable to connect to it for some reason (debug log below). Note: I had to remove one line containing private information about the network/passwords.
If you can give me any pointers or other advice I'd be really grateful and/or let me know if you need any other information.

Best regards

2024-05-17 15:54:40.050 X1-Hybrid-G4 : Pushing 'onHeartbeatCallback' on to queue
2024-05-17 15:54:40.101 X1-Hybrid-G4 : Processing 'onHeartbeatCallback' message
2024-05-17 15:54:40.101 X1-Hybrid-G4 : Acquiring GIL for 'onHeartbeatCallback'
2024-05-17 15:54:40.101 X1-Hybrid-G4 : Calling message handler 'onHeartbeat' on 'module' type object.
2024-05-17 15:54:40.101 X1-Hybrid-G4 : onHeartbeat
2024-05-17 15:54:40.101 X1-Hybrid-G4 : Connecting to: 192.168.1.103:502
2024-05-17 15:54:40.289 X1-Hybrid-G4 : Successful attempt number: 1
2024-05-17 15:54:40.290 X1-Hybrid-G4 : Local context:
2024-05-17 15:54:40.290 X1-Hybrid-G4 : ----> 'Devices' 
2024-05-17 15:54:40.290 X1-Hybrid-G4 : ----> 'Domoticz' '<module 'Domoticz' (built-in)>'
2024-05-17 15:54:40.290 X1-Hybrid-G4 : ----> 'Images' '{}'
2024-05-17 15:54:40.290 X1-Hybrid-G4 : ----> '_plugin' '<plugin.BasePlugin object at 0x7fff79ee1850>'
2024-05-17 15:54:40.290 X1-Hybrid-G4 : ----> 'time' '<module 'time' (built-in)>'
2024-05-17 15:54:40.290 X1-Hybrid-G4 : Acquiring GIL for 'onHeartbeatCallback'
2024-05-17 15:54:40.289 Error: X1-Hybrid-G4 : Call to function 'onHeartbeat' failed, exception details:
2024-05-17 15:54:40.290 Error: X1-Hybrid-G4 : Traceback (most recent call last):
2024-05-17 15:54:40.290 Error: X1-Hybrid-G4 : File "/home/pi/domoticz/plugins/Solax/plugin.py", line 268, in onHeartbeat
2024-05-17 15:54:40.290 Error: X1-Hybrid-G4 : _plugin.onHeartbeat()
2024-05-17 15:54:40.290 Error: X1-Hybrid-G4 : File "/home/pi/domoticz/plugins/Solax/plugin.py", line 118, in onHeartbeat
2024-05-17 15:54:40.290 Error: X1-Hybrid-G4 : self.updateDevices(inputRegisters)

Cannot connect to inverter via modbus

I've decided to try the plugin in a different inverter of a friend of mine: model X3-Hybrid 10-E-D but there are connectivity issues. The debug log is

2024-07-18 18:44:38.008 Solax: Pushing 'onHeartbeatCallback' on to queue
2024-07-18 18:44:38.058 Solax: Processing 'onHeartbeatCallback' message
2024-07-18 18:44:38.058 Solax: Acquiring GIL for 'onHeartbeatCallback'
2024-07-18 18:44:38.059 Solax: Calling message handler 'onHeartbeat' on 'module' type object.
2024-07-18 18:44:38.059 Solax: onHeartbeat
2024-07-18 18:44:38.059 Solax: Connecting to: 192.168.88.21:502
2024-07-18 18:44:38.076 Solax: Connection timeout.
2024-07-18 18:44:38.077 Solax: Connecting to: 192.168.88.21:502
2024-07-18 18:44:38.092 Solax: Connection timeout.
2024-07-18 18:44:38.092 Solax: Connecting to: 192.168.88.21:502
2024-07-18 18:44:38.115 Solax: Connection timeout.
2024-07-18 18:44:38.115 Solax: Connection has not been established.
2024-07-18 18:44:38.115 Solax: Acquiring GIL for 'onHeartbeatCallback'
2024-07-18 18:44:48.031 Solax: Pushing 'onHeartbeatCallback' on to queue
2024-07-18 18:44:48.082 Solax: Processing 'onHeartbeatCallback' message
2024-07-18 18:44:48.082 Solax: Acquiring GIL for 'onHeartbeatCallback'
2024-07-18 18:44:48.082 Solax: Calling message handler 'onHeartbeat' on 'module' type object.
2024-07-18 18:44:48.082 Solax: onHeartbeat
2024-07-18 18:44:48.082 Solax: Connecting to: 192.168.88.21:502
2024-07-18 18:44:48.097 Solax: Connection timeout.
2024-07-18 18:44:48.097 Solax: Connecting to: 192.168.88.21:502
2024-07-18 18:44:48.111 Solax: Connection timeout.
2024-07-18 18:44:48.111 Solax: Connecting to: 192.168.88.21:502
2024-07-18 18:44:48.144 Solax: Connection timeout.
2024-07-18 18:44:48.144 Solax: Connection has not been established.
2024-07-18 18:44:48.145 Solax: Acquiring GIL for 'onHeartbeatCallback' 

I've then tried to ping the inverter (all fine) and check if port 502 was open using nmap

$ nmap -p 502 192.168.88.21
Starting Nmap 7.80 ( https://nmap.org ) at 2024-07-18 18:43 BST
Nmap scan report for 192.168.88.21
Host is up (0.0057s latency).

PORT    STATE  SERVICE
502/tcp closed mbap

Nmap done: 1 IP address (1 host up) scanned in 0.16 seconds

So it seems that it is closed for some reason :-(. I've roamed the internet but found no reason why this would be. Does anyone have any suggestions/things to try? Thanks.

When will ability to control the inverter become available?

This is a feature request. The project is meant to be able to both read and control the inverter via modbus, and so I wonder when will the ability to control it become available? Any plans, dates, thoughts?
I think that they have a similar system already implemented in home assistant but nothing for domoticz, and so this would definitely be unique/valuable :-). Thanks.

Modbus Unit_ID

Hello Said !

Thank you so much for providing this plugin.
I do not manage to make it work fine, I don't know so much about python, but I was looking through it, trying to locate where to change the modbus slave ID.
Here I have the chintdsu meter connected to my Solax G4, which is slave 2, my old EASTRON is slave 1, and my inverter is modbus slave #3.
Where is it I may indicate this please ?

Thank you for your help,

JFH

Modbus Error: [Input/Output] [Errno 104] Connection reset by peer

Error as described in the title. The plugin cannot connect to the inverter/read its values. Example debug log below.
Pymodbus version: 3.0.0-7
Domoticz version: 2024.7

2024-07-28 09:19:11.009 Solax: Pushing 'onHeartbeatCallback' on to queue
2024-07-28 09:19:11.060 Solax: Processing 'onHeartbeatCallback' message
2024-07-28 09:19:11.060 Solax: Acquiring GIL for 'onHeartbeatCallback'
2024-07-28 09:19:11.060 Solax: Calling message handler 'onHeartbeat' on 'module' type object.
2024-07-28 09:19:11.060 Solax: onHeartbeat
2024-07-28 09:19:11.060 Solax: Connecting to: 192.168.1.3:502
2024-07-28 09:19:11.504 Solax: Modbus Error: [Input/Output] [Errno 104] Connection reset by peer
2024-07-28 09:19:11.504 Solax: Connecting to: 192.168.1.3:502
2024-07-28 09:19:12.604 Solax: Modbus Error: [Input/Output] [Errno 104] Connection reset by peer
2024-07-28 09:19:12.604 Solax: Connecting to: 192.168.1.3:502
2024-07-28 09:19:12.703 Solax: Modbus Error: [Input/Output] [Errno 104] Connection reset by peer
2024-07-28 09:19:12.703 Solax: Connection has not been established.
2024-07-28 09:19:12.704 Solax: Acquiring GIL for 'onHeartbeatCallback'
2024-07-28 09:19:16.007 Solax: Pushing 'onHeartbeatCallback' on to queue
2024-07-28 09:19:16.057 Solax: Processing 'onHeartbeatCallback' message
2024-07-28 09:19:16.058 Solax: Acquiring GIL for 'onHeartbeatCallback'
2024-07-28 09:19:16.058 Solax: Calling message handler 'onHeartbeat' on 'module' type object.
2024-07-28 09:19:16.058 Solax: onHeartbeat
2024-07-28 09:19:16.058 Solax: Connecting to: 192.168.1.3:502
2024-07-28 09:19:16.104 Solax: Modbus Error: [Input/Output] [Errno 104] Connection reset by peer
2024-07-28 09:19:16.104 Solax: Connecting to: 192.168.1.3:502
2024-07-28 09:19:16.212 Solax: Modbus Error: [Input/Output] [Errno 104] Connection reset by peer

Seems to be a common/general issue related to pymodbus. Any advice?
home-assistant/core#52734
pymodbus-dev/pymodbus#420
thingsboard/thingsboard-gateway#412

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.