OK, I got my but kicked for a while but I almost have it. The first commands turn off the RGB channels if they were on. Then the flashing program starts and cycles Red On@ 90% and Off. The program terminates fine when the scene is run a second time. However, I want all channels to be at 30% when the program terminates but the red channel overrides to 90%. Any ideas on how to fix this. Can the program be terminated after running the sBlink=0 commands are run?
local socket = require(“socket”)
host = “192.168.1.74” – Set Device
c = assert(socket.connect(host, 4998)) – Set Port
c:send(“set_LED_LIGHTING,1:1,0,0\013”) – Turn Off Red
c:close()
local socket = require(“socket”)
host = “192.168.1.74” – Set Device
c = assert(socket.connect(host, 4998)) – Set Port
c:send(“set_LED_LIGHTING,1:2,0,0\013”) – Turn Off Green
c:close()
local socket = require(“socket”)
host = “192.168.1.74” – Set Device
c = assert(socket.connect(host, 4998)) – Set Port
c:send(“set_LED_LIGHTING,1:3,0,0\013”) – Turn Off Blue
c:close()
function LowAlcoholOn(stuff)
local socket = require(“socket”)
host = “192.168.1.74” – Set Device
c = assert(socket.connect(host, 4998)) – Set Port
c:send(“set_LED_LIGHTING,1:1,90,0\013”) – Turn Red On 90%
c:close()
if (sBlink == “1”) then
luup.call_timer(“LowAlcoholOff”,1,“1”, “”, “”)
end
end
function LowAlcoholOff(stuff)
local socket = require(“socket”)
host = “192.168.1.74” – Set Device
c = assert(socket.connect(host, 4998)) – Set Port
c:send(“set_LED_LIGHTING,1:1,0,0\013”) – Turn Off Red
c:close()
if (sBlink == “1”) then
luup.call_timer(“LowAlcoholOn”,1,“1”, “”, “”)
end
end
if (sBlink == “1”) then
sBlink = “0”
local socket = require(“socket”)
host = “192.168.1.74” – Set Device
c = assert(socket.connect(host, 4998)) – Set Port
c:send(“set_LED_LIGHTING,1:1,30,0\013”) – Turn On Red 30%
c:close()
local socket = require(“socket”)
host = “192.168.1.74” – Set Device
c = assert(socket.connect(host, 4998)) – Set Port
c:send(“set_LED_LIGHTING,1:2,30,0\013”) – Turn On Green 30%
c:close()
local socket = require(“socket”)
host = “192.168.1.74” – Set Device
c = assert(socket.connect(host, 4998)) – Set Port
c:send(“set_LED_LIGHTING,1:3,30,0\013”) – Turn On Blue 30%
c:close()
else
sBlink = “1”
luup.call_timer(“LowAlcoholOff”,1,“1”, “”, “”)
end