Well, no replys, I thought I'd give it a try myself. Heres what I got in two days(wow):
Code: Select all
return {
on = {
devices = {
'IkeaPuck1'
}
},
execute = function(domoticz, device)
local Light = dz.devices('Ikea1000-1')
himmennin = dz.variables('Dimmer1')
domoticz.log('Device ' .. device.name .. ' was changed', domoticz.LOG_INFO)
if (device.name == 'IkeaPuck1' and device.level >= 0) then
domoticz.himmennin.set('device.level')
Light.dimTo('himmennin')
elseif (device.name == 'IkeaPuck1' and device.level == 0) then
domoticz.himmennin.set('device.level')
Light.switchOff()
end
end
}
And it does not work, I get this:
2019-08-09 15:57:12.151 Status: dzVents: Error (2.4.19): ...ticz/scripts/dzVents/generated_scripts/IkeaDimmTest1.lua:8: attempt to index global 'dz' (a nil value)
Dzvents documentation read many many times and cant get any closer than this..