Page 28 of 37

Re: ELV Max! Heating control system

Posted: Saturday 20 May 2017 13:50
by damien7400
damien7400 wrote:
jmbjmbjmb wrote:Hi,

Instead of using netcat, you could use the MaxCmdSend function of the lua time script
Hello, I don't know why, it doesn't run,
I've explored the scripts, and test the MaxCmdSend but only the manual function run properly, Auto and Boost are not recognized ('maybe?)
Hello !!

I've found a problem...
After a lot of problem / stability losses, PI reinstalled, I've logged all the script variables and commands, and found this:
instead of: "http://127.0.0.1:8080/json.htm?type=command&param=udevice&idx=18&nvalue=0&svalue=19"
domoticz send: "http://127.0.0.1:8080/json.htm?type=command%C2%B6m=udevice&idx=18&nvalue=0&svalue=19"
thta's the result of:

Code: Select all

table.insert(commandArray, { ['OpenURL'] = 'http://127.0.0.1:'..DomoticzPort..'/json.htm?type=command&param=udevice&idx='..otherdevices_idx[name]..'&nvalue=0&svalue='..setpoint})
in the script_time_max

Is this a format text problem ? Maybe have I saved the script in the false code format (UTF8...) ?

Re: ELV Max! Heating control system

Posted: Saturday 20 May 2017 14:43
by Westcott
It's the browser replacing &para with the paragraph code.

Re: ELV Max! Heating control system

Posted: Saturday 20 May 2017 18:44
by damien7400
Westcott wrote:It's the browser replacing &para with the paragraph code.
doesn't work anymore,

i've found a solution, in the script call: "table.insert(commandArray, { ['UpdateDevice'] = otherdevices_idx[name]..'|0|'..setpoint})"
instead of:"commandArray, { ['OpenURL'] = "http://127.0.0.1:"..DomoticzPort.."/json.htm?type=command&param=udevice&idx="..otherdevices_idx[name].."&nvalue=0&svalue="..setpoint})"

it's running fine now :)

Re: ELV Max! Heating control system

Posted: Friday 14 July 2017 11:53
by ronh123
Anyone knows where I have to start looking when getting this error:
Error: EventSystem: in /home/pi/domoticz/scripts/lua/script_time_max.lua: /home/pi/domoticz/scripts/lua/script_time_max.lua:235: expected near 'Place'
Thanks Ron

Re: ELV Max! Heating control system

Posted: Saturday 15 July 2017 15:57
by damien7400
ronh123 wrote:Anyone knows where I have to start looking when getting this error:
Error: EventSystem: in /home/pi/domoticz/scripts/lua/script_time_max.lua: /home/pi/domoticz/scripts/lua/script_time_max.lua:235: expected near 'Place'
Thanks Ron
Open the script (with file/text editor), go to the line N°235, something miss near "Place"

Re: ELV Max! Heating control system

Posted: Thursday 20 July 2017 11:01
by ronh123
Thanks, I found the problem. Now I get:
Error: EventSystem: in /home/pi/domoticz/scripts/lua/script_time_max.lua: /home/pi/domoticz/scripts/lua/script_time_max.lua:137: attempt to concatenate field '?' (a nil value)
Any suggections where to start?
Thanks Ron

Re: ELV Max! Heating control system

Posted: Tuesday 05 September 2017 13:55
by bilbolodz
mvzut wrote: Thursday 10 November 2016 0:29 Is anybody willing to test this alternative script_time_max.lua script?
I was using your script (crontab version) for some time and I was very happy with it. Yesterday I've added two additional "window open sensor" and your script stooped working. (I've added some debug code to it). Could you please help me?

Code: Select all

root@domoticz:~# lua  /home/pi/domoticz/scripts/lua/maxscript.lua
L_hex:	0B13421509000000000000000C16864B0912000024000000DF06005D78090000060985EA0900000B1342370912180024000000060FB2B40900000B140CBF09000000000000000B100C6409000000000000000B13EDAA090000000000000006005CB50900000B100C8A09000000000000000614DD830900000B140D030900000000000000060FAC8A0900000600230E0900000B13EC7309000000000000000C1678CD090000000000000000
pos: 	1
s:	0B
data_len: 	12
hex: 	0B13421509000000000000000
3
09/05/17 13:54:43 Domoticz setpoint Piotr zawor set to 0 degrees
pos: 	25
s:	0C
data_len: 	13
hex: 	0C16864B0912000024000000DF0
2
pos: 	51
s:	06
data_len: 	7
hex: 	06005D780900000
nil
lua: /home/pi/domoticz/scripts/lua/maxscript.lua:163: bad argument #2 to 'format' (number expected, got nil)
stack traceback:
	[C]: in function 'format'
	/home/pi/domoticz/scripts/lua/maxscript.lua:163: in function 'maxCmd_L'
	/home/pi/domoticz/scripts/lua/maxscript.lua:266: in main chunk
	[C]: in ?

Re: ELV Max! Heating control system

Posted: Saturday 09 September 2017 17:38
by mvzut
bilbolodz wrote: Tuesday 05 September 2017 13:55
mvzut wrote: Thursday 10 November 2016 0:29 Is anybody willing to test this alternative script_time_max.lua script?
I was using your script (crontab version) for some time and I was very happy with it. Yesterday I've added two additional "window open sensor" and your script stooped working. (I've added some debug code to it). Could you please help me?
Is it correct that line 163 in your script reads

Code: Select all

    room_num = string.format("%02X", Room_nums[adr])
?

Apparently, the array "Room_nums" did not get a value for at least one device (could be the new door/window sensors). Each device schould have a room number. Did you assign the door/window sensors to rooms in the MAX configuaration tool? To check if every device is correctly recognized, you can add the following debug line after "Types[adr] = dtype" (which is located at the end of the maxCmd_M(data) function):

Code: Select all

print(room_num .. ' ' .. name .. ' ' .. adr .. ' ' .. dtype)
And post the output here

Re: ELV Max! Heating control system

Posted: Saturday 09 September 2017 23:55
by Peggy
Hello,

I've been looking at the market for a while, I saw two options for controlling my 8 radiators :

- Zwave Danfoss popp or LC13
- This Max! solution

Can you tell me whether it is still a good option to go with ELV Max! products starting from scratch?
Because price does matter, I'm ok to spend a bit more time for setting up the Max! solution if all gets perfectly stable and reliable then. Is the cube radio range is enough to control a two storey house?

My current setup is :
- Windows Server
- Domoticz
- Eventghost for my Python scripts/scenarios rather than domoticz, when possible.

Last question : which item should I buy? I can see three. I would prefer the more silent / more efficient.

https://www.amazon.de/Max-99017A0-MAX-H ... digidip-21

Image

Image

Image

Thank you by advance for your help, winter is coming :mrgreen:

ELV Max! Heating control system

Posted: Sunday 17 September 2017 16:32
by mvzut
Peggy wrote:Hello,

I've been looking at the market for a while, I saw two options for controlling my 8 radiators :

- Zwave Danfoss popp or LC13
- This Max! solution

Can you tell me whether it is still a good option to go with ELV Max! products starting from scratch?
Because price does matter, I'm ok to spend a bit more time for setting up the Max! solution if all gets perfectly stable and reliable then. Is the cube radio range is enough to control a two storey house?

My current setup is :
- Windows Server
- Domoticz
- Eventghost for my Python scripts/scenarios rather than domoticz, when possible.

Last question : which item should I buy? I can see three. I would prefer the more silent / more efficient.
[...]
Thank you by advance for your help, winter is coming :mrgreen:
Hi,

I can't say much about the Danfoss system as I have never used it. But I'm very happy with my Max! system. With the crontab script, Domoticz integration is fairly simple once you have configured the system via Max!'s own web based configuration tool. I did have some issues with my cube "forgetting" its complete configuration once in a while. It doesn't seem to like bring polled so often, I suppose this is a bug. But I solved this by regularly (once a week) power cycling the unit (automated in Domoticz using a z-wave switch).

I'm using the first thermostat in your overview. It's not only the smallest and the cheapest, but also the most quiet. You don't need the built-in programming functions of the last one since you will probably be doing your programming from Domoticz anyway.

Please be aware that the system becomes much more user friendly if you buy a wall mounted thermostat (I believe they are 20-30 euros) for each room. This allows you to read the actual temperature in the room continuously, the radiator valves only report temperature when they are communicating to the cube which is only when they are changing valve position (I assume this is to save battery). Plus, manual override of the room setpoint is much easier from such a wall mounted thermostat than from the radiator valves.

UPDATE
I just noticed the wall mounted thermostat has become more expensive, it's now almost 40 euros, I believe I paid less two years ago. Maybe you can find a good combination deal somewhere, I bought much of my stuff from Conrad but Amazon also had good deals sometimes.

Re: ELV Max! Heating control system

Posted: Sunday 17 September 2017 19:17
by Peggy
Thank you for your detailed answer.
In the meantime I ordered and received the Cube, and a basic thermostatic head will come in a few days (the same than yours). Some doubts concerning your message :

- You talk about "Max!'s own web based configuration tool". You did'nt talk about max!buddy. I'm a bit confused, I thought this one was mandatory as a gateway between max! cube and domoticz

- You talk about a crontab script, but I'm under windows, I don't know if it is possible to set up a crontab in windows.

- About the wall thermostat, I can get the max! one for 27€, so the price is ok. But I already have a temp sensor in the most important rooms (I have 4 bedroom, 2 verandas, 2 living room, 2 kitchen, 2 bathrooms etc.), and a home made custom touch screen in the living room that will evolve with heating control options in the future (see picture under). I you think that a max thermostat brings better comfort (for instance changing temperature), I'm listening to you (you talked about manual override, this is a good reason, but I have so many rooms...).

Image

ELV Max! Heating control system

Posted: Sunday 17 September 2017 22:04
by mvzut
Peggy wrote:- You talk about "Max!'s own web based configuration tool". You did'nt talk about max!buddy. I'm a bit confused, I thought this one was mandatory as a gateway between max! cube and domoticz
No, max!buddy is not necessary anymore, my scripts (based on the work of others) communicate directly with the Cube.
Peggy wrote:- You talk about a crontab script, but I'm under windows, I don't know if it is possible to set up a crontab in windows.
Oops, you mentioned that, forgot about that. It is possible, using Windows Task Scheduler. Simply add a task that runs every 5 minutes, starting my script from Lua. The command that is started would be something like "c:\program files\lua\lua.exe c:\program files\Domoticz\scripts\lua\maxscript.lua" (first install Lua for Windows). I haven't tried it, it should work but if you're not so familiar with these things it could be a bit complex. Another solution is to use the standard lua script, as explained a number of posts earlier. That scenario requires you to manually create dummy devices with exactly the right names for each Max! device you have.
Peggy wrote:- About the wall thermostat, I can get the max! one for 27€, so the price is ok. But I already have a temp sensor in the most important rooms (I have 4 bedroom, 2 verandas, 2 living room, 2 kitchen, 2 bathrooms etc.), and a home made custom touch screen in the living room that will evolve with heating control options in the future (see picture under). I you think that a max thermostat brings better comfort (for instance changing temperature), I'm listening to you (you talked about manual override, this is a good reason, but I have so many rooms...).
You can do without. If it's just for setting thermostat setpoints on certain times or depending on certain events, then you don't need them, and it's probably best to not even create the temperature device for each radiator valve within Domoticz (as it gets updated so irregularly). Just use the Domoticz thermostat devices for each valve, and program whatever timer or (blockly) script you want for them. You can add setpoint control functionality to your (beautiful!) touch screen, even nicer than the wall mounted thermostats!

(By the way, I have both: wall mounted thermostats in two bedrooms, plus a wall mounted tablet in the living room that can also control the setpoints. I prefer this solution because I want to make it as easy as possible for the users of those rooms to control things, it all adds to the WAF ;-). My son can change the setpoint of his room to whatever he wants, whenever he wants, but it always gets reset at night and when leaving home, or when he leaves his door or window open.)

Re: ELV Max! Heating control system

Posted: Sunday 17 September 2017 22:42
by Peggy
Thank you for your precious help. The information is well hidden, it is easy to get lost when reading this thread.
I'll dig into this story of LUA. To be honnest, unitl now I've been working away from LUA, all my scripts and scenarios are executed in pure python, in an "event based python engine" called Eventghost. This app discusses with domoticz as well as with almost all my gateways (DS18B20, rflink, broadlink, etc.).

I'll look at your lua script (if I'm not too lost, the last version is located here), but maybe I would save time by working directly with a max! python library.

By the way, until now I did'nt understand what you all meant by "switch the boiler", because I didn't imagine it would be a good idea to start/stop the boiler before reading about this. I just discovered how to switch on/off my boiler using a relay, so I'll add this feature in my setup.

ELV Max! Heating control system

Posted: Sunday 17 September 2017 23:18
by mvzut
Peggy wrote:Thank you for your precious help. The information is well hidden, it is easy to get lost when reading this thread.
I'll dig into this story of LUA. To be honnest, unitl now I've been working away from LUA, all my scripts and scenarios are executed in pure python, in an "event based python engine" called Eventghost. This app discusses with domoticz as well as with almost all my gateways (DS18B20, rflink, broadlink, etc.).

I'll look at your lua script (if I'm not too lost, the last version is located here), but maybe I would save time by working directly with a max! python library.

By the way, until now I did'nt understand what you all meant by "switch the boiler", because I didn't imagine it would be a good idea to start/stop the boiler before reading about this. I just discovered how to switch on/off my boiler using a relay, so I'll add this feature in my setup.
I know Eventghost, I've used it a lot in the past. At a certain moment, almost everything I did with it could also be done directly in Domoticz, so my approach was to completely phase out Eventghost. I finally succeeded in that with the availability of the Sonos plugin in Domoticz.
By the way, it is possible to control Max! from Python, I've seen scripts for it. In fact, my wish is to once create a "real" plug-in for Max! using the new Python framework. I only have to find the time...

Re: ELV Max! Heating control system

Posted: Monday 18 September 2017 0:09
by Westcott
I'm using the Python library 'maxcube'

Code: Select all

#!/usr/local/bin/python3

import socket
import time

from maxcube.cube import MaxCube
from maxcube.connection import MaxCubeConnection

class Cube:
    def __init__(self, utils=None):
        try:
            self.mconfig  = utils.config["MaxCube"]
            self.CubeName = self.mconfig.get('name', 'KEQ0539717')
            self.Port     = self.mconfig.getint('port', 62910)
            self.UTILS    = utils
            self.LOG      = utils.LOG
            self.Cube     = MaxCube(MaxCubeConnection(self.CubeName, self.Port))
            self.prev     = '18'
        except (socket.timeout, socket.error) as e:
            print('** Cube init error: {} **'.format(e))

    def GetDeviceMode(self, mode):
    
        if mode==0:
            smode="Auto"
            dmode=10
        elif mode==1:
            smode="Manual"
            dmode=20
        elif mode==2:
            smode="Holiday"
            dmode=30
        elif mode==3:
            smode="Boost"
            dmode=40
            
        return smode, dmode
 
    def Read(self):
        tries = 0
        maxTries = 5
        
        while tries < maxTries:
            try:
                if self.Cube == None:
                    self.LOG.Log("Cube connecting...")
                    self.Cube = MaxCube(MaxCubeConnection(self.CubeName, self.Port))
                else:
                    self.Cube.update()
                    
                for device in self.Cube.devices:
                    name = device.rf_address
                    temp = device.actual_temperature
                    
                    if temp == None:
                        temp = self.prev
                        if temp == None:
                            temp = self.UTILS.svals[name]

                    self.UTILS.UpdateDevice(name, temp)
                    self.prev = temp
                        
                    setp = str(device.target_temperature)
                    pos  = str(device.valve_position)
                    smode, dmode = self.GetDeviceMode(device.mode)
                    self.UTILS.UpdateDevice(name + ' setpoint', setp)
                    self.UTILS.UpdateDevice(name + ' valve', pos )
    #                self.UTILS.UpdateDevice(name + ' mode', smode + "|" + str(dmode))
                    msg = "{} Setpoint={}° Temp={}° Valve pos={}% Mode={}".format(name, setp, temp, pos, smode)
    #                self.LOG.Log(msg)
                    self.UTILS.SendMessage(msg)
                    self.UTILS.OLED.TextLine('{} {} {}'.format(temp, setp, pos), 4)
                    
                return True

            except (socket.timeout, socket.error) as e:
                self.LOG.Log('** Cube read error: {} **'.format(e))
                tries+=1
                time.sleep(tries+1)

        self.LOG.Log('** Cube read failed **')
        return False
            
    def SetSetpoint(self, name, sp):
        for device in self.Cube.devices:
            addr = device.rf_address
            setp = float(device.target_temperature)
                
            if name == addr and sp != setp:
                tries = 0
                maxTries = 5
                
                if sp < setp:
                    dir = "🡳"
                else:
                    dir = "🡱"
                
                while tries < maxTries:
                    try:
                        self.Cube.set_target_temperature(device, sp)
                        msg = "CUBE Setpoint {} {} {}".format(setp, dir, sp)
                        self.LOG.Log(msg)
                        self.UTILS.SendMessage(msg)
                        return True

                    except (AttributeError, socket.timeout, socket.error) as e:
                        self.LOG.Log('** Cube setpoint error: {} **'.format(e))
                        tries+=1
                        time.sleep(tries+1)
                    
        self.LOG.Log('** Cube setpoint failed for {} **'.format(name))
        return False
        

Re: ELV Max! Heating control system

Posted: Monday 18 September 2017 11:36
by Peggy
mvzut,

Your script is interesting, I wish it was in python, but anyway (I won't have time to convert it).
Can you explain this logic?

Code: Select all

if tonumber(setpoint_Domoticz) ~= setpoint_MAX then
    if age(LastUpdate) > interval * 60 then -- Domoticz thermostat value must be updated
		blah
	elseif setpoint_Domoticz ~= setpoint_DoorOpen then -- MAX! setpoint must be updated
		blah

What I understand :

Code: Select all

if domoticz setpoint is different from max setpoint then
    if domoticz setpoint was not changed recently
	     update domoticz setpoint using max value
	else if domoticz setpoint is different from "Door open" setpoint
		update max setpoint using domoticz value

Why isn't there the third condition : "else update max setpoint using door open value" ? Maybe because it is directly managed by the cube?

Another thing, in the function ReadThermostat you wrote :

Code: Select all

result, statuscode, content = http.request('http://127.0.0.1:'..DomoticzPort..'/json.htm?type=devices')
  r,e = json:decode(result)
This means you request and parse all Domoticz devices once for each max! device (Domoticz will return 400+ devices in my setup). This call should be outside the ReadThermostat function, called only once.

Furthermore, I wonder how to use an external temperature sensor. In your script I see we can send the setpoint to the valve, but not the actual temp. Is it possible to emulate the WMT and send the actual temp to the valve?

One last thing, how do I force the valves to "holiday", boost?

Re: ELV Max! Heating control system

Posted: Monday 18 September 2017 16:23
by mvzut
Peggy wrote: Monday 18 September 2017 11:36 mvzut,

Your script is interesting, I wish it was in python, but anyway (I won't have time to convert it).
Can you explain this logic?

Code: Select all

if tonumber(setpoint_Domoticz) ~= setpoint_MAX then
    if age(LastUpdate) > interval * 60 then -- Domoticz thermostat value must be updated
		blah
	elseif setpoint_Domoticz ~= setpoint_DoorOpen then -- MAX! setpoint must be updated
		blah

What I understand :

Code: Select all

if domoticz setpoint is different from max setpoint then
    if domoticz setpoint was not changed recently
	     update domoticz setpoint using max value
	else if domoticz setpoint is different from "Door open" setpoint
		update max setpoint using domoticz value

Why isn't there the third condition : "else update max setpoint using door open value" ? Maybe because it is directly managed by the cube?
Goal of this part is to synchronize setpoints in two directions: If the setpoint was changed by Domoticz, the new value should be written to the Cube. But if the setpoint was changed outside of Domoticz, I want Domoticz to take over this new value, and not write the old value back to the Cube. First I just had an "else" statement as second statement, but hen I added a door sensor, which sometimes causes the setpoint to be temporarily overwritten with a "door open" setpoint. As you suspected, this is directly managed by the Cube, there is no way to intervene in that process other than disabling this functionality altogether. I wanted to keep it, so I built in functionality to detect the overwrite situation. It's a bit crude, as you have to define "setpoint_DoorOpen" as a global variable in the beginning of the script. This approach doesn't allow you to choose a different door-open value per room anymore (which you could theoretically do in the Max! configuration tool if you wanted). Plus it will go wrong if you actually set the setpoint to this specific value in Domoticz: it will not update the Cube then. There are probably nicer ways, suggestions welcome.
Peggy wrote: Monday 18 September 2017 11:36 Another thing, in the function ReadThermostat you wrote :

Code: Select all

result, statuscode, content = http.request('http://127.0.0.1:'..DomoticzPort..'/json.htm?type=devices')
  r,e = json:decode(result)
This means you request and parse all Domoticz devices once for each max! device (Domoticz will return 400+ devices in my setup). This call should be outside the ReadThermostat function, called only once.
Fully agree, it's not the most elegant solution. But I only have a few thermostats, so it's not executed more than a couple of times. And it runs remarkably quick (also in my situation with a similar amount of devices as you have). Nevertheless, you challenged me to look for a more elegant solution whete the API call is only made once. By the way, please give me some credit, I am not a programmer but just learned it by trial and error ;-)
Peggy wrote: Monday 18 September 2017 11:36 Furthermore, I wonder how to use an external temperature sensor. In your script I see we can send the setpoint to the valve, but not the actual temp. Is it possible to emulate the WMT and send the actual temp to the valve?
The valve cannot receive actual temperatures as far as I know. Internally, it knows the actual temperature very well, it just doesn't communicate it very often (to preserve battery). The WMT is basically just there to have a more convenient UI, and as a bonus it sends the actual temperature whenever you want it, so you get a free (additional) room temperature sensor.
EDIT: I just realized this is not the whole story. The WMT is also there to measure temperature on a better location than right next to the radiator. I have no idea if this is possible with your own sensor, in other words: if you can "fake" a WMT. I am at least not aware of a method to do that, but feel free to browse https://github.com/Bouni/max-cube-protocol for more info...
Peggy wrote: Monday 18 September 2017 11:36 One last thing, how do I force the valves to "holiday", boost?
You can call the function MaxCmdSend(id, room, mode, setpoint), giving "mode" the value "BOOST" or "VACATION". At least that's what I think, I must admit that I have never actually tried it, I just copied this part from other code. You could call this function based on the value of a dummy (selector) switch you create in Domoticz.

Re: ELV Max! Heating control system

Posted: Monday 18 September 2017 16:29
by mvzut
Westcott wrote: Monday 18 September 2017 0:09 I'm using the Python library 'maxcube'

Code: Select all

#!/usr/local/bin/python3

import socket
import time

from maxcube.cube import MaxCube
from maxcube.connection import MaxCubeConnection

class Cube:
    def __init__(self, utils=None):
        try:
            self.mconfig  = utils.config["MaxCube"]
            self.CubeName = self.mconfig.get('name', 'KEQ0539717')
            self.Port     = self.mconfig.getint('port', 62910)
            self.UTILS    = utils
            self.LOG      = utils.LOG
            self.Cube     = MaxCube(MaxCubeConnection(self.CubeName, self.Port))
            self.prev     = '18'
        except (socket.timeout, socket.error) as e:
            print('** Cube init error: {} **'.format(e))

    def GetDeviceMode(self, mode):
    
        if mode==0:
            smode="Auto"
            dmode=10
        elif mode==1:
            smode="Manual"
            dmode=20
        elif mode==2:
            smode="Holiday"
            dmode=30
        elif mode==3:
            smode="Boost"
            dmode=40
            
        return smode, dmode
 
    def Read(self):
        tries = 0
        maxTries = 5
        
        while tries < maxTries:
            try:
                if self.Cube == None:
                    self.LOG.Log("Cube connecting...")
                    self.Cube = MaxCube(MaxCubeConnection(self.CubeName, self.Port))
                else:
                    self.Cube.update()
                    
                for device in self.Cube.devices:
                    name = device.rf_address
                    temp = device.actual_temperature
                    
                    if temp == None:
                        temp = self.prev
                        if temp == None:
                            temp = self.UTILS.svals[name]

                    self.UTILS.UpdateDevice(name, temp)
                    self.prev = temp
                        
                    setp = str(device.target_temperature)
                    pos  = str(device.valve_position)
                    smode, dmode = self.GetDeviceMode(device.mode)
                    self.UTILS.UpdateDevice(name + ' setpoint', setp)
                    self.UTILS.UpdateDevice(name + ' valve', pos )
    #                self.UTILS.UpdateDevice(name + ' mode', smode + "|" + str(dmode))
                    msg = "{} Setpoint={}° Temp={}° Valve pos={}% Mode={}".format(name, setp, temp, pos, smode)
    #                self.LOG.Log(msg)
                    self.UTILS.SendMessage(msg)
                    self.UTILS.OLED.TextLine('{} {} {}'.format(temp, setp, pos), 4)
                    
                return True

            except (socket.timeout, socket.error) as e:
                self.LOG.Log('** Cube read error: {} **'.format(e))
                tries+=1
                time.sleep(tries+1)

        self.LOG.Log('** Cube read failed **')
        return False
            
    def SetSetpoint(self, name, sp):
        for device in self.Cube.devices:
            addr = device.rf_address
            setp = float(device.target_temperature)
                
            if name == addr and sp != setp:
                tries = 0
                maxTries = 5
                
                if sp < setp:
                    dir = "🡳"
                else:
                    dir = "🡱"
                
                while tries < maxTries:
                    try:
                        self.Cube.set_target_temperature(device, sp)
                        msg = "CUBE Setpoint {} {} {}".format(setp, dir, sp)
                        self.LOG.Log(msg)
                        self.UTILS.SendMessage(msg)
                        return True

                    except (AttributeError, socket.timeout, socket.error) as e:
                        self.LOG.Log('** Cube setpoint error: {} **'.format(e))
                        tries+=1
                        time.sleep(tries+1)
                    
        self.LOG.Log('** Cube setpoint failed for {} **'.format(name))
        return False
        
Interesting! Can you explain a bit more on how you use it?

Re: ELV Max! Heating control system

Posted: Monday 18 September 2017 17:30
by Peggy
Finally Westcott's code seems almost ready to use in Eventghost, i just need to re-write the UpdateDevice( setpoint / valve / mode) function.
mvzut's "automatic domoticz device creation" feature is missing, it would probably be useful to launch mvzut's script once, then work with Westcott's script.

I wonder why the "self.UTILS.UpdateDevice(name + ' mode', smode + "|" + str(dmode))" is commented, like mvzut it looks like you're not fond of these features.

On my side I'd like to boost the bathroom temperature directly on the valve's button OR using Domoticz, isn't it possible?


Wescott, there are several python apis named maxcube, I think you used this api : https://github.com/goodfield/python-maxcube-api

Can you tell me where are these objets you use in your implementation : mconfig , utils.* , LOG

Re: ELV Max! Heating control system

Posted: Tuesday 19 September 2017 16:20
by huneyman
i wana know complete info about vigrx Heating control system