Notify When Lua Cancels Scene

So, I have a few irrigation scenes that can be cancelled because of the following:

a) If my Water Saver virtual Switch is ON
b) if the Wunderground weather app is reporting rain, drizzle or Tstorm
c) if it is Summer (rainy Season), as I have stored in Variable Container

Can anyone tell me if I can Log or record whether it was the Water Saver, the Weather or the Season that cancelled the scene?

I have the device reporting when it starts my EtherRain 8 controller, but if it does not trigger the device, I’d kinda like to know why.

code below:

–test to check for rain
local rain_status = luup.variable_get(“urn:upnp-micasaverde-com:serviceId:Weather1”, “ConditionGroup”, 89)

–Check Water Saver Switch
local SaverStatus = luup.variable_get(“urn:upnp-org:serviceId:VSwitch1”, “Status”, 127)

–Check to see if the Season is Summer
local CurrentSeason = luup.variable_get(“urn:upnp-org:serviceId:VContainer1”,“Variable5”, 129)

if (SaverStatus == “1”)
or CurrentSeason == “Summer”
or string.find(rain_status,“Tstorm”)
or string.find(rain_status,“drizzle”)
or string.find(rain_status,“rain”)
then
return false
else
return true
end

You could use the following code which will make an entry in LuaUPnP.log showing why the scene was not run:

[code]function logIt(message)
luup.log("Watering not started: " … message)
end

–test to check for rain
local rain_status = luup.variable_get(“urn:upnp-micasaverde-com:serviceId:Weather1”, “ConditionGroup”, 89)

–Check Water Saver Switch
local SaverStatus = luup.variable_get(“urn:upnp-org:serviceId:VSwitch1”, “Status”, 127)

–Check to see if the Season is Summer
local CurrentSeason = luup.variable_get(“urn:upnp-org:serviceId:VContainer1”,“Variable5”, 129)

if (SaverStatus == “1”) then
logIt(“Water Saver On”)
return false
elseif CurrentSeason == “Summer” then
logIt(“Season -= Summer”)
return false
elseif string.find(rain_status,“Tstorm”) then
logIt(“Thunderstorm forecast”)
return false
elseif string.find(rain_status,“drizzle”) then
logIt(“Drizzle forecast”)
return false
elseif string.find(rain_status,“rain”) then
logIt(“Rain forecast”)
return false
else
luup.log(“Watering started.”)
return true
end[/code]

Rex,

I embedded push notifications into the Lua, works great.