Page 3 of 10

Python plugin: ELV/EQ-3 MAX!

Posted: Wednesday 24 October 2018 23:38
by mvzut
janvangent2 wrote: That would indeed be great to start with.
...
I'm now waiting on a small voltage supply (220V acdc converter) to power the ESP8266 module to switch the boiler. As soon as I have this, and you have a script ready I can run a test.
I found out it is pretty complicated to switch arbitrary Domoticz devices from within a Python plugin. Therefore, I am working on a plugin version which creates it's own boiler switch. You can then couple this switch to your own "real" boiler switch using it as slave device. The plugin is actually ready, but I want to test it a bit before releasing it.

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

Posted: Thursday 25 October 2018 21:16
by mvzut
I have released an update of the plugin again on Github (version 0.6.0).

This version has an option to create a "Heat demand" switch, which will be turned on when at least one valve requires heat (i.e. if it is open for more than 25%). This 25% is not configurable at this stage, nor is the amount of valves that need to be open before the "Heat demand" switch is turned on. I may add this configurability later. However, since Domoticz plugins do not support more than 6 user-configurable parameters, this will only be possible if I remove other configurable parameters (e.g. the optional creation of certain devices). Actually, I already had to remove one of them (the optional creation of temperature devices) to make this new option possible.

You can use the new "Heat demand" switch to control your boiler. The exact execution of this will differ per situation, since all boilers work differently. You may have to send a command via http, or switch on another device that controls your boiler's thermostat. You can achieve this by creating (Blockly) scripts or configuring other devices as slave of the "Heat demand" switch.

Let me know if this works for you!

P.S. Please restart Domoticz after updating the files with the git commands mentioned in earlier posts. After restarting, go to Devices and set the parameters (again). This is necessary because I made some major changes there.
.
.
HeatDemand.jpeg
HeatDemand.jpeg (20.81 KiB) Viewed 1664 times

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

Posted: Friday 26 October 2018 11:25
by mvzut
mvzut wrote: Wednesday 17 October 2018 21:41 Interesting! Apparently you don't have to switch to Boost mode per se, any mode switch will do. You could do that by this (slightly modified) Lua time-based script:

Code: Select all

commandArray = {}
valves = {"Mode valve 1","Mode valve 2","Mode valve 3"}
if tonumber(os.date('%M')) == 0 then
  for n, device in pairs(valves) do
    setting = otherdevices_svalues[device]
    if setting == 0 then tempsetting = 10 else tempsetting = 0 end
    table.insert(commandArray, {[device] = "Set Level " .. tempsetting})
    table.insert(commandArray, {[device] = "Set Level " .. setting .. " AFTER 30"})
  end
end
return commandArray
I'll check for a few days if this really works (be my guest to try it as well!). If it does, I'll have a look if I can build something like this into the Python plugin (as a selectable option).
I have this running for a while, seems to update temperature more often now. Have others tried it? If it works well for more people, I might consider adding this functionality to the plugin.
.
.
Temperature.jpeg
Temperature.jpeg (34.01 KiB) Viewed 1637 times

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

Posted: Friday 26 October 2018 19:56
by AurelioF
I'm about to try the last update of the plugin and I also want to test the script that acts on the valves every hour, I can use the domoticz editor to include it, or it is necessary to write the file in the folder ~ \ domoticz \ scripts \ lua :?:

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

Posted: Friday 26 October 2018 19:59
by mvzut
AurelioF wrote:I'm about to try the last update of the plugin and I also want to test the script that acts on the valves every hour, I can use the domoticz editor to include it, or it is necessary to write the file in the folder ~ \ domoticz \ scripts \ lua :?:
No, the internal editor is also fine, just make sure you set it to time-triggered.

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

Posted: Friday 26 October 2018 20:12
by AurelioF
mvzut wrote: Friday 26 October 2018 19:59
AurelioF wrote:I'm about to try the last update of the plugin and I also want to test the script that acts on the valves every hour, I can use the domoticz editor to include it, or it is necessary to write the file in the folder ~ \ domoticz \ scripts \ lua :?:
No, the internal editor is also fine, just make sure you set it to time-triggered.
Ok gracias...

Después de actualizar el plugin encontrarte algunos errores en el log.
Tengo 2 válvulas al 40% y 60% pero Heat demand aparece siempre OFF

