PIR activated - Light on for 1 minute at 50%
Posted: Sunday 11 February 2018 11:36
Domoticz v3.8914
Fibaro Motion Sensor FGMS001
What I'm trying to do is to switch the hall light for 1 minute at 50% when PIR is activated between 23:00 and 06:30.
dzVents script:
Sometimes this works, but most of the time the light stays on. I've seen in the dzVents examples that this may be the case and I'll have to use something like
but that this doesn't work in combination with .dimTo()
So for now I'm stuck and I can't get this to work.
Any help would be appreciated....
Fibaro Motion Sensor FGMS001
What I'm trying to do is to switch the hall light for 1 minute at 50% when PIR is activated between 23:00 and 06:30.
dzVents script:
Code: Select all
return {
on =
{
devices =
{['PIR - Trap'] = {'between 23:00 and 06:30'}},
'Lamp Gang'
},
execute = function(domoticz, device)
if
{(device.name == 'PIR - Trap' and device.state == 'On') and
(device.name == 'Lamp Gang' and device.state == 'Off')}
then
domoticz.devices('Lamp Gang').dimTo(50).forMin(1)
domoticz.log('Lamp zolder ingeschakeld door PIR Trappenhuis')
end
end
}
Code: Select all
light.switchOff().checkFirst().afterMin(5)
light.switchOn().checkFirst().forMin(5)
So for now I'm stuck and I can't get this to work.
Any help would be appreciated....