Python plugin: ELV/EQ-3 MAX!

For heating/cooling related questions in Domoticz

Moderator: leecollings

Post Reply
mvzut
Posts: 443
Joined: Thursday 12 November 2015 10:55
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: The Netherlands
Contact:

Python plugin: ELV/EQ-3 MAX!

Post by mvzut »

I'm a little bit in doubt if your Python version is not too high, most people seem to use 3.5.3 or something. But looking at your log, it seems that the plugin system starts correctly.

Did you give the plugin.py file execute permission? This is explained in the Wiki (https://www.domoticz.com/wiki/Using_Python_plugins), you have to type

Code: Select all

 chmod +x plugin.py
from a terminal when you are in the plugin folder. To be honest, I didn't do this myself, it normally works without this step. But I notice it is often advised.

If you still keep having problems, I suggest to do a general search on the forum to see if others have been able to start Python plugins with your device/OS.
Raspberry Pi 4 - RFXtrx433 - CC2531 Zigbee - Opentherm Gateway - P1 smart meter - Netatmo - Philips Hue - ELV Max! - ESP8266 DIY water meter - 6 x Sonos - 4 x IP cameras - Wall mounted tablet + Dashticz - Google Home integration - MANY switches/sensors
haajee
Posts: 11
Joined: Tuesday 30 October 2018 17:31
Target OS: Linux
Domoticz version: V4.10149
Location: the Netherlands
Contact:

Re: Python plugin: ELV/EQ-3 MAX!

Post by haajee »

Good news! It's just working. Maybe i didn't read your instruction not clear. But i should add manualy the eQ-3/MAX! device from the dropdown list. And after that i configure the settings (ip for the cube etc) and then all the themostats add correctly. :)
mvzut
Posts: 443
Joined: Thursday 12 November 2015 10:55
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: The Netherlands
Contact:

Python plugin: ELV/EQ-3 MAX!

Post by mvzut »

That's good news indeed!

A tip I should probably give to all users, which has been mentioned before: there is a serious chance that your Cube is going to lose all its settings after a while, can take weeks or months but many of us have experienced this. Nothing dramatic, you can just reinstall all your valves etc, but it is a lot of work, especially if you have to do it every few weeks (which I had at a certain moment). It is therefore a good idea to consider adding a remote controlled (via Domoticz of course ) wall outlet switch, which turns off and on your Cube once every week. This will almost certainly prevent this issue from happening.
Raspberry Pi 4 - RFXtrx433 - CC2531 Zigbee - Opentherm Gateway - P1 smart meter - Netatmo - Philips Hue - ELV Max! - ESP8266 DIY water meter - 6 x Sonos - 4 x IP cameras - Wall mounted tablet + Dashticz - Google Home integration - MANY switches/sensors
haajee
Posts: 11
Joined: Tuesday 30 October 2018 17:31
Target OS: Linux
Domoticz version: V4.10149
Location: the Netherlands
Contact:

Re: Python plugin: ELV/EQ-3 MAX!

Post by haajee »

I want to say that i have also your script running on a Synology NAS! Important is to have a Domoticz version with Python from www.jadahl.com :)

Code: Select all

/usr/local/domoticz/var/plugins
If you are there with SSH you can give the following comands:

Code: Select all

wget https://github.com/mvzut/maxcube-Domoticz-plugin/archive/master.zip
7z x master.zip
cd maxcube-Domoticz-plugin-master/
cp -R * ../
cd ..
chmod +x plugin.py
You need to restart your NAS or only Domoticz before the plugin should be found.
jorijnsmit
Posts: 5
Joined: Wednesday 31 October 2018 7:02
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python plugin: ELV/EQ-3 MAX!

Post by jorijnsmit »

Do these switches run on 433MHz and are they supported by the RFXCOM module? Or will I need a separate cube hooked up to my LAN? Also, can the temperature be read directly from the switch or is again that cube needed for that?
mvzut
Posts: 443
Joined: Thursday 12 November 2015 10:55
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: The Netherlands
Contact:

Re: Python plugin: ELV/EQ-3 MAX!

Post by mvzut »

jorijnsmit wrote: Wednesday 31 October 2018 7:05 Do these switches run on 433MHz and are they supported by the RFXCOM module? Or will I need a separate cube hooked up to my LAN? Also, can the temperature be read directly from the switch or is again that cube needed for that?
What do you mean with "these switches", the ELV/EQ-3 MAX! valves? These communicate on 868 MHz and you need the Cube to operate/read them (see also my opening post). There are developments where people have communicated with the valves directly using a generic 868 MHz radio, but this is experimental and not supported in Domoticz yet. The Cube only costs around 40 Euros, so not a huge barrier I would assume.
Raspberry Pi 4 - RFXtrx433 - CC2531 Zigbee - Opentherm Gateway - P1 smart meter - Netatmo - Philips Hue - ELV Max! - ESP8266 DIY water meter - 6 x Sonos - 4 x IP cameras - Wall mounted tablet + Dashticz - Google Home integration - MANY switches/sensors
haajee
Posts: 11
Joined: Tuesday 30 October 2018 17:31
Target OS: Linux
Domoticz version: V4.10149
Location: the Netherlands
Contact:

Re: Python plugin: ELV/EQ-3 MAX!

Post by haajee »

I am really happy with your plugin! I can finally use mij EQ-3 valves in Domoticz. But i have some suggestions / feedback. I don't know if it is possible but ok :)

1. I can't switch the valves completly off. 10 degrees Celsius is minimum. But on 4.5 degrees Celsius you get the 'Off' message and sometime this is really helpfull :)

2. The temperature and the themostat settings are not 1 component. So i need to check the temperature under the tab :"temperature" but to set the themostat i need to go to the tab 'Others'

3. it's not possible to add a thermostat to a scene. So i can't make a 'leave home' scene that set the thermostat low.

Maybe do i something wrong but i hope you wil read this as positieve feedback. :)
Thegazsta
Posts: 6
Joined: Wednesday 27 January 2016 23:17
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Contact:

Re: Python plugin: ELV/EQ-3 MAX!

Post by Thegazsta »

This plugin is great, gives me excellent integration into Domoticz, thank you for the hard work and for sharing!
I'm using Domoticz beta v 4.9999 and had to load the python3 dev library to get the plugin to work. I have just one issue, when changing the valve mode to "Auto" the valve fails to change state and I get the following errors in the Domoticz log

Code: Select all

2018-11-03 08:21:31.983 Error: (EQ-3) 'onCommand' failed 'ValueError':'non-hexadecimal number found in fromhex() arg at position 20'.
2018-11-03 08:21:31.983 Error: (EQ-3) ----> Line 328 in '/home/pi/domoticz/plugins/MaxCube/plugin.py', function onCommand
2018-11-03 08:21:31.983 Error: (EQ-3) ----> Line 259 in '/home/pi/domoticz/plugins/MaxCube/plugin.py', function onCommand
2018-11-03 08:21:31.983 Error: (EQ-3) ----> Line 259 in '/home/pi/domoticz/plugins/MaxCube/maxcube/cube.py', function set_mode
2018-11-03 08:21:31.983 Error: (EQ-3) ----> Line 276 in '/home/pi/domoticz/plugins/MaxCube/maxcube/cube.py', function set_temperature_mode
This happens whether i use the valve mode switch in Domoticz or via a lua script, changing to other modes works fine. Do you have any idea how I can work around this?
mvzut
Posts: 443
Joined: Thursday 12 November 2015 10:55
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: The Netherlands
Contact:

Re: Python plugin: ELV/EQ-3 MAX!

Post by mvzut »

