ELV Max! Heating control system

For heating/cooling related questions in Domoticz
mvzut
Posts: 270
Joined: Thursday 12 November 2015 11:55
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Marum, The Netherlands
Contact:

ELV Max! Heating control system

Postby mvzut » Saturday 26 November 2016 21:52

jmbjmbjmb wrote:Hi,

I tried the script but it is referring to a json.lua which is not installed by default. Where can I get that file ?

See earlier posts in this thread. Or in the Wiki. Or Google. And if you're lazy, here it is: https://www.domoticz.com/wiki/Lua_-_json.lua
Raspberry Pi 2B - RFXtrx433 - Aeon Z-Stick gen5 - Opentherm Gateway - P1 smart meter - Netatmo - Philips Hue - ELV Max! - ESP8266 DIY water meter - Sonos Connect & PLAY:1 - Kodi - Wall mounted tablet + Imperihome - MANY switches/sensors

jmbjmbjmb
Posts: 46
Joined: Monday 25 January 2016 11:41
Target OS: -
Domoticz version:
Contact:

Re: ELV Max! Heating control system

Postby jmbjmbjmb » Sunday 27 November 2016 0:00

Your sync lua script is working now.

So now, from domoticz, I am getting the following error:
2016-11-26 22:02:00.927 Error: EventSystem: in /home/pi/domoticz/scripts/lua/script_time_max.lua: /home/pi/domoticz/scripts/lua/script_time_max.lua:136: attempt to concatenate field '?' (a nil value)

Line 136 being the following:
table.insert(commandArray, { ['UpdateDevice'] = otherdevices_idx[name]..'|0|'..valve_pos})

mvzut
Posts: 270
Joined: Thursday 12 November 2015 11:55
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Marum, The Netherlands
Contact:

ELV Max! Heating control system

Postby mvzut » Sunday 27 November 2016 1:33

jmbjmbjmb wrote:Your sync lua script is working now.

So now, from domoticz, I am getting the following error:
2016-11-26 22:02:00.927 Error: EventSystem: in /home/pi/domoticz/scripts/lua/script_time_max.lua: /home/pi/domoticz/scripts/lua/script_time_max.lua:136: attempt to concatenate field '?' (a nil value)

Line 136 being the following:
table.insert(commandArray, { ['UpdateDevice'] = otherdevices_idx[name]..'|0|'..valve_pos})

This means that there is no device in Domoticz with the name of your radiator valve (the name as defined in the MAX! configuration, EXACTLY copied with same capitals, spaces, etc.).
Many of the problems people run into are caused by incorrect naming of the devices in Domoticz. I think it is clearly described in the Wiki, but if you still keep having problems: let me repeat my suggestion to use the script that automatically generates the devices!
Raspberry Pi 2B - RFXtrx433 - Aeon Z-Stick gen5 - Opentherm Gateway - P1 smart meter - Netatmo - Philips Hue - ELV Max! - ESP8266 DIY water meter - Sonos Connect & PLAY:1 - Kodi - Wall mounted tablet + Imperihome - MANY switches/sensors

jmbjmbjmb
Posts: 46
Joined: Monday 25 January 2016 11:41
Target OS: -
Domoticz version:
Contact:

Re: ELV Max! Heating control system

Postby jmbjmbjmb » Sunday 27 November 2016 12:56

So, I have deleted everything and ran your script to create the devices and then hit the green arrow as you described.
Just to be clear, I must have the script_time_max.lua script in domoticz/scripts/lua so it gets run every 5 minutes, right ?
Also, I need to have the your sync script ran every 5 minutes using crontab, right ?

So, while everything seemed to work and after no modification to the domoticz config, I am now getting this:
2016-11-27 11:48:01.300 Error: EventSystem: in /home/pi/domoticz/scripts/lua/script_time_max.lua: /home/pi/domoticz/scripts/lua/script_time_max.lua:21: bad argument #1 to 'sub' (string expected, got nil)
2016-11-27 11:48:01.305 EventSystem: Sending SetPoint to device....
2016-11-27 11:48:10.493 Error: EventSystem: Warning!, lua script /home/pi/domoticz/scripts/lua/script_time_max.lua has been running for more than 10 seconds
2016-11-27 11:48:01.308 (MAX!) Thermostat (Couloir)
2016-11-27 11:48:10.498 EventSystem: Script event triggered: /home/pi/domoticz/scripts/lua/script_time_max.lua

and the output of the sync script is:
lua: sync.lua:211: bad argument #2 to 'format' (number has no integer representation)
stack traceback:
[C]: in function 'string.format'
sync.lua:211: in function 'MaxCmdSend'
sync.lua:84: in function 'SetpointSync'
sync.lua:175: in function 'maxCmd_L'
sync.lua:256: in main chunk
[C]: in ?


and if that helps, output of the initial test script:

Code: Select all

Rooms
-----
Salon   08F541
Cuisine
        0B0442
Couloir 08F616
Garcons 08F6D7
Alienor 08F556

Devices
-------
SalonJardin-Rad 08F541
Couloir-Rad     08F616
Alienor-Rad     08F556
Cuisine-Stat    1682FE
Couloir-Stat    16830E
Cuisine-Rad     0B0442
Salon-Stat      09B650
Garcon-Rad      08F6D7
SalonRue-Rad    08F6D4
Garcon-Stat     167981
Alienor-Stat    16778F

Device status
-------------
Thermostat      Couloir-Stat    Setpoint=25.5   Temp=20.1       Valve pos=-1    Battery=OK      Mode=Manual
Valve           SalonRue-Rad    Setpoint=19.5   Temp=19.5       Valve pos=37    Battery=OK      Mode=Manual
Valve           SalonJardin-Rad Setpoint=19.5   Temp=19.5       Valve pos=42    Battery=OK      Mode=Manual
Valve           Alienor-Rad     Setpoint=17.0   Temp=0.0        Valve pos=8     Battery=OK      Mode=Manual
Thermostat      Garcon-Stat     Setpoint=19.0   Temp=19.9       Valve pos=-1    Battery=OK      Mode=Manual
Valve           Couloir-Rad     Setpoint=25.5   Temp=0.0        Valve pos=100   Battery=OK      Mode=Manual
Thermostat      Cuisine-Stat    Setpoint=18.0   Temp=20.5       Valve pos=-1    Battery=OK      Mode=Manual
Valve           Cuisine-Rad     Setpoint=18.0   Temp=0.0        Valve pos=18    Battery=OK      Mode=Manual
Thermostat      Salon-Stat      Setpoint=19.5   Temp=19.5       Valve pos=-1    Battery=OK      Mode=Manual
Thermostat      Alienor-Stat    Setpoint=17.0   Temp=20.3       Valve pos=-1    Battery=OK      Mode=Manual
Valve           Garcon-Rad      Setpoint=19.0   Temp=0.0        Valve pos=53    Battery=OK      Mode=Manual

mvzut
Posts: 270
Joined: Thursday 12 November 2015 11:55
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Marum, The Netherlands
Contact:

ELV Max! Heating control system

Postby mvzut » Sunday 27 November 2016 14:54

jmbjmbjmb wrote:So, I have deleted everything and ran your script to create the devices and then hit the green arrow as you described.
Just to be clear, I must have the script_time_max.lua script in domoticz/scripts/lua so it gets run every 5 minutes, right ?
Also, I need to have the your sync script ran every 5 minutes using crontab, right ?

No. I think you missed that part in the post that explained it, one page back:
viewtopic.php?f=34&t=841&start=460#p104705
You only need the script that is started by crontab every 5 minutes (maxscript.lua or sync.lua or whatever you want to call it).
The error messages from the "old" script are caused by the fact that both scripts are interfering with each other, since they both try to do the same.

I see you have a lot of devices, it could be a pain in the *ss to find out which "Unknown" device is which. You could probably be helped by my tip, already mentioned a few pages back:
mvzut wrote:By the way, there's a little trick you could use which will make it easier to find out which newly created Domoticz device belongs to which MAX! module: if you run the maxtest.lua script from the Wiki, it will show an address for each module. In the devices page of Domoticz, al new "Unknown" devices use this address as their ID. This should make it easy to find which MAX! module it belongs to.
I later found that in my system, this appears not to be the case for the temperature sensors, strangely enough. But at least the valve positions and thermostat setpoints can easily be linked to a device in this way.

Maybe I should extend the Wiki with this method, or create an alternative Wiki for this, to avoid that people have to read all these pages...
Raspberry Pi 2B - RFXtrx433 - Aeon Z-Stick gen5 - Opentherm Gateway - P1 smart meter - Netatmo - Philips Hue - ELV Max! - ESP8266 DIY water meter - Sonos Connect & PLAY:1 - Kodi - Wall mounted tablet + Imperihome - MANY switches/sensors

jmbjmbjmb
Posts: 46
Joined: Monday 25 January 2016 11:41
Target OS: -
Domoticz version:
Contact:

Re: ELV Max! Heating control system

Postby jmbjmbjmb » Wednesday 30 November 2016 0:20

Hi,

Following your pieces of advice (thanks a lot BTW), I have finally managed to get the temperature working as expected.

I'm only having this error message (even though everything seems to be working fine) each time the lua script runs:
2016-11-29 23:15:00.704 Error: EventSystem: in /home/pi/domoticz/scripts/lua/script_time_max.lua: /home/pi/domoticz/scripts/lua/script_time_max.lua:151: attempt to concatenate field '?' (a nil value)


Next goal is to turn the boiler on/off using the logic of your script. I currently have a shell script that can turn my boiler on/off but I don't quite understand how to make this fit your lua script (and I am also not really sure to understand all the steps you describe... e.g., I do not understand how the lua script gets triggered ...). Could you please kindly give some guidance on this ?

Thanks a lot

mvzut
Posts: 270
Joined: Thursday 12 November 2015 11:55
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Marum, The Netherlands
Contact:

ELV Max! Heating control system

Postby mvzut » Wednesday 30 November 2016 9:58

jmbjmbjmb wrote:Hi,

Following your pieces of advice (thanks a lot BTW), I have finally managed to get the temperature working as expected.

I'm only having this error message (even though everything seems to be working fine) each time the lua script runs:
2016-11-29 23:15:00.704 Error: EventSystem: in /home/pi/domoticz/scripts/lua/script_time_max.lua: /home/pi/domoticz/scripts/lua/script_time_max.lua:151: attempt to concatenate field '?' (a nil value)


Next goal is to turn the boiler on/off using the logic of your script. I currently have a shell script that can turn my boiler on/off but I don't quite understand how to make this fit your lua script (and I am also not really sure to understand all the steps you describe... e.g., I do not understand how the lua script gets triggered ...). Could you please kindly give some guidance on this ?

Thanks a lot

I see that you decide to use the "older" script which requires you to create your own devices with the names as shown in the Wiki? That's fine, but please don't forget to disable the script that runs via crontab in that case. They should not run simultaneously.

The error message means that you don't have certain devices, I suspect it's the temperature devices with the names of the rooms the wall thermostats are placed in (copy room names exactly as defined in the MAX! configuration web page). That's the "disadvantage" of the original script, most problems (see the many posts on previous pages) occur because of incorrect naming or missing devices.

About the triggering of the boiler: there is a script on the Wiki for that, but it's not mine. Maybe the author of that one can help you. I have something similar but this is specifically tailored to my situation (I have e.g. an OTGW to control my boiler). Every situation is unique, so it may be difficult to give you a script that works out of the box. Although the one in the Wiki comes close I think.
Raspberry Pi 2B - RFXtrx433 - Aeon Z-Stick gen5 - Opentherm Gateway - P1 smart meter - Netatmo - Philips Hue - ELV Max! - ESP8266 DIY water meter - Sonos Connect & PLAY:1 - Kodi - Wall mounted tablet + Imperihome - MANY switches/sensors

jmbjmbjmb
Posts: 46
Joined: Monday 25 January 2016 11:41
Target OS: -
Domoticz version:
Contact:

Re: ELV Max! Heating control system

Postby jmbjmbjmb » Wednesday 30 November 2016 17:49

Thanks.
This isn't the first time you mention that I am using an old script but basically I just took what was available in the Wiki (here: https://www.domoticz.com/wiki/EQ3_MAX !). That script has been there for probably a while as the last modification of the wiki is Nov 9.
Is the "new" script to be found somewhere ?

As for the boiler, I basically wanted to reuse the logic of the script available on the wiki (don't know who wrote that one if not you) because checking the valve percentage probably makes sense.

Skippiemanz
Posts: 257
Joined: Sunday 14 July 2013 20:21
Target OS: Raspberry Pi
Domoticz version: 3.5859
Location: Alkmaar, The Netherlands
Contact:

Re: ELV Max! Heating control system

Postby Skippiemanz » Wednesday 30 November 2016 18:14

Mvzut means that you have to use the crontab script a few posts back. For the boiler switching. Just use the CV_Switch used in the scripts and execute your bash/shell script from the on/off action. That's the way I use it right now. But I'm interested in mvzut his OTGW script/solution

jmbjmbjmb
Posts: 46
Joined: Monday 25 January 2016 11:41
Target OS: -
Domoticz version:
Contact:

Re: ELV Max! Heating control system

Postby jmbjmbjmb » Wednesday 30 November 2016 18:34

My understanding was that I need to run the script_time_max.lua (from domoticz) AND run the script that detects the devices using crontab.
Is that right ?

I just remove the script_time_max.lua script and let the other run from crontab... and that seems to be good enough.

What I don't get now is how the script_time-Valves.lua script gets triggered. I have created the switches as described but nothing happens (not seeing the valves script being launched when looking at the domoticz logs).

jmbjmbjmb
Posts: 46
Joined: Monday 25 January 2016 11:41
Target OS: -
Domoticz version:
Contact:

Re: ELV Max! Heating control system

Postby jmbjmbjmb » Thursday 01 December 2016 0:11

OK, so I figured that the script must be named script_time_Valves.lua (instead of script_time-Valves.lua as mentioned on the wiki) to be launched.

I am now having a problem for 1 particular room where I have 2 rads and 1 wall thermostat. As 2 rads can't have the same name, I was advised to name them like:
room-north-Rad
room-south-Rad
and room-Stat for the wall thermostat

and because of that, the script fails to link the rads and their wall thermostat

Any clue how to get around this issue ?

thanks

User avatar
blackdog65
Posts: 535
Joined: Tuesday 17 June 2014 18:25
Target OS: Raspberry Pi
Domoticz version:
Location: Norfolk, UK
Contact:

Re: ELV Max! Heating control system

Postby blackdog65 » Thursday 01 December 2016 10:08

Hiya,
just a quick attempt at an answer as I'm away from home at the moment.
Try renaming
room-north-Rad -> RoomNorth-Rad
room-south-Rad -> RoomSouth-Rad
as it may be the extra hyphen that it doesn't like.

I'll try and help more when I get back. The script was written by someone else and then, with their kind help, tailored to my situation. I put it on the wiki as an example of how I use it. Hopefully it won't take much modding to suit any circumstance.

Sean
CubieTruck Master
RasPi slaves
Aeon Labs Z-Stick, multi sensor
Fibaro Dimmers, relays, Universal sensors
EQ3 MAX!
TKB Sockets
RFXCOM
LightwaveRF sockets, switches, relays, doorbell
MySensors
ESPEasy ESP8266-12E

jmbjmbjmb
Posts: 46
Joined: Monday 25 January 2016 11:41
Target OS: -
Domoticz version:
Contact:

Re: ELV Max! Heating control system

Postby jmbjmbjmb » Friday 02 December 2016 11:44

So, I've managed to work around the issue with 2 rads in 1 room with some changes in the lua script. Everything is working fine.
Though, I am (and had that issue even before getting started with domoticz) still observing that valves remain quite too open when the target temperature has been reached. I know it should not be binary (like put 0% when set temp has been reached and 100% if current is below target).

As a result, some rooms maintain a current temperature that is 1 to 3 degrees beyond set temperature.

So, I understand that this is a pure EQ-3 issue but I was wondering if some people on this thread had the same problem.

User avatar
Westcott
Posts: 514
Joined: Tuesday 09 December 2014 18:04
Target OS: Raspberry Pi
Domoticz version: Beta
Location: UK - Glos
Contact:

Re: ELV Max! Heating control system

Postby Westcott » Friday 02 December 2016 11:52

Yes. I have an individual setpoint offset for each valve.
When the room is up to temperature the valve's offset is added, usually -2 degrees.
Zwave - Sigma Z+ stick, Fibaro 2x FGSD002, FGMS001, Horstmann - 2x HRT4, 2x C-stat-11,
4x ASR-ZW, Aeon Micro Switch, 2x TKB TZ68E
Max-EQ Cube, Valve
RFXtrx433E, RFlink - 1byone driveway, doorbell, Oregon and BangGood temp
Wifi - YeeLight RGB, 3x ESP8266

jmbjmbjmb
Posts: 46
Joined: Monday 25 January 2016 11:41
Target OS: -
Domoticz version:
Contact:

Re: ELV Max! Heating control system

Postby jmbjmbjmb » Friday 02 December 2016 12:06

Thanks for the reply.
One more question: if I put an offset of e.g., -2 does that mean that the wall thermostat will show 19 when it is actually 21 (which I would not like) or does that mean that it will consider the target reached 2 degrees lower (i.e., when the current is 17, the rad will consider the target of 19 to be reached).

I just want to make sure that the shown temperature is "real"

User avatar
Westcott
Posts: 514
Joined: Tuesday 09 December 2014 18:04
Target OS: Raspberry Pi
Domoticz version: Beta
Location: UK - Glos
Contact:

Re: ELV Max! Heating control system

Postby Westcott » Friday 02 December 2016 12:30

The wall thermostat is unchanged.
It's only the valve's setpoint that is set -2 lower, and only when the room is up to temperature.
When the room is heating, valve = setpoint.
Like you, I noticed that the VALVE temperature has to be more than 2 degrees higher than its setpoint for the valve to be fully closed (0% open).

In my case I ADD 0.5 degrees to the valve setpoint when it is warming, because that is what my wife will see...
Zwave - Sigma Z+ stick, Fibaro 2x FGSD002, FGMS001, Horstmann - 2x HRT4, 2x C-stat-11,
4x ASR-ZW, Aeon Micro Switch, 2x TKB TZ68E
Max-EQ Cube, Valve
RFXtrx433E, RFlink - 1byone driveway, doorbell, Oregon and BangGood temp
Wifi - YeeLight RGB, 3x ESP8266

1970sITman
Posts: 8
Joined: Sunday 02 February 2014 15:10
Target OS: Raspberry Pi
Domoticz version:
Location: NW London, UK
Contact:

Re: ELV Max! Heating control system

Postby 1970sITman » Friday 02 December 2016 20:09

Gents,

Long time user (3 years or so) of MAX! hardware using Max!buddy as 'read only' interface to Domoticz.

Not looked at the forum for a good few months so VERY surprised (and pleased) to find how far you have developed the two way communication to Domoticz.

So.....dived in headfirst this evening with a spare cube, thermostat and valve

.........only to fall at the first hurdle installing the LUA modules on a spare Pi !

At the 4th install line in the Wiki sudo luarocks install luasec, i get

Warning: Failed searching manifest: Failed loading manifest: Failed fetching manifest for http://luarocks.org/repositories/rocks - Error fetching file: Failed downloading http://luarocks.org/repositories/rocks/manifest - URL redirected to unsupported protocol - install luasec to get HTTPS support.
Error: No results matching query were found.


Tried the options further down the Wiki with the same result.

Suggestions please?

Thanks
4 pi(master+RFXtrx433 and 3 slaves+PiFace)
HE, BBSB, Lightwave, Micromark, Retrotouch & LIVOLO sockets, door switches, PIRs & Dimmers
EVE on iPad for Voice
Weather sensors
OWL CM160
eQ-3 MAX! Heating Controls (10 therms, 8 valves, 2 relays)

jmbjmbjmb
Posts: 46
Joined: Monday 25 January 2016 11:41
Target OS: -
Domoticz version:
Contact:

Re: ELV Max! Heating control system

Postby jmbjmbjmb » Saturday 03 December 2016 0:01

Westcott wrote:The wall thermostat is unchanged.
It's only the valve's setpoint that is set -2 lower, and only when the room is up to temperature.
When the room is heating, valve = setpoint.
Like you, I noticed that the VALVE temperature has to be more than 2 degrees higher than its setpoint for the valve to be fully closed (0% open).

In my case I ADD 0.5 degrees to the valve setpoint when it is warming, because that is what my wife will see...



Using the Max! app, I have set the offset to -2. The app did not let me set this to the Valve (i.e., when I click on the toom name and then device seetting, then offset it show the wall thermostat only).
As a result the current temperature which was 19.5 just dropped to 17.5. So as a result, this room will be even further overwarmed. Did I misunderstnd something ? Should I remove the wall thermostat, set that offset to the valve and then install the wall thermostat again ?

User avatar
Westcott
Posts: 514
Joined: Tuesday 09 December 2014 18:04
Target OS: Raspberry Pi
Domoticz version: Beta
Location: UK - Glos
Contact:

Re: ELV Max! Heating control system

Postby Westcott » Saturday 03 December 2016 0:51

Hi Jmbjmbjmb,

I was saying how to do it with a Lua script control, I've no idea how to do it with the Max! app.
The Lua scripts were developed so that the Max! app was not needed.
Zwave - Sigma Z+ stick, Fibaro 2x FGSD002, FGMS001, Horstmann - 2x HRT4, 2x C-stat-11,
4x ASR-ZW, Aeon Micro Switch, 2x TKB TZ68E
Max-EQ Cube, Valve
RFXtrx433E, RFlink - 1byone driveway, doorbell, Oregon and BangGood temp
Wifi - YeeLight RGB, 3x ESP8266

ThaButcha
Posts: 1
Joined: Friday 02 December 2016 18:57
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: ELV Max! Heating control system

Postby ThaButcha » Sunday 04 December 2016 0:18

I followed the instructions on the wiki and have some problems with Lua5.2. I know my way around in Linux, but am not really familiar with Lua or fixing library problems.

If I run the test script to scan for the radiators. It finds the radiators but then crashes at the device status:

Device status
-------------
lua: maxtest.lua:115: attempt to concatenate global 'setpoint' (a nil value)
stack traceback:
maxtest.lua:115: in function 'maxCmd_L'
maxtest.lua:148: in main chunk
[C]: in ?


The other script gives the following in the domoticz logs:

2016-12-03 22:13:00.404 Error: EventSystem: in /home/pi/domoticz/scripts/lua/script_time_max.lua: /usr/local/share/lua/5.2/socket.lua:12: module 'socket.core' not found:
no field package.preload['socket.core']
no file '/usr/local/share/lua/5.2/socket/core.lua'
no file '/usr/local/share/lua/5.2/socket/core/init.lua'
no file '/usr/local/lib/lua/5.2/socket/core.lua'
no file '/usr/local/lib/lua/5.2/socket/core/init.lua'
no file './socket/core.lua'
no file '/usr/local/lib/lua/5.2/socket/core.so'
no file '/usr/local/lib/lua/5.2/loadall.so'
no file './socket/core.so'
no file '/usr/local/lib/lua/5.2/socket.so'
no file '/usr/local/lib/lua/5.2/loadall.so'
no file './socket.so'


I did install the luarocks packages, with SSL and created /usr/local/share/lua/5.2 and moved the .so files, but still no dice.

any suggestions?


Return to “Heating/cooling”

Who is online

Users browsing this forum: Google [Bot] and 2 guests