Timer for evotouch

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

Post Reply
TheChief
Posts: 9
Joined: Wednesday 03 October 2018 18:37
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.9700
Location: The Netherlands
Contact:

Timer for evotouch

Post by TheChief »

Hi all,

If installed a Honeywell Round Connected Modulation on my domoticz and raspberry. If I want to make a timer I can only choose on or off, is it possible to put in the temperature? Example;
Dayly 0800 20,5 degrees
Dayly 2200 15,5 degrees

TheChiefImage

Verstuurd vanaf mijn SM-N950F met Tapatalk
Last edited by TheChief on Sunday 28 October 2018 11:25, edited 1 time in total.
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Timer for evotouch

Post by waaren »

TheChief wrote: Saturday 27 October 2018 14:42 If installed a Honeywell Round touch on my domoticz and raspberry. If I want to make a timer I can only choose on or off, is it possible to put in the temperature? Example;
Dayly 0800 20,5 degrees
Dayly 2200 15,5 degrees
It is not possible to do this on the timer screen. As a workaround I created this dzVents script that will take a string from the description field and process the setpoint accordingly.
Example on how to enter the string in the description field
Example on how to enter the string in the description field
scheduler.png (49.84 KiB) Viewed 447 times
Further description is in the comments.

Code: Select all

-- EvoSchedule

