I'm pretty new to scripting and LUA seems to be going a bit above my knowledge. This is why, when I saw the DZVents video I was really happy how simple it seemed. Before long I had my lights turning on when it got dark and off at a specific time. Somehow my script suddenly stopped working and I cant understand why. last week the Raspberry pi Domoticz is running on crashed and since then the DZvents scripts stopped working and I cant get them to work anymore. I'm hoping someone here can help me! The script probably is really easy to read for someone with a bit experience with scripting;
Code: Select all
return {
active = true,
on = {
devices = {
'Schemerdummy'
},
},
execute = function(domoticz, device)
local Schemerlampen = domoticz.groups('Schemerlampen')
local SchemerVar = domoticz.variables('SchemerVar')
if (device.state == 'On' and Schemerlampen.state == 'Off' and SchemerVar.value == '0') then
domoticz.log('XXXXXXXXXXXXXXX---LAMPEN GAAN AAN--XXXXXXXXXXXXXXXXXXXXXXX')
domoticz.log(Schemerlampen.state)
domoticz.log(device.state)
domoticz.log(SchemerVar.value)
domoticz.log('XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
Schemerlampen.switchOn().withinMin(10)
SchemerVar.set(1)
end
end
}
Hope someone here can help, I have been troubleshooting a lot but can figure out what i'm doing wrong.
Thanks a lot from this newbie

btw, I'm running on a Pi 3b, with Raspbian
Domoticz:
Version: 3.8631
Build Hash: 8b89f7f3
Compile Date: 2017-10-24 09:30:28
dzVents Version: 2.3.0