SPRSUN Modbus plugin

For heating/cooling related questions in Domoticz

Moderator: leecollings

Sateetje
Posts: 24
Joined: Monday 07 December 2015 15:22
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

SPRSUN Modbus plugin

Post by Sateetje »

I've made a modbus plugin to read and write some parameters of a SPRSUN heat pump. It can use an USB-RS485 stick or a TCP controller (like ZLAN 5143D)

Please take a look, some refactoring is needed imho (but I'm not a dev on daily basis).

https://github.com/Sateetje/SPRSUN-Modbus

ZLAN Settings:
Serial settings: 19200-8-N-1 (no flow control)
Network settings: Mode = TCP Server
Multi-Master settings: Protocol = None and Multi-Master = Disable
Attachments
Devices
Devices
Screenshot SPRSUN.png (126.92 KiB) Viewed 5466 times
Last edited by Sateetje on Friday 01 November 2024 10:47, edited 2 times in total.
User avatar
psubiaco
Posts: 194
Joined: Monday 20 August 2018 9:38
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Italy
Contact:

Re: SPRSUN Modbus plugin

Post by psubiaco »

Wow, very nice.
It should be good to have a wiki page listing all heat pumps that can be managed by Domoticz, with links to the associated plugins. It can be helpful for those who have to purchase a new heat pump!
I also have a heat pump, EMMETI brand, connected by Modbus (I control it by a lua script to regulate the used power optimizing own-consumption), but it has not good parameters as your.
Maybe in the future I'll get your plugin to adapt it to my heat pump.
Paolo
--
I use DomBus modules to charge EV car, get a full alarm system, control heat pump, fire alarm detection, lights and much more. Video
Facebook page - Youtube channel
Alain
Posts: 164
Joined: Sunday 26 April 2020 5:27
Target OS: Linux
Domoticz version: 2022.1
Location: Netherlands
Contact:

Re: SPRSUN Modbus plugin

Post by Alain »

Very nice looking script. I'm still using the outdated one from user Domoticx and having to assign new hardware for every register. Looking forward to start using this with my SPRSUN heat pumps.
Hue | Zigbee2Mqtt | MQTT | P1 | Xiaomi | RFXCom | Modbus | Qlima | Solaredge
TP-Link | Plugwise | Thermosmart | Node-Red | Grafana | Master and 5 remote servers
Sateetje
Posts: 24
Joined: Monday 07 December 2015 15:22
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: SPRSUN Modbus plugin

Post by Sateetje »

psubiaco wrote: Friday 08 December 2023 12:29 Wow, very nice.
It should be good to have a wiki page listing all heat pumps that can be managed by Domoticz, with links to the associated plugins. It can be helpful for those who have to purchase a new heat pump!
I also have a heat pump, EMMETI brand, connected by Modbus (I control it by a lua script to regulate the used power optimizing own-consumption), but it has not good parameters as your.
Maybe in the future I'll get your plugin to adapt it to my heat pump.
You can read a lot of registers:
https://areariservata.emmeti.com/en/vfm ... 061940.pdf

So give it a try :)
User avatar
psubiaco
Posts: 194
Joined: Monday 20 August 2018 9:38
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Italy
Contact:

Re: SPRSUN Modbus plugin

Post by psubiaco »

I know that long list of parameters, that I used to control my heatpump from a LUA script (that communicate to the heat pump by using external mbpoll Modbus command).
I used, because yeasterday I wrote a small plugin for it, starting from your.
Many thanks for the idea.
I invite you to
* add your plugin to https://www.domoticz.com/wiki/Hardware (in the bottom part I added a section for heat pumps)
* add it to the plugin list https://www.domoticz.com/wiki/Plugins
* fork, modify and pull-request the following projects, to let your plugin being installed easily:
- https://github.com/ycahome/pp-manager
- https://github.com/stas-demydiuk/domoti ... ns-manager
Paolo
--
I use DomBus modules to charge EV car, get a full alarm system, control heat pump, fire alarm detection, lights and much more. Video
Facebook page - Youtube channel
Sateetje
Posts: 24
Joined: Monday 07 December 2015 15:22
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: SPRSUN Modbus plugin

Post by Sateetje »

I changed the code from minimalmodbus to pymodbus because it lacked TCP. Now it's possible to use a ZLAN (or other controller) RTU-over-TCP controller.
bonebuster
Posts: 13
Joined: Saturday 25 November 2017 20:33
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: SPRSUN Modbus plugin

Post by bonebuster »

HI

I have this issue
Error: saisonspr: (SPRSUN) failed to load 'plugin.py', Python Path used was '/home/piwifi/domoticz/plugins/sprsun/:/usr/lib/python39.zip:/usr/lib/python3.9:/usr/lib/python3.9/lib-dynload:/usr/local/lib/python3.9/dist-packages:/usr/lib/python3/dist-packages:/usr/lib/python3.9/dist-packages'.
2023-12-21 16:56:26.366 Error: saisonspr: Traceback (most recent call last):
2023-12-21 16:56:26.366 Error: saisonspr: File "/home/piwifi/domoticz/plugins/sprsun/plugin.py", line 41, in <module>
2023-12-21 16:56:26.366 Error: saisonspr: import pymodbus.client as ModbusClient #tested with 3.6.2
2023-12-21 16:56:26.366 Error: saisonspr: ModuleNotFoundError: No module named 'pymodbus'
with pymodbus
pip install pymodbus
Defaulting to user installation because normal site-packages is not writeable
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: pymodbus in ./.local/lib/python3.9/site-packages (3.6.2)
pymodbus is not at the good place ?
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: SPRSUN Modbus plugin

Post by waltervl »

Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
WBeulink
Posts: 23
Joined: Monday 21 December 2020 18:29
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.1
Location: NL
Contact:

Re: SPRSUN Modbus plugin

Post by WBeulink »

Plugin installed OK. Got a great number of devices in Domoticz. But no real data in them.
Anyone any idea about correct connecting to an Elfin EW-11?
Thats the device connected to the SPRSUN and connected to 'my home WiFi and sending data to SPRSUN.
Data that shows up OK in the app of SPRSUN.

The EW-11 is on IP 192.168.2.171 and lives on port 4196

Error in DomoLog:
2024-01-22 13:58:33.446 SPRSUN-Modbus: Unexpected err=AttributeError("'ModbusIOException' object has no attribute 'registers'"), type(err)=<class 'AttributeError'>
--
RP4 - Buster/BullsEye - Domoticz 2023.2 - Z-Wave JS UI
Willem
--
WBeulink
Posts: 23
Joined: Monday 21 December 2020 18:29
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.1
Location: NL
Contact:

Re: SPRSUN Modbus plugin

Post by WBeulink »

Plugin is working now. Via serial.
But there is a serious problem.
The docker Domoticz container is growing in size very fast.
Only when I activate the plugin in hardware.
In a few hours the SD is full and everything stops working on my RPi.
--
RP4 - Buster/BullsEye - Domoticz 2023.2 - Z-Wave JS UI
Willem
--
WBeulink
Posts: 23
Joined: Monday 21 December 2020 18:29
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.1
Location: NL
Contact:

Re: SPRSUN Modbus plugin

Post by WBeulink »

Problem with disk-usage growing fast is solved with upgrade to Domoticz 2024-4
So it wasn't a problem of the plugin!!
Willem
--
RP4 - Buster/BullsEye - Domoticz 2023.2 - Z-Wave JS UI
Willem
--
WBeulink
Posts: 23
Joined: Monday 21 December 2020 18:29
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.1
Location: NL
Contact:

Re: SPRSUN Modbus plugin

Post by WBeulink »

Still waiting for someone who knows how to configure an EW11a correct so I can use TCP instead of serial.
Willem
--
RP4 - Buster/BullsEye - Domoticz 2023.2 - Z-Wave JS UI
Willem
--
Sateetje
Posts: 24
Joined: Monday 07 December 2015 15:22
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: SPRSUN Modbus plugin

Post by Sateetje »

WBeulink wrote: Monday 22 January 2024 13:55 Plugin installed OK. Got a great number of devices in Domoticz. But no real data in them.
Anyone any idea about correct connecting to an Elfin EW-11?
Thats the device connected to the SPRSUN and connected to 'my home WiFi and sending data to SPRSUN.
Data that shows up OK in the app of SPRSUN.

The EW-11 is on IP 192.168.2.171 and lives on port 4196

Error in DomoLog:
2024-01-22 13:58:33.446 SPRSUN-Modbus: Unexpected err=AttributeError("'ModbusIOException' object has no attribute 'registers'"), type(err)=<class 'AttributeError'>
That is the controller which is shipped with the HP, I don't think it's an "open" controller. I used a ZLAN controller (AliExpress)

After connecting the ZLAN, the app won't work anymore. Because it is in place of.
Sateetje
Posts: 24
Joined: Monday 07 December 2015 15:22
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: SPRSUN Modbus plugin

Post by Sateetje »

WBeulink wrote: Thursday 08 February 2024 21:10 Still waiting for someone who knows how to configure an EW11a correct so I can use TCP instead of serial.
Willem
Better buy a ZLAN 5134D: https://nl.aliexpress.com/item/1005002125208614.html (new version with Adapter)

Serial settings: 19200-8-N-1 (no flow control)
Network settings: Mode = TCP Server
Multi-Master settings: Protocol = None and Multi-Master = Disable
SASCHA
Posts: 1
Joined: Thursday 07 March 2024 20:15
Target OS: Windows
Domoticz version:
Contact:

SPRSUN CGK-040V3L-B

Post by SASCHA »

Can I also use the plugin for the SPRSUN CGK-040V3L-B model?

Together with the Zlan 7110m?
https://a.aliexpress.com/_EI8cH21

Thanks for your answer and it's great that you have a plugin like this!

Sascha
Sateetje
Posts: 24
Joined: Monday 07 December 2015 15:22
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: SPRSUN Modbus plugin

Post by Sateetje »

Your sprsun has modbus and you can use the app? If yes, is should work.
ronzelver
Posts: 2
Joined: Saturday 18 May 2024 15:35
Target OS: Linux
Domoticz version:
Contact:

Re: SPRSUN Modbus plugin

Post by ronzelver »

Sateetje wrote: Tuesday 27 February 2024 12:24
WBeulink wrote: Monday 22 January 2024 13:55 Plugin installed OK. Got a great number of devices in Domoticz. But no real data in them.
Anyone any idea about correct connecting to an Elfin EW-11?
Thats the device connected to the SPRSUN and connected to 'my home WiFi and sending data to SPRSUN.
Data that shows up OK in the app of SPRSUN.

The EW-11 is on IP 192.168.2.171 and lives on port 4196

Error in DomoLog:
2024-01-22 13:58:33.446 SPRSUN-Modbus: Unexpected err=AttributeError("'ModbusIOException' object has no attribute 'registers'"), type(err)=<class 'AttributeError'>
That is the controller which is shipped with the HP, I don't think it's an "open" controller. I used a ZLAN controller (AliExpress)

After connecting the ZLAN, the app won't work anymore. Because it is in place of.
I have installed a SPRSUN CGK-030V3L-B together with the EW11 modbus module. This module is quite universal as it allows multiple communication services to run at the same time (e.g. TCP/UDP Server, MQQT, etc.). I have configured the TCP server which is routed to the UART (modbus), but I still get the same error. Meanwhile I also have a ZLAN-5143D which I'm going to test. However in the serial configuration of the EW11 I can see that the communication is configured as 19200-8-2-N. I assume the same serial settings need to be applied to the ZLAN?!
HB3340
Posts: 1
Joined: Wednesday 04 September 2024 13:39
Target OS: Linux
Domoticz version:
Contact:

Re: SPRSUN Modbus plugin

Post by HB3340 »

Bei welchem Register kann man den aktuellen Setpoint abfragen, der auf der Carel Steuerung am Bildschirm angezeigt wird?
paddyp
Posts: 1
Joined: Saturday 21 September 2024 17:44
Target OS: Linux
Domoticz version:
Contact:

Re: SPRSUN Modbus plugin

Post by paddyp »

Does anyone know the original settings for the ew11? I have one I used for solar inverter but the have tried various port, protocol, baud rate, stop bits etc. don't seem to work.
Sateetje
Posts: 24
Joined: Monday 07 December 2015 15:22
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: SPRSUN Modbus plugin

Post by Sateetje »

ronzelver wrote: Tuesday 09 July 2024 23:08
Sateetje wrote: Tuesday 27 February 2024 12:24
WBeulink wrote: Monday 22 January 2024 13:55 Plugin installed OK. Got a great number of devices in Domoticz. But no real data in them.
Anyone any idea about correct connecting to an Elfin EW-11?
Thats the device connected to the SPRSUN and connected to 'my home WiFi and sending data to SPRSUN.
Data that shows up OK in the app of SPRSUN.

The EW-11 is on IP 192.168.2.171 and lives on port 4196

Error in DomoLog:
2024-01-22 13:58:33.446 SPRSUN-Modbus: Unexpected err=AttributeError("'ModbusIOException' object has no attribute 'registers'"), type(err)=<class 'AttributeError'>
That is the controller which is shipped with the HP, I don't think it's an "open" controller. I used a ZLAN controller (AliExpress)

After connecting the ZLAN, the app won't work anymore. Because it is in place of.
I have installed a SPRSUN CGK-030V3L-B together with the EW11 modbus module. This module is quite universal as it allows multiple communication services to run at the same time (e.g. TCP/UDP Server, MQQT, etc.). I have configured the TCP server which is routed to the UART (modbus), but I still get the same error. Meanwhile I also have a ZLAN-5143D which I'm going to test. However in the serial configuration of the EW11 I can see that the communication is configured as 19200-8-2-N. I assume the same serial settings need to be applied to the ZLAN?!
My settings in the ZLAN: 19200-8-1-N without flowcontrol
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests