I am a total noob at programming dzVents so I am reading for days now and created a script for moving my "Rolluik"to a certain percentage at a certain time on certain days of the week with a check if it isn't allready there. But when i run de code I get an error "attempt to index a nil value (global 'Domoticz')" any help would be greatly appreciated.
Code: Select all
return
{
on =
{
timer =
{
'at 11:17 on sat,sun' ,
},
},
logging =
{
level = Domoticz.LOG_DEBUG,
marker = 'Rolluik voor',
},
data =
{
currentState =
{
initial = '',
},
},
execute = function(dz)
local rolluik = dz.devices('Rolluik Raam Voor')
local level = rolluik.level
dz.log('Device ' .. rolluik.name .. '; level is '.. level .. '%' , dz.LOG_DEBUG)
if rolluik.level < 61 then
rolluik.setLevel(61)
end
end
}