Issue with lastUpdate.minutesAgo
Posted: Tuesday 08 August 2017 15:25
Running win10 and V3.8256
I try to turn of a fan after a fixed number of minutes. I can't get it to work.
First I tried with
But no turning of...
I then changed to id (I thought have not used id before)
and got this
Is this ID?
And can a friendly sole tell me where I go wrong?
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