LUA stops executing ??

Hopefully someone can shed some light on this before I lose my mind!

[code]bath_boostmode = luup.variable_get(“urn:upnp-org:serviceId:VContainer1”, “Variable1”, DeviceMSHeatMonBath)
luup.call_action( “urn:richardgreen:serviceId:VeraAlert1”, “SendAlert”, {Message=“Bathboostmode=” … bath_boostmode}, DeviceVeraAlerts)

if (bath_boostmode == “1”) then
target_temp_bath = luup.variable_get(“urn:upnp-org:serviceId:VContainer1”, “Variable3”, DeviceMSHeatContBath)
luup.call_action( “urn:richardgreen:serviceId:VeraAlert1”, “SendAlert”, {Message=“1. target=” … target_temp_bath}, DeviceVeraAlerts)
else
target_temp_bath = luup.variable_get(“urn:upnp-org:serviceId:VContainer1”, “Variable2”, DeviceMSHeatContBath)
luup.call_action( “urn:richardgreen:serviceId:VeraAlert1”, “SendAlert”, {Message=“0. target=” … target_temp_bath}, DeviceVeraAlerts)
end
luup.variable_set(“urn:upnp-org:serviceId:VContainer1”,“Variable2”,target_temp_bath,DeviceMSHeatMonBath)

luup.call_action( “urn:richardgreen:serviceId:VeraAlert1”, “SendAlert”, {Message=“Exit if then”}, DeviceVeraAlerts)[/code]

I noticed the above if…then code didn’t seem to be running at all (in either state), so I put in a few Vera Alerts just for quick debugging to show what was working or not.

Very bizarrely, when this runs I get just the first alert message and then …nothing…not even the alert to say the if…then has exited. This code runs every minute or so and I just get the first alert every time. Subsequant code to this appears to continue running fine !!!

Thinking maybe Vera Alerts didn’t like a queue of messages I also tried removing the first alert…and…nothing.

Any clues what going on here ?

Have a look at LuaUPnP.log at the point where the scene runs. You may well find an error being reported.

Probably target_temp_bath is nil

Of course…the logs…

I forgot one of my devices IDs had changed due to having issues…doh

Guess I thought all was fine if no LUA errors reported ::slight_smile:

Thanks for pointing me in the right direction. Mental note:Check Logs next time!!

Mental note:Check Logs next time!!

You may also find LuaTest helpful. It gives you any error reports directly. Plus, you can stick in a few quick print(…) statements to show you the contents of your variables.

[quote=“RexBeckett, post:5, topic:187362”]

Mental note:Check Logs next time!!

You may also find LuaTest helpful. It gives you any error reports directly. Plus, you can stick in a few quick print(…) statements to show you the contents of your variables.[/quote]

Wow, this looks great…will definitely give this a go. Thanks for the sugestion ;D