Hi all,
I've tried to make this script which will turn on a switch (HomeEasy) at weekdays at 23:15 so the attached devices (phones, tablets, etc) can be charged with the cheaper power at night. However I keep getting this error and I must be getting blind but I can't figure out what I'm doing wrong...
Log:
Here is the script:2018-01-27 19:33:00.449 Error: dzVents: Error: error loading module 'ChargerStation' from file '/home/pi/domoticz/scripts/dzVents/scripts/ChargerStation.lua':
...e/pi/domoticz/scripts/dzVents/scripts/ChargerStation.lua:8: '}' expected (to close '{' at line 1) near 'execute'
Code: Select all
return {
active = false,
on = {
timer = {
'at 23:15 on mon,tue,wed,thu,fri',
}
}
execute = function(domoticz, timer)
domoticz.log('Daluren stroom, ChargerStation aangezet')
domoticz.log('The rule that triggered the event was: ' .. timer.trigger')
domoticz.devices('Lamp_4').switchOn().forMin(240)
end
end
}
Cheers,
void
Working version:
Code: Select all
return {
active = true,
on = {
timer = {
'at 23:15 on mon,tue,wed,thu,fri',
}
},
execute = function(domoticz, timer)
domoticz.log('Daluren stroom, ChargerStation aangezet')
domoticz.devices('Lamp_4').switchOn().forMin(240)
end
}