How do I set "timer enabled" checkbox?

Hi all;

Im trying to get a timer-based scene to be “toggled enabled”. In other words I want to set up a in-wall scene controller button that will call code to “enable” and “disable” all the scene timers.

I see in the timer UI a checkbox to indicate if time is activated or not. what property is that checkbox setting/unsetting on that timer? I have not seen any LUUP extensions that let me query timer status/state, or to disable/unset a timer once it is set. I would like to avoid the hacks of setting up virtual devices and binary flags if possible.

Thanks alot

AFAIK, there is no way to un-/check the checkbox via Luup.

As a workaround you could:

[ul][li]Add a custom flag to your scene controller via [tt]luup.variable_set[/tt].[/li]
[li]Setup an additional scene which receives the toggle events and toggles the new custom flag.[/li]
[li]Add Luup code to your existing scene that [tt]return[/tt]s the state of the new custom flag ([tt]false[/tt]/[tt]true[/tt] via [tt]luup.variable_get[/tt]) (a scene whose Luup return code is [tt]false[/tt] doesn’t run at all) [/li][/ul]

[quote=“Ap15e, post:2, topic:167819”]AFAIK, there is no way to un-/check the checkbox via Luup.

As a workaround you could:

[ul][li]Add a custom flag to your scene controller via [tt]luup.variable_set[/tt].[/li]
[li]Setup an additional scene which receives the toggle events and toggles the new custom flag.[/li]
[li]Add Luup code to your existing scene that [tt]return[/tt]s the state of the new custom flag ([tt]false[/tt]/[tt]true[/tt] via [tt]luup.variable_get[/tt]) (a scene whose Luup return code is [tt]false[/tt] doesn’t run at all) [/li][/ul][/quote]

Hi ap15e

Thanks for getting back to me. Sorry I didnt see this reply until now.

I spoke to MiOS support, and the UI is simply a “plugin”, which means that there must be some programmatic interface that is used to set/unset some number of variables when that checkbox checks set and cleared. The real question is is that variable set exposed via LUUP extensions. I have filed a bug with extensive requests to enhance the timer system to 1. allow access to that 2. set and clear timers in a more coherent way 3. allow for recurring timers in the “call_timer” extension.

As for using the scene controller, I was trying to use the state of the LED as the flag, but even though the .xml file seems to indicate that there is a state variable table tracking it (called “Light”), when I try to retrieve that variable, I get “nil”. I would love to use the “is active” state of the scene as the flag, but haven’t been able to track down how to get THAT variable either, which must be some active, as that is how MiOS knows what action to take when scene controller is clicked. If you know either of these two items, I would love to hear your thoughts.

thanks

I do this by using a “Virtual Device”. The scene button will set (or reset) the virtual device, then I test the virtual device status in my timed events to see if I should proceed or not.

Search for “Virtual Device” for information on how to implement.

http://forum.micasaverde.com/index.php?topic=2495.msg37300#msg37300

Hi all;

Seems kinda odd to do a virtual device when I have a real device already maintaing the state I need. the Leviton scene controller which is represented by S_SceneControllerLED1.xml. Inside S_SceneControllerLED1 there is the following state table:

Light ui1

which I would imagine is how vera keeps track of the state of each of the buttons, as the scene controller device UI has the ability to set which scenes to run when button is turned “on” and “off”, ostensibly determining whether a button is on or off by whether the LED representing it is “on” or “off” .

I have the following line of code that should extract the state of the 4th light, but the value returned is “nil”;

local holiday_mode=luup.variable_get(“urn:micasaverde-com:serviceId:SceneControllerLED1”,“Light[4]”,11)

I have tried all variants of coding to get the value out, but keep getting “nil”. If there is something I’m missing, or not doing properly in LUA (not really expert on LUA coding), I’d be grateful if you could point it out. If I can solve this issue, I can release the installation Im working on, and actually sell more vera units, so if anyone can figure this out, I would be most appreciative.

I see in the timer UI a checkbox to indicate if time is activated or not. what property is that checkbox setting/unsetting on that timer? I have not seen any LUUP extensions that let me query timer status/state, or to disable/unset a timer once it is set. I would like to avoid the hacks of setting up virtual devices and binary flags if possible.

mikkelj has found a partial (and risky :)) solution to your problem:
http://forum.micasaverde.com/index.php?topic=6277.0