Thegazsta wrote:This plugin is great, gives me excellent integration into Domoticz, thank you for the hard work and for sharing!
I'm using Domoticz beta v 4.9999 and had to load the python3 dev library to get the plugin to work. I have just one issue, when changing the valve mode to "Auto" the valve fails to change state and I get the following errors in the Domoticz log

Code: Select all

2018-11-03 08:21:31.983 Error: (EQ-3) 'onCommand' failed 'ValueError':'non-hexadecimal number found in fromhex() arg at position 20'.
2018-11-03 08:21:31.983 Error: (EQ-3) ----> Line 328 in '/home/pi/domoticz/plugins/MaxCube/plugin.py', function onCommand
2018-11-03 08:21:31.983 Error: (EQ-3) ----> Line 259 in '/home/pi/domoticz/plugins/MaxCube/plugin.py', function onCommand
2018-11-03 08:21:31.983 Error: (EQ-3) ----> Line 259 in '/home/pi/domoticz/plugins/MaxCube/maxcube/cube.py', function set_mode
2018-11-03 08:21:31.983 Error: (EQ-3) ----> Line 276 in '/home/pi/domoticz/plugins/MaxCube/maxcube/cube.py', function set_temperature_mode
This happens whether i use the valve mode switch in Domoticz or via a lua script, changing to other modes works fine. Do you have any idea how I can work around this?
Hmmm... I noticed I get this error message too, but only when I set the setpoint in Auto to something below 8 degrees C. In Manual, I can set the setpoint to anything, even down to 0 degrees. By the way, below 5 degrees the valve shows "Off" on its display.
The error seems to come from a Python API file (located in the subfolder "maxcube"), which I didn't write myself. But I'll try to find out what's happening.
Raspberry Pi 4 - RFXtrx433 - CC2531 Zigbee - Opentherm Gateway - P1 smart meter - Netatmo - Philips Hue - ELV Max! - ESP8266 DIY water meter - 6 x Sonos - 4 x IP cameras - Wall mounted tablet + Dashticz - Google Home integration - MANY switches/sensors
mvzut
Posts: 443
Joined: Thursday 12 November 2015 10:55
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: The Netherlands
Contact:

Python plugin: ELV/EQ-3 MAX!

Post by mvzut »

haajee wrote:I am really happy with your plugin! I can finally use mij EQ-3 valves in Domoticz. But i have some suggestions / feedback. I don't know if it is possible but ok :)

1. I can't switch the valves completly off. 10 degrees Celsius is minimum. But on 4.5 degrees Celsius you get the 'Off' message and sometime this is really helpfull :)

2. The temperature and the themostat settings are not 1 component. So i need to check the temperature under the tab :"temperature" but to set the themostat i need to go to the tab 'Others'

3. it's not possible to add a thermostat to a scene. So i can't make a 'leave home' scene that set the thermostat low.

Maybe do i something wrong but i hope you wil read this as positieve feedback. :)
Thanks for your feedback hajee!

1. I haven't tested this extensively, I don't use the modes myself. But I found that I can set the thermostat to anything (also below 10, even down to 0) in Manual mode, but not in Auto mode. Did you check in both modes?

2. Unfortunately I cannot help this, I can only use the devices that Domoticz offers. To my knowledge, there are no device types which show both actual temperature and setpoint in the same device. If you put them both in your favorites, you will at least see them on the same screen.

3. I wasn't aware of this, but you're right. I cannot change this, but as a workaround you can maybe switch to Vacation mode (Level 30%) from a scene, and set the temperature for Vacation mode to your desired away temperature (using the MAX! software). Or you can set the thermostat via a JSON http command in the scene's field for "On Action":

Code: Select all

