The documentation gives this as an example.
Code: Select all
on = { devices = { ['myDevice'] = 'at nighttime' } }
Code: Select all
return {
active = true,
on = {
devices = { [
'Driveway Cam Motion',
'Front Door Cam Motion',
'Back Door Cam Motion',
'Back Garden Cam Motion'
] = 'at nighttime'
}
},
execute = function(domoticz, switch)
..............
Error: dzVents: Error: error loading module 'motion' from file '/data/home/domoticz/scripts/dzVents/scripts/motion.lua':
/data/home/domoticz/scripts/dzVents/scripts/motion.lua:15: '}' expected (to close '{' at line 10) near '='
Line 10 is 'device=...'
Line 15 '] = 'at nighttime'
I realize I can put the time test in the execute part, but the whole point of using dzVents is to stop this code getting executed unless absolutely necessary. I have a very elaborate motion trigger / light setup that I wrote in C using MQTT events because of the limitations using previous versions of scripts in Domoticz and having to be executed on every event, dzVents looks like the perfect reason to port this.