Platform: Raspberry Pi
Plugin/Hardware: N/A
Description:
I'm trying to use the setIcon function in a simple dzVents script in order to change the icon of a dummy selection switch.
Code: Select all
return {
on = {
devices = {
'Larmstatus'
}
},
execute = function(domoticz, device)
domoticz.log('Device ' .. device.name .. ' was changed', domoticz.LOG_INFO)
domoticz.log('Larmstatus: ' .. device.state)
if device.state == 'Utlöst' then
device.setIcon(13)
end
end
}
If I trigger the script a second time or refresh the browser the icon is changed.
Any idea how to work around the problem?