simple test going wrong
Posted: Saturday 12 March 2022 20:51
i made a script but i dont get it to work so i made a little test to see what is going wrong.
i made a simple lua script to test:
i run the script on "device"
"dimmertest" is a virtual dimmer i made to do this test.
the On part works perfect.
but the Off part gets triggerd every second or so....i do not understand why becouse i have the lua set on "device"
how can i fix this?
i made a simple lua script to test:
Code: Select all
commandArray = {}
if devicechanged['dimmertest'] == 'Set Level: 90 %' then
commandArray['lamp huis'] = 'On'
print ("lamp huis is aan")
end
if devicechanged['dimmertest'] ~= 'Set Level: 90 %' then
commandArray['lamp huis'] = 'Off'
print ("lamp huis is uit")
end
return commandArray"dimmertest" is a virtual dimmer i made to do this test.
the On part works perfect.
but the Off part gets triggerd every second or so....i do not understand why becouse i have the lua set on "device"
how can i fix this?