I’ve got a Vera controller that I configure using the built-in web UI. It seems to do more advanced things (in my case, I want to ensure a scene is only triggered during a specific time window), that I need to edit Luup code directly.
But I don’t see where to get at the code for a scene. I can see where I can add some additional code that runs, but not code that executes when triggered.
Details: I have an electric water heater that is kept off unless the overhead lights are on (this is in my shop, and I don’t come here every day). During the most expensive time of day for electricity, I want to prevent it from turning on, and turn it off if it’s already on when that period starts. For that matter I kinda just want to turn it off at some hour of the day even if the lights are still on (a couple days ago I forgot to kill the lights when leaving, and the water heater was on for two days wasting money).
Hi
When you create the scene there is a a step 3 finish the scene- Also, execute the following Luup code:. below this you can add luup code. when the scene triggers this code is run before any actions are run. if this code returns true action follow. If false action do not run.
Just for info, In scene editor when you select your triggers there is an option to add luup code for the individual trigger. This code will only execute when that individual trigger has been activated, and runs before the othe luup code.
At the moment I am not capable of accessing the Vera GUI, but I can ssh into the Vera Plus command line. I wanted to check and possibly edit, using vi, the /etc/cmh/user_data.json file where I believe the lua_startup script is held. But I see that there are several of them with “.lzo” extensions. I am not sure what to do. Can anybody outline steps I can take to do that?
Sadly, you can’t enter luup code for a schedule trigger. I also want to turn one device on at a specified time if another device is on, but otherwise not.