Thanks for the reply!
I have an IP assigned to both the KiraRx and KiraTx in the Living room. I have a different IP assigned to both the KiraRx and Kira Tx in the bedroom. It’s not a problem. I just use different code names. Just thought you might want to know.
If you don’t mind I would like to know if the following code is an efficient way to use one scene to receive multiple IR codes.
Thanks again, Mark
local dID = 123 – Device ID of KiraRx living
local dID2 = 124 – Device ID of Living light outlet
local dID3 = 125 – Device ID of Porch light
local dID5 = 127 – Device ID of Shade virtual switch
local dID6 = 128 – Device ID of Alarm control
local dID7 = 129 – Device ID of KiraRx bedroom
local IrCode = luup.variable_get(“urn:dcineco-com:serviceId:KiraRx1”, “RxCode”, dID)
local IrCode2 = luup.variable_get(“urn:dcineco-com:serviceId:KiraRx1”, “RxCode”, dID7)
luup.variable_set(“urn:dcineco-com:serviceId:KiraRx1”,“RxCode”,“”,dID) – Clears Kira code
luup.variable_set(“urn:dcineco-com:serviceId:KiraRx1”,“RxCode”,“”,dID7) – Clears Kira code
if IrCode == “LivLight” then – Living light outlet toggle
local L_light = luup.variable_get(“urn:upnp-org:serviceId:SwitchPower1”, “Status”, dID2)
if L_light == “0” then luup.call_action(“urn:upnp-org:serviceId:SwitchPower1”,“SetTarget”,{newTargetValue = “1”}, dID2)
else
luup.call_action(“urn:upnp-org:serviceId:SwitchPower1”,“SetTarget”,{newTargetValue = “0”}, dID2) end
end
if IrCode == “PorLight” then – Porch light toggle
local P_light = luup.variable_get(“urn:upnp-org:serviceId:SwitchPower1”, “Status”, dID3)
if P_light == “0” then luup.call_action(“urn:upnp-org:serviceId:SwitchPower1”,“SetTarget”,{newTargetValue = “1”}, dID3)
else
luup.call_action(“urn:upnp-org:serviceId:SwitchPower1”,“SetTarget”,{newTargetValue = “0”}, dID3) end
end
if IrCode == “ShadesOff” then – Shades auto-off
luup.call_action(“urn:upnp-org:serviceId:VSwitch1”, “SetTarget”, {newTargetValue = “0”}, dID5) end
if IrCode == “ShadesOn” then – Shades auto-on
luup.call_action(“urn:upnp-org:serviceId:VSwitch1”, “SetTarget”, {newTargetValue = “1”}, dID5) end
if ((IrCode == “Chime”) or (IrCode2 == “BedChime”)) then – Chime toggle
luup.call_action(“urn:micasaverde-com:serviceId:DSCAlarmPanel1”,
“SendCommand”,
{Command = “071”, Data=“1*4”}, dID6) end