http://127.0.0.1:8080/json.htm?type=command&param=udevice&idx=IDX&nvalue=0&svalue=TEMP 
(change Domoticz adress/port if necessary, fill in the IDX of your thermostat, and your desired temperature instead of TEMP)
Raspberry Pi 4 - RFXtrx433 - CC2531 Zigbee - Opentherm Gateway - P1 smart meter - Netatmo - Philips Hue - ELV Max! - ESP8266 DIY water meter - 6 x Sonos - 4 x IP cameras - Wall mounted tablet + Dashticz - Google Home integration - MANY switches/sensors
Thegazsta
Posts: 6
Joined: Wednesday 27 January 2016 23:17
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Contact:

Re: Python plugin: ELV/EQ-3 MAX!

Post by Thegazsta »

Thanks Mvzut, if the temperature is set above 8c I don't get the error either! I can work around this now.
pbattino
Posts: 3
Joined: Wednesday 22 March 2017 9:53
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python plugin: ELV/EQ-3 MAX!

Post by pbattino »

This plug-in solved a long-standing problem I had with the MAX! cube, thank you so much!

Looking at the logs I noticed that the Heat demand switch was not working for me, i.e. was never turned on even when some valve was above 25%.
I debugged it and found out that the sValue is never set, however the nValue is set.
So I made the following changes:

Code: Select all

diff --git a/plugin.py b/plugin.py
index c6674b6..65401b6 100644
--- a/plugin.py
+++ b/plugin.py
@@ -306,10 +306,10 @@ class BasePlugin:
 
         # Update heat demand switch if necessary
         Domoticz.Debug(str(self.HeatDemand) + " valves require heat")
-        if self.HeatDemand > 0 and Parameters["Mode3"] == "True" and Devices[255].sValue == "Off":
+        if self.HeatDemand > 0 and Parameters["Mode3"] == "True" and Devices[255].nValue == 0:
             Devices[255].Update(nValue=1, sValue="On")
             Domoticz.Log("Heat demand switch turned on")
-        elif self.HeatDemand == 0 and Parameters["Mode3"] == "True" and Devices[255].sValue == "On":
+        elif self.HeatDemand == 0 and Parameters["Mode3"] == "True" and Devices[255].nValue == 1:
             Devices[255].Update(nValue=0, sValue="Off")
             Domoticz.Log("Heat demand switch turned off")
And now everything works. I don't know why this happens, I can't figure out whether it's only my problem or not, but I thought you should know in case the same problem is reported by other users.
mvzut
Posts: 443
Joined: Thursday 12 November 2015 10:55
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: The Netherlands
Contact:

Re: Python plugin: ELV/EQ-3 MAX!

Post by mvzut »

pbattino wrote:This plug-in solved a long-standing problem I had with the MAX! cube, thank you so much!

Looking at the logs I noticed that the Heat demand switch was not working for me, i.e. was never turned on even when some valve was above 25%.
I debugged it and found out that the sValue is never set, however the nValue is set.
So I made the following changes:

Code: Select all

diff --git a/plugin.py b/plugin.py
index c6674b6..65401b6 100644
--- a/plugin.py
+++ b/plugin.py
@@ -306,10 +306,10 @@ class BasePlugin:
 
         # Update heat demand switch if necessary
         Domoticz.Debug(str(self.HeatDemand) + " valves require heat")
-        if self.HeatDemand > 0 and Parameters["Mode3"] == "True" and Devices[255].sValue == "Off":
+        if self.HeatDemand > 0 and Parameters["Mode3"] == "True" and Devices[255].nValue == 0:
             Devices[255].Update(nValue=1, sValue="On")
             Domoticz.Log("Heat demand switch turned on")
-        elif self.HeatDemand == 0 and Parameters["Mode3"] == "True" and Devices[255].sValue == "On":
+        elif self.HeatDemand == 0 and Parameters["Mode3"] == "True" and Devices[255].nValue == 1:
             Devices[255].Update(nValue=0, sValue="Off")
             Domoticz.Log("Heat demand switch turned off")
And now everything works. I don't know why this happens, I can't figure out whether it's only my problem or not, but I thought you should know in case the same problem is reported by other users.
Both nvalue and svalue are set in the code on Github, this happens in

