Use variable for dimming
Posted: Sunday 09 June 2019 20:54
Can I and how can I use a variable for dimming?
I created the script belows that works like a wake up light, but somehow I get the followin error when executing the script: : line 19: attempt to call field 'dimTo' (a nil value)
Any help is (again) much appreciated!
I created the script belows that works like a wake up light, but somehow I get the followin error when executing the script: : line 19: attempt to call field 'dimTo' (a nil value)
Code: Select all
return {
on = {
timer = { 'between 6:50 and 7:10' }
},
data = {
dimmerSet = { initial = 1 }
},
execute = function(domoticz, device)
--Donker, Wekker aan = Dimmer aan & dimmen + 1
if
domoticz.devices('IsDonker').state == 'On' and
domoticz.devices('WekkerAlarm').state == 'On' and
then
domoticz.devices(DimmerKeukenTafel).dimTo(domoticz.data.dimmerSet)
domoticz.log('Slaapkamer dimmer gaat omhoog. Nu: '.. domoticz.data.dimmerSet, domoticz.LOG_INFO)
domoticz.data.dimmerSet = domoticz.data.dimmerSet + 1
end
end
}