Help with LUUP code

Hi,

I am struggling with LUUP code and would appreciate any help I can get. I’m running a Vera Edge with UI7

I have a scene that get some weather parameters and then give me a greeting in the morning (mainly based on this http://kirkwoodhomestead.blogspot.se/).

This worked perfect until now.

[code]local t = luup.variable_get(“urn:upnp-micasaverde-com:serviceId:Weather1”, “ConditionGroup”, 28)

if t == “chanceflurries” then t = “under dagen kan det bli l?tt sn?fall”
elseif t == “chancerain” then t = “under dagen ?r det risk f?r regn”
elseif t == “chancesleet” then t = “under dagen ?r det risk f?r underkylt regn”
elseif t == “chancesnow” then t = “under dagen kan det bli sn?fall”
elseif t == “chancetstorms” then t = “under dagen ?r det risk f?r ?ska”
elseif t == “clear” then t = “klart v?der”
elseif t == “cloudy” then t = “molnigt”
elseif t == “flurries” then t = “l?tt sn?fall”
elseif t == “fog” then t = “dimma”
elseif t == “hazy” then t = “disigt”
elseif t == “mostlycloudy” then t = “mestadels molnigt”
elseif t == “mostlysunny” then t = “mestadels soligt”
elseif t == “partlycloudy” then t = “delvis molnigt”
elseif t == “partlysunny” then t = “delvis soligt”
elseif t == “sleet” then t = “underkylt regn med andra ord riktigt skitv?der”
elseif t == “rain” then t = “regnar det”
elseif t == “snow” then t = “sn?ar det”
elseif t == “sunny” then t = “soligt”
elseif t == “tstorms” then t = “?skov?der”
elseif t == “unknown” then t = “oklart vad det ?r f?r v?der”
elseif t == “cloudy” then t = " molnigt"
elseif t == “partlycloudy” then t = “spridda moln”
else
t = “oklart vad det ?r f?r v?der”
end

local tc = luup.variable_get(“urn:upnp-org:serviceId:TemperatureSensor1”, “CurrentTemperature”, 29)
local th = luup.variable_get(“urn:upnp-org:serviceId:TemperatureSensor1”, “CurrentTemperature”, 31)
local tl = luup.variable_get(“urn:upnp-org:serviceId:TemperatureSensor1”, “CurrentTemperature”, 30)
local time = os.date(‘%I: %M’)

luup.call_action(“urn:micasaverde-com:serviceId:SecuritySensor1”, “SetArmed”, {newArmedValue = “0”}, 48)

luup.call_action(“urn:micasaverde-com:serviceId:Sonos1”, “Say”, {Text= string.format(“Godmorgon! Klockan ?r %q och utomhus ?r det %q och %q grader. Under dagen kommer det att vara mellan %q och %q grader. Ha en underbar dag!”, time, t, tc, tl, th), Language=“sv”, Volume=45, SameVolumeForAll=“true”}, 24)[/code]

What I know I have tried doing before this stopped working was trying to get another Sonos unit to turn on/off a onkyo receiver based on TransportState with the following LUUP code.

[code]local s = luup.variable_get(“urn:upnp-org:serviceId:AVTransport”, “TransportState”, 5)

if s == “PLAYING” then
luup.call_action(“urn:upnp-micasaverde-com:serviceId:SwitchPower1”, “SetStatus”, {newStatusValue = “1”}, 41)
luup.call_action(“urn:upnp-micasaverde-com:serviceId:InputSelection1”, “Input”, “23”, 41)
else
luup.call_action(“urn:upnp-micasaverde-com:serviceId:SwitchPower1”, “SetTarget”, {newTargetValue = “0”}, 41)
end[/code]

I have not been able to get that working either… ???

When I check in the Vera log I can see the following LuaInterface::CallFunction_Scene Scene 13 failed attempt to call a nil value

To summarize, I don’t seem to be able to use luup.variable_get even though I know it has worked before.

Ps. I have double checked device ID’s to make sure this is not the issue…

Thanks in advance for any help I can get, I have been struggling too long with this!