I try to turn of a fan after a fixed number of minutes. I can't get it to work.
First I tried with
Code: Select all
return {
active = true,
on = {
timer = {'Every minute'}
},
execute = function(domoticz)
if (domoticz.devices('1st floor Bathroom Fan').lastUpdate.minutesAgo > 3)
and domoticz.devices('1st floor Bathroom Fan') == 'On'
then domoticz.devices('1st floor Bathroom Fan').switchOff()
end
end
}I then changed to id (I thought have not used id before)
Code: Select all
return {
active = true,
on = {
timer = {'Every minute'}
},
execute = function(domoticz)
if (domoticz.devices('365').lastUpdate.minutesAgo > 3)
and domoticz.devices('365') == 'On'
then domoticz.devices('365').switchOff()
end
end
}Code: Select all
2017-08-08 15:13:00.365 Error: dzVents: Error: There is no device with that name or id: 365