Code: Select all

Devices[255].Update(nValue=1, sValue="On")
and

Code: Select all

Devices[255].Update(nValue=0, sValue="Off")
The changes you made are in the part where I check for the current status. This can be done using the nValue or the sValue, shouldn't make a difference. Strange that it didn't work for you at first, and now it does. As far as I know, the current code works fine for other users. If more people are experiencing this issue, I might indeed change the code to what you suggest, thanks.
Raspberry Pi 4 - RFXtrx433 - CC2531 Zigbee - Opentherm Gateway - P1 smart meter - Netatmo - Philips Hue - ELV Max! - ESP8266 DIY water meter - 6 x Sonos - 4 x IP cameras - Wall mounted tablet + Dashticz - Google Home integration - MANY switches/sensors
DarkG
Posts: 89
Joined: Friday 15 September 2017 18:54
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10076
Location: Germany
Contact:

Re: Python plugin: ELV/EQ-3 MAX!

Post by DarkG »

Yes it works fine.

Just another idea. How about to use external Temperature Sensors. My thinking was about to override the valve heat demand if the the desired room temperature reached its final temp.

I have here 2 rooms with temperaturesensors, and there is a difference between the room temp and the temp which I get from the Thermostat.

Heatdemand=((ext_tmp=dsr_tmp)&valve<25%)

I know this can only be done in code.

I use your script with selector Dummy and 3 options. On Off Automatic. And a block script for turning on the relay
1.jpg
1.jpg (23.23 KiB) Viewed 2168 times
RPi4 Shelly1 Shelly2.5 ESPEasy Tuya Domoticz Beta Dashticz 3.6
DarkG
Posts: 89
Joined: Friday 15 September 2017 18:54
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10076
Location: Germany
Contact:

Re: Python plugin: ELV/EQ-3 MAX!

Post by DarkG »

And here the selector
2.jpg
2.jpg (35.46 KiB) Viewed 2168 times
RPi4 Shelly1 Shelly2.5 ESPEasy Tuya Domoticz Beta Dashticz 3.6
mvzut
Posts: 443
Joined: Thursday 12 November 2015 10:55
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: The Netherlands
Contact:

Re: Python plugin: ELV/EQ-3 MAX!

Post by mvzut »

Nice solution DarkG!

I like your idea to use existing temperature sensors to better control a room's temperature. However, it is not easy for a Python plugin to read devices that are not created by the plugin itself. The only way to do this is by using JSON commands via http, but that requires me to know your Domoticz address:port and potentially even your Domoticz login credentials (although the latter can be circumvented by adding the Domoticz address to the list of local networks under Settings). We would have to sacrifice almost all configurable aspect of the plugin to create room for the extra required parameters.

And even if I did that, indicating which temperature sensor should be used for which room would be pretty complicated. It would probably have to be a text field with something like "1=134;3=78", indicating that sensor with IDX 134 should be used for room 1, and 78 for room 3 (and none for room 2). I'm afraid we're going to lose the simplicity of the plugin this way.

What do others think?

By the way, you can already create this functionality yourself. Just create a LUA or Blockly script which sets the thermostat of a room to something low (e.g. 10 degrees) when the temperature sensor in that room is above the setpoint. And set it back to the original setpoint when the temperature has dropped again. You might have to use a user variable to temporarily store the original setpoint.

I will give this some more thought, and in the meantime I'm open for ideas!
Raspberry Pi 4 - RFXtrx433 - CC2531 Zigbee - Opentherm Gateway - P1 smart meter - Netatmo - Philips Hue - ELV Max! - ESP8266 DIY water meter - 6 x Sonos - 4 x IP cameras - Wall mounted tablet + Dashticz - Google Home integration - MANY switches/sensors
janvangent2
Posts: 40
Joined: Thursday 18 October 2018 9:50
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python plugin: ELV/EQ-3 MAX!

