Change the brightness with a button (long hold)
Posted: Tuesday 15 September 2020 17:27
Hello to all. Help how to make a change in brightness by holding the button. We hold the button and the brightness decreases, release it, press it, hold it and the brightness increases.
I'm sorry for my bad english
Code: Select all
return {
on = {
devices = {
'зал у дивана',
}
},
execute = function(domoticz, device)
local Wand = domoticz.devices('Зал 1')
domoticz.log('Устройство ' .. device.name .. ' был изменен. Статус: ' .. Wand.level, domoticz.LOG_INFO)
Wand.cancelQueuedCommands()
elseif device.levelName == "Long Click" then
for dimLevel = 1, 100 do
Wand.dimTo(dimLevel).afterSec(dimLevel / 10)
end
end
end
}