2018-10-26 20:03:31.498 Error: (Rad) 'onStart' failed 'ValueError':'invalid literal for int() with base 10: 'True''.
2018-10-26 20:03:31.498 Error: (Rad) ----> Line 322 in '/home/pi/domoticz/plugins/MaxCube/plugin.py', function onStart
2018-10-26 20:03:31.498 Error: (Rad) ----> Line 177 in '/home/pi/domoticz/plugins/MaxCube/plugin.py', function onStart
2018-10-26 20:03:41.014 Error: (Rad) 'onHeartbeat' failed 'AttributeError':''BasePlugin' object has no attribute 'beats''.
2018-10-26 20:03:41.014 Error: (Rad) ----> Line 330 in '/home/pi/domoticz/plugins/MaxCube/plugin.py', function onHeartbeat
2018-10-26 20:03:41.015 Error: (Rad) ----> Line 266 in '/home/pi/domoticz/plugins/MaxCube/plugin.py', function onHeartbeat
2018-10-26 20:04:00.793 Error: (Rad) 'onHeartbeat' failed 'AttributeError':''BasePlugin' object has no attribute 'beats''.
2018-10-26 20:04:00.793 Error: (Rad) ----> Line 330 in '/home/pi/domoticz/plugins/MaxCube/plugin.py', function onHeartbeat
2018-10-26 20:04:00.793 Error: (Rad) ----> Line 266 in '/home/pi/domoticz/plugins/MaxCube/plugin.py', function onHeartbeat
2018-10-26 20:04:10.810 Error: (Rad) 'onHeartbeat' failed 'AttributeError':''BasePlugin' object has no attribute 'beats''.
2018-10-26 20:04:10.810 Error: (Rad) ----> Line 330 in '/home/pi/domoticz/plugins/MaxCube/plugin.py', function onHeartbeat
2018-10-26 20:04:10.810 Error: (Rad) ----> Line 266 in '/home/pi/domoticz/plugins/MaxCube/plugin.py', function onHeartbeat
2018-10-26 20:04:20.828 Error: (Rad) 'onHeartbeat' failed 'AttributeError':''BasePlugin' object has no attribute 'beats''.
2018-10-26 20:04:20.828 Error: (Rad) ----> Line 330 in '/home/pi/domoticz/plugins/MaxCube/plugin.py', function onHeartbeat
2018-10-26 20:04:20.828 Error: (Rad) ----> Line 266 in '/home/pi/domoticz/plugins/MaxCube/plugin.py', function onHeartbeat
2018-10-26 20:04:30.795 Error: (Rad) 'onHeartbeat' failed 'AttributeError':''BasePlugin' object has no attribute 'beats''.
2018-10-26 20:04:30.795 Error: (Rad) ----> Line 330 in '/home/pi/domoticz/plugins/MaxCube/plugin.py', function onHeartbeat
2018-10-26 20:04:30.795 Error: (Rad) ----> Line 266 in '/home/pi/domoticz/plugins/MaxCube/plugin.py', function onHeartbea

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

Posted: Friday 26 October 2018 20:16
by AurelioF
Could it be because I do not have thermostats?
I think you activate the option unintentionally

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

Posted: Friday 26 October 2018 20:19
by mvzut
AurelioF wrote: Friday 26 October 2018 20:16 Could it be because I do not have thermostats?
I think you activate the option unintentionally
Sorry, I forgot to explain that after updating the files, Domoticz needs to be restarted completely, not just the plugin. After restarting, you have to go to Devices and set the user configurable parameters of the plugin again. This is because I changed the order & meaning of the parameters.

I expect this will solve your error messages.

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

Posted: Friday 26 October 2018 20:23
by AurelioF
mvzut wrote: Friday 26 October 2018 20:19
AurelioF wrote: Friday 26 October 2018 20:16 Could it be because I do not have thermostats?
I think you activate the option unintentionally
Sorry, I forgot to explain that after updating the files, Domoticz needs to be restarted completely, not just the plugin. After restarting, you have to go to Devices and set the user configurable parameters of the plugin again. This is because I changed the order & meaning of the parameters.

I expect this will solve your error messages.
Opss ok hahaha ... solved thank you very much. :D

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