Post by janvangent2 »

I've been running domoticz with the ELV python plugin for 1 week now, without a single issue.
The heat demand switch does it's job, without any issues so far.

The comfort in our home went up, while reducing costs.
I really don't understand why ELV/EQ-3 stopped selling the heater switch. Without this, the whole system is quite useless if you have a gas/oil burner in your house. Luckily this plugin in combination with a wifi relay solved that issue.
mvzut
Posts: 443
Joined: Thursday 12 November 2015 10:55
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: The Netherlands
Contact:

Python plugin: ELV/EQ-3 MAX!

Post by mvzut »

DarkG wrote:My thinking was about to override the valve heat demand if the the desired room temperature reached its final temp.
Not sure if this is a good solution. What if you would override the heat demand switch because the temperature in one room has reached its value according to a sensor in that room, but in another room there is still heat demand? Turning the switch back on will then still cause the room to overheat. I think it's better to change the setpoint like mentioned in my previous post.
Raspberry Pi 4 - RFXtrx433 - CC2531 Zigbee - Opentherm Gateway - P1 smart meter - Netatmo - Philips Hue - ELV Max! - ESP8266 DIY water meter - 6 x Sonos - 4 x IP cameras - Wall mounted tablet + Dashticz - Google Home integration - MANY switches/sensors
DarkG
Posts: 89
Joined: Friday 15 September 2017 18:54
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10076
Location: Germany
Contact:

Re: Python plugin: ELV/EQ-3 MAX!

Post by DarkG »

I know what you are thinking. In your way you have to store the original Setpoint and write it back. For each valve.
But what, if you create a second uservariable called intern heat demand, so each valve can change this one variable.
And with this and a AND Block you can request Heat.

So if Setpoint reached you change the Variable to ON.
RPi4 Shelly1 Shelly2.5 ESPEasy Tuya Domoticz Beta Dashticz 3.6
mvzut
Posts: 443
Joined: Thursday 12 November 2015 10:55
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: The Netherlands
Contact:

Python plugin: ELV/EQ-3 MAX!

Post by mvzut »

DarkG wrote:I know what you are thinking. In your way you have to store the original Setpoint and write it back. For each valve.
But what, if you create a second uservariable called intern heat demand, so each valve can change this one variable.
And with this and a AND Block you can request Heat.

So if Setpoint reached you change the Variable to ON.
Not sure how that changes anything... The end result is still that you want to turn off the boiler earlier than the valve position would indicate, right? But what if one of your other rooms has (real) heat demand at that time? Then you cannot switch off the boiler. So the room that had already reached its desired temperature will still be heated. Unless you actually close that valve, which can only be achieved using a setpoint change.

Vice versa, turning on the boiler earlier than the valve position indicates also won't work. Since it doesn't make sense to turn on the boiler when the valve is closed. Also here the only solution is to change the setpoint (this time to something really high).

I have an idea :
What if you create virtual switches for all your valves, which do nothing else then send a JSON command at the On and Off action (see one of my posts above for the exact command). This JSON command sets the thermostat of that valve to either 8 degrees (Off action) or 25 degrees (On action). You can then install Smart Virtual Thermostats (another Python plugin) for every room, indicating the IDXes of your temperature sensor, your newly created virtual switch, and even an outside temperature sensor if you want. The disadvantage is that you throw away the gradual valve control that MAX's own system uses, but in return you get the option to use another temperature sensor, plus a controller with self-learning behavior, even taking the outside temperature into account to determine when it should switch on.
Raspberry Pi 4 - RFXtrx433 - CC2531 Zigbee - Opentherm Gateway - P1 smart meter - Netatmo - Philips Hue - ELV Max! - ESP8266 DIY water meter - 6 x Sonos - 4 x IP cameras - Wall mounted tablet + Dashticz - Google Home integration - MANY switches/sensors
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest