I have two scenes that no longer work. One is the greeting which is played via Vera Alerts to my daughter when she comes home. It has completely stopped functioning. The other is my wakeup scene. It’s a rather elaborate setup that involves google calendar, wakeupramp, my bed occupancy sensor, two countdown timers and a combination switch. It’s all run from an initial scene with a trigger which says it has run but it only turns the lights on to about 25% and it doesn’t appear that the timers are starting. I’m not sure though since I’m usually asleep when it runs. I hadn’t amde any changes or done any tinkering with Vera. It’s usually a set it and forget it kind of tool for me. Can anyone give me any help in figuring out what’s gone wrong? I really have no idea where to begin. I have thought about resetting Vera but it would be a major undertaking as I have a LOT of devices, virtual devices and scenes which tie into 4 Android devices. I have tried to look at the log but it isn’t really in a human readable form and I don’t speak computer. ![]()
I would be inclined to put some Luup in the scenes to log what is happening in a form you are comfortable with. For example, the following Luup line will place your chosen message in the log with a time-stamp.
luup.log("Wakeup scene started.")
You can put different messages in the trigger event Luup and the actual scene run Luup. It doesn’t take much more to query the state of a device variable and log that too:
local device_num = "55" -- Change to appropriate device number
local status = luup.variable_get("urn:upnp-org:serviceId:SwitchPower1", "Status", device_num)
luup.log("Wakeup scene. Device "..device_num.." switch status is "..status)
All of the related scenes already have a ton of luup code in them and I’m not sure how to incorporate it. Would I just toss that on the end of the rest of the code? I could post the section from the log surrounding the time of the triggers though if that might be useful to anyone. I have looked through the log and there didn’t seem to be anything particularly unusual there. It says the scene started.
If the scene started but you didn’t get the results you expected, something in your Luup logic is not working the way you planned. By planting luup.log calls in strategic parts of the code, you should be able see what’s causing the malfunction.
If you have conditional logic (E.g. If something > somevalue then …) you can put a luup.log(“something:”…something…" somevalue:"…somevalue) just before the if to give you useful information. A common problem is variables returning nil when you were expecting a number. It can cause the code to just stop running - although there would normally be an error shown in the log.
Just planting luup.log(“Wakeup scene got to line 25”) type calls can be a very useful debug aid. Logging the value/state of your variables as the scene logic progresses should soon show you where it’s going off the tracks.
OK. I’m back home and have the time to tinker with this. Here is the code in my wakeup scene. This inhibits the scene if the google calendar switch reports me not working and if the combination switch reports me not in bed.
if (luup.variable_get("urn:micasaverde-com:serviceId:SecuritySensor1", "Tripped", 39) == "0" ) and (luup.variable_get("urn:micasaverde-com:serviceId:SecuritySensor1", "Tripped", 26) == "0" ) then
return true
else
return false
end
So I would simply tack
luup.log("Wakeup scene started.")
at the beginning?
I must add that I didn’t tinker with any of the constituents of this. It just stopped working on it’s own. Sounds crazy. Maybe I did change something by accident and can’t track it down.
Put the following code before the if statement:
luup.log("Wakeup scene triggered.")
luup.log("Sensor 39 Tripped status: "..luup.variable_get("urn:micasaverde-com:serviceId:SecuritySensor1", "Tripped", 39))
luup.log("Sensor 26 Tripped status: "..luup.variable_get("urn:micasaverde-com:serviceId:SecuritySensor1", "Tripped", 26))
Do something similar for other scenes. You should soon see the state of all the variables that your logic depends on which should allow you to see where it’s going awry.
Will do. I’ll report back on it tomorrow evening.
Thank you so much for your help! Without people like you Vera would only allow me to turn the lights off without getting out from in front of my pc.
Having LUA distributed at Scene level and Trigger level provides a lot of flexibility … but MCV does not provide tools to see all the pieces and how they interact. This adds a lot to the overall complexity of the task.
The PL plugins allow you to bring all of the pieces for a task into one place, inputs, Logic, and, resulting actions.
The Report allows you to easily see all the pieces and be able to figure out what it does. That reduces the overall complexity of the task.
There are things that PL plugin can’t do … but with the assistance of a few external plugins. I believe it will do 90% or better of the automation tasks.
@ RTS. Yes I understand. I would much rather use your tools but I had the elaborate setup working so I didn’t want to screw with it. The thought has come to mind that now would be a good time to make the switch. If tomorrow shows no definitive results I will make the move and and finally figure out how the PL tools work.
Thanks for the the input!
EDIT: Screw it. I’ll just make the change now.