Posted: Friday 26 October 2018 20:58
by AurelioF
my cost more than expected solve the problem, delete all devices and restart domotiz, but continue the problem, finally change the names in MAX and there are no error messages, although the demand for continuous heat was even with more than one valve in heats greater than 25%

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

Posted: Friday 26 October 2018 21:01
by mvzut
Ok, I'm not sure I completely understand... Is it working now? And does the heat demand switch work as expected?

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

Posted: Friday 26 October 2018 23:04
by AurelioF
mvzut wrote: Friday 26 October 2018 21:01 Ok, I'm not sure I completely understand... Is it working now? And does the heat demand switch work as expected?

Sorry, my english is not good ...
The heat demand switch does not work, it always remains OFF

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

Posted: Friday 26 October 2018 23:11
by AurelioF
2018-10-26 23:06:49.300 Error: (Rad) 'onHeartbeat' failed 'ValueError':'invalid literal for int() with base 10: 'None''.
2018-10-26 23:06:49.300 Error: (Rad) ----> Line 330 in '/home/pi/domoticz/plugins/MaxCube/plugin.py', function onHeartbeat
2018-10-26 23:06:49.300 Error: (Rad) ----> Line 288 in '/home/pi/domoticz/plugins/MaxCube/plugin.py', function onHeartbeat
2018-10-26 23:06:49.300 Error: (Rad) ----> Line 146 in '/home/pi/domoticz/plugins/MaxCube/plugin.py', function UpdateDevice

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

Posted: Friday 26 October 2018 23:15
by AurelioF
I can start a clean installation, for the moment I am still doing tests.

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

Posted: Friday 26 October 2018 23:27
by mvzut
AurelioF wrote:2018-10-26 23:06:49.300 Error: (Rad) 'onHeartbeat' failed 'ValueError':'invalid literal for int() with base 10: 'None''.
2018-10-26 23:06:49.300 Error: (Rad) ----> Line 330 in '/home/pi/domoticz/plugins/MaxCube/plugin.py', function onHeartbeat
2018-10-26 23:06:49.300 Error: (Rad) ----> Line 288 in '/home/pi/domoticz/plugins/MaxCube/plugin.py', function onHeartbeat
2018-10-26 23:06:49.300 Error: (Rad) ----> Line 146 in '/home/pi/domoticz/plugins/MaxCube/plugin.py', function UpdateDevice
Mmm... strange. It's working fine here. It seems it's reading "None" as your valve position, don't know why. I've updated the code again with one minor edit, may help to make it at least not crash in those situations. Can you try this, and put debugging on? This will show more status updates in the log.

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

