Editing vera scripts?

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.

1 Like

Thank you, that works!

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.

Thanks from my side as well, this helped me a lot

Best Home Automation shopping experience. Shop at getvera!

© 2020 Vera Control Ltd., All Rights Reserved. Terms of Use | Privacy Policy | Forum Rules