I'm using a dummy shutter device to control my shutter,
based on the dummy an event is triggered.
this was working correctly, however, since last release I need to execute the close and open actions twice to get it working correctly.
from my understanding something changed in detecting if the device was opened or closed, changing the level is still working fine.
any idea on this,
this is the script I'm currently struggling with:
Code: Select all
return {
on = {
devices = {
'Rolluik'
}
},
execute = function(domoticz, device)
domoticz.log('Device ' .. device.name .. ' was changed', domoticz.LOG_INFO)
domoticz.log(device.changed)
domoticz.log('Selected level' .. device.level)
domoticz.log(device.status )
Rolluik = domoticz.devices('Rolluik-Hardware')
RolluikSwitch = domoticz.devices('Rolluik')
newpercentage = 100 - device.level
if(device == 'Closed') then
Rolluik.switchOff()
domoticz.log('sluit rolluik')
--elseif(device == 'Open' and device.level == 0) then
--domoticz.log('open rolluik')
--Rolluik.switchOn()
else
domoticz.log(newpercentage)
domoticz.log('zet percentage: '..newpercentage)
Rolluik.dimTo(newpercentage)
--Rolluik.setLevel(newpercentage)
end
end
}