Lux value only updated after motion is detected <solved>
Posted: Wednesday 14 October 2020 8:51
I've a Aqara motion sensor that also shows the amount of lux. I want only execute an action when there is motion when the amount of lux is lower then a certain value. The problem is, the lux is only updated as soon as it detects motion... How can I execute the script once the lux value is updated and motion is triggered?
I tried the above solution, but that didn't work, of course...
Code: Select all
return
{
on =
{
devices = {
'MS','MSL'
}
},
execute = function(domoticz, device)
if ((device.name == 'MS' and device.active) and (device.name == 'MSL' and device.lux < 10 )) then
domoticz.notify('Motion', 'Motion triggered', domoticz.PRIORITY_EMERGENCY)
end
end
}