Posted: Saturday 27 October 2018 0:01
by AurelioF
mvzut wrote: Friday 26 October 2018 23:27
AurelioF wrote:2018-10-26 23:06:49.300 Error: (Rad) 'onHeartbeat' failed 'ValueError':'invalid literal for int() with base 10: 'None''.
2018-10-26 23:06:49.300 Error: (Rad) ----> Line 330 in '/home/pi/domoticz/plugins/MaxCube/plugin.py', function onHeartbeat
2018-10-26 23:06:49.300 Error: (Rad) ----> Line 288 in '/home/pi/domoticz/plugins/MaxCube/plugin.py', function onHeartbeat
2018-10-26 23:06:49.300 Error: (Rad) ----> Line 146 in '/home/pi/domoticz/plugins/MaxCube/plugin.py', function UpdateDevice
Mmm... strange. It's working fine here. It seems it's reading "None" as your valve position, don't know why. I've updated the code again with one minor edit, may help to make it at least not crash in those situations. Can you try this, and put debugging on? This will show more status updates in the log.
2018-10-26 23:58:10.888 Status: (Rad) Started.
2018-10-26 23:58:11.167 (Rad) Debug logging mask set to: PYTHON
2018-10-26 23:58:11.167 (Rad) Debugging mode activated
2018-10-26 23:58:11.167 (Rad) Reading e-Q3 MAX! devices from Cube...
2018-10-26 23:58:11.153 Status: (Rad) Entering work loop.
2018-10-26 23:58:11.154 Status: (Rad) Initialized version 0.6.0, author 'mvzut'
2018-10-26 23:58:13.939 (Rad) Number of rooms found: 9 (highest number: 9)
2018-10-26 23:58:23.461 (Rad) Reading e-Q3 MAX! devices from Cube...
2018-10-26 23:58:26.239 (Rad) Checking device 'WC-Bajo' in room 1
2018-10-26 23:58:26.242 (Rad) Checking device 'Despa' in room 2
2018-10-26 23:58:26.245 (Rad) Checking device 'Pasillo-Superior' in room 3
2018-10-26 23:58:26.247 (Rad) Checking device 'WC-Superior' in room 4
2018-10-26 23:58:26.250 (Rad) Checking device 'Dormitorio' in room 5
2018-10-26 23:58:26.253 (Rad) Checking device 'Invitados-' in room 6
2018-10-26 23:58:26.255 (Rad) Checking device 'Rad-Libreria' in room 7
2018-10-26 23:58:26.258 (Rad) Checking device 'Rad-mesacomedor' in room 7
2018-10-26 23:58:26.261 (Rad) Checking device 'Hall' in room 8
2018-10-26 23:58:26.263 (Rad) Checking device 'Cocina-' in room 9
2018-10-26 23:58:26.264 Error: (Rad) 'onHeartbeat' failed 'TypeError':'unorderable types: NoneType() > int()'.
2018-10-26 23:58:26.264 Error: (Rad) ----> Line 330 in '/home/pi/domoticz/plugins/MaxCube/plugin.py', function onHeartbeat
2018-10-26 23:58:26.264 Error: (Rad) ----> Line 288 in '/home/pi/domoticz/plugins/MaxCube/plugin.py', function onHeartbeat
2018-10-26 23:58:26.264 Error: (Rad) ----> Line 146 in '/home/pi/domoticz/plugins/MaxCube/plugin.py', function UpdateDevice
2018-10-26 23:58:55.815 (Rad) Skipping heartbeat: 1
2018-10-26 23:59:25.816 (Rad) Skipping heartbeat: 2

.....
....
2018-10-27 00:00:28.866 Error: (Rad) 'onHeartbeat' failed 'TypeError':'unorderable types: NoneType() > int()'.
2018-10-27 00:00:28.866 Error: (Rad) ----> Line 330 in '/home/pi/domoticz/plugins/MaxCube/plugin.py', function onHeartbeat
2018-10-27 00:00:28.866 Error: (Rad) ----> Line 288 in '/home/pi/domoticz/plugins/MaxCube/plugin.py', function onHeartbeat
2018-10-27 00:00:28.866 Error: (Rad) ----> Line 146 in '/home/pi/domoticz/plugins/MaxCube/plugin.py', function UpdateDevice

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

Posted: Saturday 27 October 2018 0:03
by AurelioF
The last 4 lines are repeated periodically.

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

Posted: Saturday 27 October 2018 9:51
by mvzut
AurelioF wrote:The last 4 lines are repeated periodically.
Are the valve percentages updated correctly? And did everything work correctly in the previous version? Somehow (one of) your valves report "None" as percentage. I could send you a version with even more logging to find out what's going wrong. But this will have to wait until tomorrow, no time today. In the meantime, you could try the Lua test script from the Domoticz EQ3 Wiki, and check if all valves report their values correctly.

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

Posted: Saturday 27 October 2018 12:12
by AurelioF
mvzut wrote: Saturday 27 October 2018 9:51
AurelioF wrote:The last 4 lines are repeated periodically.
Are the valve percentages updated correctly? And did everything work correctly in the previous version? Somehow (one of) your valves report "None" as percentage. I could send you a version with even more logging to find out what's going wrong. But this will have to wait until tomorrow, no time today. In the meantime, you could try the Lua test script from the Domoticz EQ3 Wiki, and check if all valves report their values correctly.
Until the last update, the operation of the valves was correct, the problems began with the update.
Today I plan to start from the beginning, I will keep you informed.
Thank you

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

Posted: Sunday 28 October 2018 8:52
by AurelioF
I started a clean installation, I'm using Domoticz V. 4.10111, Python Version: 3.5.3, the installation of the plugin worked fine, but after a few minutes it gave an error message.

2018-10-27 20: 57: 19.660 Error: hardware eQ3 (2) thread seems to have ended unexpectedly

After this, no more errors appear, I work all night correctly, but the Heat demand switch never worked, not once.

It seems that - Heat demand does not respond to the heat demands of the valves. :?