It isn't that easy as I thought it would be. Thankfully I've enough time to try something out, as I won't go on vacation before the end of December, but still...
I made a switch called 'Vakantie-mode' from this topic. At least, that part is working
Code: Select all
-- Check the wiki at
-- http://www.domoticz.com/wiki/%27dzVents%27:_next_generation_LUA_scripting
return {
-- 'active' controls if this entire script is considered or not
active = true, -- set to false to disable this script
-- trigger
-- can be a combination:
on = {
devices = {
-- scripts is executed if the device that was updated matches with one of these triggers
'Vakantie-mode', -- device name
-- 'abc*', -- triggers for all devices which name begins with abc
221, -- id
},
timer = {
-- timer triggers.. if one matches with the current time then the script is executed
'every day'
}
},
-- actual event code
-- in case of a timer event or security event, device == nil
execute = function(domoticz, device)
--[[
The domoticz object holds all information about your Domoticz system. E.g.:
local myDevice = domoticz.devices('myDevice')
local myVariable = domoticz.variables('myUserVariable')
local myGroup = domoticz.groups('myGroup')
local myScene = domoticz.sceneds('myScene')
The device object is the device that was triggered due to the device in the 'on' section above.
]] --
-- example
if (device.state == 'On') then
switchOn('Scene Lezen')
end
end
}
Also tried Blockly, but don't understand that at all.