--[[

 this script will update setpoints based on schedules entered in the description field of (Evo) setpoint devices.
 schedule should be formatted like:
              
  schedule:{"saturday":{"08:10":"22.3","16:50":"27.2"},"wednesday":{"08:05":"22","15:40":"23"},"weekend":{"17:25":"41.33"}}
 
    for valid days look in convertKey function (keys are case sensitive)
    time can be entered with a granularity of 5 minutes. If that is not granular enough, 
    the on = { timer string below must be changed to "every minute)" 
    your setpointDevice(s) are to be entered in the variable allSetpoints
]]-- 

return {
    on      =   {   timer   =     { "every 5 minutes"  }},
                         
    logging =   {   level      =   domoticz.LOG_DEBUG,
                    marker     =   "EvoSchedule"    },
                    
    execute = function(dz)
        local allSetpoints         = {"EvoTouch","EvoTouch2","Zolder"}  -- all evo devices (minimal 1)
        
        local function convertKey(key)
            if          key == "allDays" or key == "alleDagen" then return true end
            if          key == "weekend" then return dz.time.matchesRule("on sat,sun") 
            elseif      key == "workday"    or key == "werkdag"     then return dz.time.matchesRule("on mon,tue,wed,thu,fri") 
            elseif      key == "sunday"     or key == "zondag"      then return dz.time.matchesRule("on sun") 
            elseif      key == "saturday"   or key == "zaterdag"    then return dz.time.matchesRule("on sat") 
            elseif      key == "monday"     or key == "maandag"     then return dz.time.matchesRule("on mon") 
            elseif      key == "tuesday"    or key == "dinsdag"     then return dz.time.matchesRule("on tue") 
            elseif      key == "wednesday"  or key == "woensdag"    then return dz.time.matchesRule("on wed") 
            elseif      key == "thursday"   or key == "donderdag"   then return dz.time.matchesRule("on thu") 
            elseif      key == "friday"     or key == "vrijdag"     then return dz.time.matchesRule("on fri") 
            end
            
            return true
        end
        
        local function processAllSetpoints()
            for i=1,#allSetpoints do                                 -- walk over all declared setPoint devices
                local mySetpoint = dz.devices(allSetpoints[i])
                -- string.find(mySetpoint.description,"schedule:(%d+)"
                
                dz.log("Looking at device " .. mySetpoint.name .. ". This device is type: " .. mySetpoint.deviceType .. ", subtype: " .. mySetpoint.deviceSubType,dz.LOG_DEBUG)
                if (mySetpoint.description):find("schedule:") then
                    local _,_,schedule =  (mySetpoint.description):find("schedule:(.*)")
                    dz.log(schedule,dz.LOG_DEBUG)
                    local control = dz.utils.fromJSON(schedule)
                    for day,setpoints in pairs(control) do
                        local msg = "evaluating " .. day 
                        if convertKey(day) then
                             dz.log(msg .. " <<== true",dz.LOG_DEBUG)
                            
                            for clockTime,setpoint in pairs(setpoints) do
                                msg = "evaluating setpoint of " .. mySetpoint.name .. " on " .. day ..  " at " .. clockTime .. " to " .. setpoint .. " degrees"
                                if dz.time.matchesRule("at " .. clockTime) then
                                    dz.log(msg .. " <<== will be set now",dz.LOG_DEBUG)
                                    mySetpoint.updateSetPoint(setpoint,dz.EVOHOME_MODE_PERMANENT_OVERRIDE) 
                                    -- 2nd parm necessary for evo Devices                                                                        
                                    -- and will be ignored by standard setPoint devices
                                else
                                    dz.log(msg .. " <<== NOT now",dz.LOG_DEBUG)
                                end    
                            end    
                        else
                            dz.log(msg .. " <<== false",dz.LOG_DEBUG)
                        end
                    end
                else
                    dz.log("Device " .. mySetpoint.name .. " does not have a schedule in description field",dz.LOG_DEBUG)
                end    
            end
        end
        
        processAllSetpoints()
        
    end
}
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
TheChief
Posts: 9
Joined: Wednesday 03 October 2018 18:37
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.9700
Location: The Netherlands
Contact:

Re: Timer for evotouch

Post by TheChief »

Hello waren,

Thanks for your reply. If I try editing my devices I can't find the discription box like in your screenshot??

If I go to devices and try to edit the 3 devices that are visible after adding the "Evihome via web api" hardware are the ones in this screenshot......

TheChief

Verstuurd vanaf mijn SM-N950F met Tapatalk


Image
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Timer for evotouch

Post by waaren »

TheChief wrote: Saturday 27 October 2018 23:41 ... If I try editing my devices I can't find the discription box like in your screenshot??
You have to use the edit button on your device on the temperature or utility tab
http://domoticz_IP:domoticz_PORT/#/Temperature or http://domoticz_IP:domoticz_PORT/#/Utility
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
TheChief
Posts: 9
Joined: Wednesday 03 October 2018 18:37
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.9700
Location: The Netherlands
Contact:

Re: Timer for evotouch

Post by TheChief »

Found it.... Thanks.... And sorry... Just new and testing everything. Just edit your script what's the best way for me and paste it in de discription and it must work? Or do I need to do more?

Verstuurd vanaf mijn SM-N950F met Tapatalk

User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Timer for evotouch

Post by waaren »

TheChief wrote: Saturday 27 October 2018 23:50 Found it.... Thanks.... And sorry... Just new and testing everything. Just edit your script what's the best way for me and paste it in de discription and it must work? Or do I need to do more?

Verstuurd vanaf mijn SM-N950F met Tapatalk
Yes. Just edit the line

Code: Select all

local allSetpoints         = {"EvoTouch","EvoTouch2","Zolder"}  -- all evo devices (minimal 1)
in such a way that it contains all setpoint devices that you want to control with this script and in all these devices put the string

Code: Select all

schedule:{"saturday":{"08:10":"22.3","16:50":"27.2"},"wednesday":{"08:05":"22","15:40":"23"},"weekend":{"17:25":"41.33"}}
in the description field (modified to suit your requirements )
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
TheChief
Posts: 9
Joined: Wednesday 03 October 2018 18:37
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.9700
Location: The Netherlands
Contact:

Re: Timer for evotouch

Post by TheChief »

Do i need to paste te complete script? i tried it but it dit not work......

Here is the complete code and edited by myself whats the best for me....
Nothing happend at 09:30 en 09:35 today....

Code: Select all

-- EvoSchedule

--[[

 this script will update setpoints based on schedules entered in the description field of (Evo) setpoint devices.
 schedule should be formatted like:
              
  schedule:{"sunday":{"09:30":"21.5”,”09:35”:”18.5”},”wednesday":{"08:05":"22","15:40":"23"}}
 
    for valid days look in convertKey function (keys are case sensitive)
    time can be entered with a granularity of 5 minutes. If that is not granular enough, 
    the on = { timer string below must be changed to "every minute)" 
    your setpointDevice(s) are to be entered in the variable allSetpoints
]]-- 

return {
    on      =   {   timer   =     { "every 5 minutes"  }},
                         
    logging =   {   level      =   domoticz.LOG_DEBUG,
                    marker     =   "EvoSchedule"    },
                    
    execute = function(dz)
        local allSetpoints         = {"Thuis: Thermostat","EvoTouch woonkamer 3","Thuis: EvoTouch"}  -- all evo devices (minimal 1)
        
        local function convertKey(key)
            if          key == "allDays" or key == "alleDagen" then return true end
            if          key == "weekend" then return dz.time.matchesRule("on sat,sun") 
            elseif      key == "workday"    or key == "werkdag"     then return dz.time.matchesRule("on mon,tue,wed,thu,fri") 
            elseif      key == "sunday"     or key == "zondag"      then return dz.time.matchesRule("on sun") 
            elseif      key == "saturday"   or key == "zaterdag"    then return dz.time.matchesRule("on sat") 
            elseif      key == "monday"     or key == "maandag"     then return dz.time.matchesRule("on mon") 
            elseif      key == "tuesday"    or key == "dinsdag"     then return dz.time.matchesRule("on tue") 
            elseif      key == "wednesday"  or key == "woensdag"    then return dz.time.matchesRule("on wed") 
            elseif      key == "thursday"   or key == "donderdag"   then return dz.time.matchesRule("on thu") 
            elseif      key == "friday"     or key == "vrijdag"     then return dz.time.matchesRule("on fri") 
            end
            
            return true
        end
        
        local function processAllSetpoints()
            for i=1,#allSetpoints do                                 -- walk over all declared setPoint devices
                local mySetpoint = dz.devices(allSetpoints[i])
                -- string.find(mySetpoint.description,"schedule:(%d+)"
                
                dz.log("Looking at device " .. mySetpoint.name .. ". This device is type: " .. mySetpoint.deviceType .. ", subtype: " .. mySetpoint.deviceSubType,dz.LOG_DEBUG)
                if (mySetpoint.description):find("schedule:") then
                    local _,_,schedule =  (mySetpoint.description):find("schedule:(.*)")
                    dz.log(schedule,dz.LOG_DEBUG)
                    local control = dz.utils.fromJSON(schedule)
                    for day,setpoints in pairs(control) do
                        local msg = "evaluating " .. day 
                        if convertKey(day) then
                             dz.log(msg .. " <<== true",dz.LOG_DEBUG)
                            
                            for clockTime,setpoint in pairs(setpoints) do
                                msg = "evaluating setpoint of " .. mySetpoint.name .. " on " .. day ..  " at " .. clockTime .. " to " .. setpoint .. " degrees"
                                if dz.time.matchesRule("at " .. clockTime) then
                                    dz.log(msg .. " <<== will be set now",dz.LOG_DEBUG)
                                    mySetpoint.updateSetPoint(setpoint,dz.EVOHOME_MODE_PERMANENT_OVERRIDE) 
                                    -- 2nd parm necessary for evo Devices                                                                        
                                    -- and will be ignored by standard setPoint devices
                                else
                                    dz.log(msg .. " <<== NOT now",dz.LOG_DEBUG)
                                end    
                            end    
                        else
                            dz.log(msg .. " <<== false",dz.LOG_DEBUG)
                        end
                    end
                else
                    dz.log("Device " .. mySetpoint.name .. " does not have a schedule in description field",dz.LOG_DEBUG)
                end    
            end
        end
        
        processAllSetpoints()
        
    end
}
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Timer for evotouch

Post by waaren »

TheChief wrote: Sunday 28 October 2018 11:22 Do i need to paste te complete script? i tried it but it dit not work......
Nothing happend at 09:30 en 09:35 today....
I sent you a PM. Best to discuss further there. No need to bather other forum members until solved. OK ?
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest