Add a dim function to a pushbutton
Posted: Friday 10 April 2020 9:44
I have a script that was working fine, but i want that the light is dimming to 100%
This was the original code
So i changed the script to:
This is not working, i get the following error in the log:
6: attempt to call a nil value (field 'dimTo')
Does somebody know what i am doing wrong?
This was the original code
Code: Select all
return
{
on = { devices = { 'Drukknop keuken' }}, -- Name of your pushButton
execute = function(dz)
dz.devices('Keuken Koof').toggleSwitch() -- Name of your light
dz.devices('Keuken Nis').toggleSwitch() -- Name of your light
end
}
Code: Select all
return
{
on = { devices = { 'Drukknop keuken' }}, -- Name of your pushButton
execute = function(dz)
dz.devices('Keuken Koof').toggleSwitch().dimTo(100) -- Name of your light
dz.devices('Keuken Nis').toggleSwitch() -- Name of your light
end
}
6: attempt to call a nil value (field 'dimTo')
Does somebody know what i am doing wrong?