I have been doing some basic scripting; if then statements in luup in vera scenes;
One thing that I find incredibly difficult is working and debugging with variables.
Sometimes I will have the code fail due to various different issues; and there is no way to know why things failed (at least I don’t know). I can search the /var/log/cmh/LuaUPnP.log file and get a little bit more information; but if I am writing code that calls a variable; something like:
status5 = luup.variable_get("urn:micasaverde-com:serviceId:Doorlock1", "Status", 59)
I have no way of knowing what the variable “status5” that the system wrote back was… If this was a batch file; I could do something like “echo status5” and have it display the variables so I could know what I was working with… but I can’t seem to find a way to get this information. I’ve tried the “Develop app” section; where it says test luup code; but it just tells me if it failed or not… no details. (perhaps I am using this section wrong?)
How do you guys work with variables and debug? I’m starting to get into some more complex "if elseif else " statements with a lot more variables and it is becoming impossible to know which variable is coming back “nil” or otherwise different than expected.
Any tips for working through this?