Blocky to DzVents Curtains
Posted: Friday 01 May 2020 22:05
Sorry for another Noob question.
I'm really trying around, but still got a lot to learn.
I attached my Blocky, and underneath my translation to DzVents:
My log gives me back:
2020-05-01 21:26:10.113 Error: dzVents: Error: (3.0.2) An error occurred when calling event handler Gordijnen Boven DzVents
2020-05-01 21:26:10.113 Error: dzVents: Error: (3.0.2) ...ts/dzVents/generated_scripts/Gordijnen Boven DzVents.lua:7: attempt to index a nil value (global 'dz')
Line 7 is: if dz.time.matchesRule('at 09:00') or
I also tried without 'at', so only '09:00', but that gave the same error.
Any help would be really appreciated!
I'm really trying around, but still got a lot to learn.
I attached my Blocky, and underneath my translation to DzVents:
Code: Select all
return {
on = {
timer = {'at 9:00', 'at 19:00', 'at 21:00'},
devices = {'UV Accuweather'}
},
execute = function(domoticz, timer)
if dz.time.matchesRule('at 09:00') or
(dz.devices('UV Accuweather') < '2' and
dz.time.matchesRule('> 09:00') and
dz.time.matchesRule('< 19:00') and
dz.variables('Var Luik Pim Ivo') == 1) then
dz.devices('Gordijn Ivo').switchOff()
dz.devices('Gordijn Pim').switchOff()
dz.variables('Var Luik Pim Ivo').set(0)
end
if dz.time.matchesRule('at 09:00 on mon, tue, wed, thu, fri') then
dz.devices('Gordijn Ons').switchOff()
dz.variables('Var Luik Ons').set(0)
end
if dz.devices('UV Accuweather') < 2 and dz.time.matchesRule('> 14:00') and dz.time.matchesRule('< 19:00') and dz.variables('Var Luik Ons') == 1 then
dz.devices('Gordijn Ons').switchOff()
dz.variables('Var Luik Ons').set(0)
end
if dz.time('< 12:30') and dz.devices('UV Accuweather') > 1 and dz.variables('Var Luik Pim Ivo') == 0 then
dz.devices('Gordijn Ivo').switchStop()
dz.devices('Gordijn Pim').switchStop()
dz.variables('Var Luik Pim Ivo').set(1)
end
if dz.time('< 14:30') and dz.devices('UV Accuweather') > 1 and dz.variables('Var Luik Ons') == 0 then
dz.devices('Gordijn Ons').switchStop()
dz.variables('Var Luik Ons').set(1)
end
if dz.time.matchesRule('at 19:00') then
dz.devices('Gordijn Ivo').switchOn()
dz.devices('Gordijn Pim').switchOn()
dz.variables('Var Luik Pim Ivo').set(1)
end
if dz.time.matchesRule('at 21:00') then
dz.devices('Gordijn Ons').switchOn()
dz.variables('Var Luik Ons').set(1)
end
end
}
2020-05-01 21:26:10.113 Error: dzVents: Error: (3.0.2) An error occurred when calling event handler Gordijnen Boven DzVents
2020-05-01 21:26:10.113 Error: dzVents: Error: (3.0.2) ...ts/dzVents/generated_scripts/Gordijnen Boven DzVents.lua:7: attempt to index a nil value (global 'dz')
Line 7 is: if dz.time.matchesRule('at 09:00') or
I also tried without 'at', so only '09:00', but that gave the same error.
Any help would be really appreciated!