I wrote this script
--------------------------------
Code: Select all
local DOMAIN = ':TEST'
local LIGHT = {112, 142, 173, 178}
local TIME_INTERVAL = 'every 30 minutes'
return {
active = true,
logging = {
level = domoticz.LOG_INFO,
marker = DOMAIN
},
on = {
devices = LIGHT,
timer = { TIME_INTERVAL },
},
data = {
deviceOn = {initial={}},
},
execute = function(dz, the_device, triggerInfo)
local LOG_LEVEL = dz.LOG_INFO -- LOG_INFO (LOG_DEBUG, LOG_ERROR, LOG_FORCE)
dz.log(the_device.id .. ' ' .. the_device.name .. ' ' .. the_device.state, LOG_LEVEL)
if the_device.active then
the_device.switchOff().silent()
dz.log(the_device.id .. ' ' .. the_device.name .. ' switchOff ' , LOG_LEVEL)
end
dz.log(the_device.id .. ' ' .. the_device.name .. ' ' .. the_device.state, LOG_LEVEL)
end}
the log is
2018-03-13 23:09:22.592 User: Admin initiated a switch command (178/Allée/On)
2018-03-13 23:09:22.721 dzVents: Info: :TEST: ------ Start internal script: test_state: Device: "Allée (Z-Wave Plus Z-Stick Gen5)", Index: 178
2018-03-13 23:09:22.722 dzVents: Info: :TEST: 178 Allée On
2018-03-13 23:09:22.723 dzVents: Info: :TEST: 178 Allée switchOff
2018-03-13 23:09:22.723 dzVents: Info: :TEST: 178 Allée On
2018-03-13 23:09:22.723 dzVents: Info: :TEST: ------ Finished test_state
2018-03-13 23:10:03.261 EventSystem: reset all events...
=> after 178 was switched Off, the state in the log remains On
Did I missed something?!
Version: 3.9034
Build Hash: 7f6249c9
Compile Date: 2018-03-12 18:52:16
dzVents Version: 2.4.1