Page 1 of 2

SPRSUN Modbus plugin

Posted: Friday 08 December 2023 10:00
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

Re: SPRSUN Modbus plugin

Posted: Friday 08 December 2023 12:29
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.

Re: SPRSUN Modbus plugin

Posted: Saturday 09 December 2023 15:27
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.

Re: SPRSUN Modbus plugin

Posted: Saturday 09 December 2023 18:17
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 :)

Re: SPRSUN Modbus plugin

Posted: Sunday 10 December 2023 13:38
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

Re: SPRSUN Modbus plugin

Posted: Thursday 21 December 2023 14:07
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.

Re: SPRSUN Modbus plugin

Posted: Thursday 21 December 2023 17:15
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 ?

Re: SPRSUN Modbus plugin

Posted: Thursday 21 December 2023 17:37
by waltervl

Re: SPRSUN Modbus plugin

Posted: Monday 22 January 2024 13:55
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'>

Re: SPRSUN Modbus plugin

Posted: Saturday 03 February 2024 18:39
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.

Re: SPRSUN Modbus plugin

Posted: Thursday 08 February 2024 21:08
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

Re: SPRSUN Modbus plugin

Posted: Thursday 08 February 2024 21:10
by WBeulink
Still waiting for someone who knows how to configure an EW11a correct so I can use TCP instead of serial.
Willem

Re: SPRSUN Modbus plugin

Posted: Tuesday 27 February 2024 12:24
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.

Re: SPRSUN Modbus plugin

Posted: Tuesday 27 February 2024 12:27
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

SPRSUN CGK-040V3L-B

Posted: Thursday 07 March 2024 20:23
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

Re: SPRSUN Modbus plugin

Posted: Sunday 10 March 2024 8:34
by Sateetje
Your sprsun has modbus and you can use the app? If yes, is should work.

Re: SPRSUN Modbus plugin

Posted: Tuesday 09 July 2024 23:08
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?!

Re: SPRSUN Modbus plugin

Posted: Wednesday 04 September 2024 13:58
by HB3340
Bei welchem Register kann man den aktuellen Setpoint abfragen, der auf der Carel Steuerung am Bildschirm angezeigt wird?

Re: SPRSUN Modbus plugin

Posted: Saturday 21 September 2024 17:46
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.

Re: SPRSUN Modbus plugin

Posted: Friday 01 November 2024 10:45
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