I’m trying to implement some luup in a scene and I’m getting errors when I’m trying to save it. Could some one advise where I’m going wrong.
--Get Device status
local IDHeat = 58
local IDStat = 77
local HeatStatus = luup.variable_get("urn:upnp-org:serviceId:HVAC_UserOperatingMode1", "ModeStatus", IDHeat)
local SP_Target = luup.variable_get("urn:upnp-org:serviceId:TemperatureSetpoint1", "CurrentSetpoint", IDStat)
local SP_Current = luup.variable_get("urn:upnp-org:serviceId:TemperatureSensor1", "CurrentTemperature", IDStat)
if HeatStatus == "HeatOn" then
-- do some
If (SP_Current < SP_Target) then
-- turn on switch
luup.call_action("urn:upnp-org:serviceId:SwitchPower1", "SetTarget", {newTargetValue = "1"}, 111)
else
-- turn off switch
luup.call_action("urn:upnp-org:serviceId:SwitchPower1", "SetTarget", {newTargetValue = "0"}, 111)
else
-- do some
end