I have a script that sync's 2 switches, works fine but after 1 or 2 weeks the switches bigins to flicker (on/off) very fast.
I have to reboot the pi to stop the flickering.
Does someone have a solution or other script?
Code: Select all
commandArray = {}
-- variabeles
local Switch1 = 'Firstfloor'
local Switch2 = 'Secondfloor'
-- sync switches
for deviceName,deviceValue in pairs(devicechanged) do
if (deviceName == Switch1) then
if (deviceValue ~= otherdevices[Switch2]) then
commandArray[Switch2] = deviceValue
end
elseif (deviceName == Switch2) then
if (deviceValue ~= otherdevices[Switch1]) then
commandArray[Switch1] = deviceValue
end
end
end
return commandArray