i'm using a lot of motion script (if motion == on, turn lamp == on) and with a print to the log (motion detected in room x).
now, what i want is:
if motion detected it has to turn on the light and do a print only once a 60 or 120 seconds to the log.
what is does now is it writes to the log every couple seconds as long as we are in the room and there is motion.
i need this for the print output only.
is this possible?
thanks!
example:
Code: Select all
2021-10-25 14:59:12.048 Status: LUA: Verlichting badkamer AAN
2021-10-25 14:59:16.794 Status: LUA: Verlichting badkamer AAN
2021-10-25 15:00:14.529 Status: LUA: Verlichting badkamer AAN
2021-10-25 15:00:22.282 Status: LUA: Verlichting badkamer AAN
2021-10-25 15:01:21.425 Status: LUA: Verlichting badkamer AAN
Code: Select all
commandArray = {}
if
devicechanged['BewegingBadkamer'] == 'On' -- and otherdevices['Het is Donker'] == 'On'
then
commandArray[#commandArray+1] = {['LampBadkamer-RFX'] ='Set Level 83' }
print('Verlichting badkamer AAN')
end
return commandArray