Enable a scene when a virtual switch is on

Ok, so here’s the user story:
As a parent, I want a control panel switch that enables / disables a triggered action so that when it is past bedtime, my toddler’s bedroom light goes off whenever he turns it on.

I have a scene set up that works on the trigger of “bedroom light on” and has a single action of “bedroom light off”. The reason I’m looking for something better is the annoyance of how Vera has to reload something every time a scene is enabled or disabled.

I’ve added the virtual switch app (for the “enabled / disabled” function), and a Reactor device that “ands” the virtual switch with the light switch being “on”, then triggers the scene that turns the light switch “off”.

I’m not sure what needs to be done in Reactor – does this need to be armed? Or could I simplify this somewhat and just use the enabled/disabled function with the scene instead of the virtual switch?

Thoughts?

[quote=“doctorkb, post:1, topic:200248”]Ok, so here’s the user story:
As a parent, I want a control panel switch that enables / disables a triggered action so that when it is past bedtime, my toddler’s bedroom light goes off whenever he turns it on.

I have a scene set up that works on the trigger of “bedroom light on” and has a single action of “bedroom light off”. The reason I’m looking for something better is the annoyance of how Vera has to reload something every time a scene is enabled or disabled.

I’ve added the virtual switch app (for the “enabled / disabled” function), and a Reactor device that “ands” the virtual switch with the light switch being “on”, then triggers the scene that turns the light switch “off”.

I’m not sure what needs to be done in Reactor – does this need to be armed? Or could I simplify this somewhat and just use the enabled/disabled function with the scene instead of the virtual switch?

Thoughts?[/quote]

What you’ve described seems like exactly the right approach. But here’s my re-cap of the steps just for certainty:

  1. Set up a scene to turn the light off. This is a manually-triggered scene; do not set a device trigger on it.
  2. Set up a ReactorSensor with two conditions in one group:
    • Service condition, device=virtual switch, variable=Status, operator “=”, value “1” (assuming you want the scene to run only when the VSwitch is ON);
    • Service condition, device=light switch, variable=Status, operator “=”, value “1”
  3. On the ReactorSensor’s Activities tab, set the “Trip” scene to the scene you created in the first step, and leave the “untrip” scene empty/unassigned.
  4. On the ReactorSensor’s Control tab, click the “Restart” button to restart the sensor logic, updated from these changes.

That should do it as described. When the scene turns off the light, the ReactorSensor will untrip itself (because the second condition is no longer true after the scene finishes). This transition will be very quick, so you won’t see it in Vera’s UI (which updates about once every 2 seconds–Reactor will get this done in milliseconds), but the behavior of the actual lights and switches should make it apparent that it’s working.

Thanks!

Just to simplify it – could the “on/off” switch be the “enable /disable” switch in the Reactor sensor? (removing the virtual switch)

I couldn’t find any documentation on the armed/disarmed switch, either… not sure what state that needs to be in.

Thanks again – this looks like a very powerful tool, I’m just working out how to best apply it. :slight_smile:

[quote=“doctorkb, post:3, topic:200248”]Thanks!

Just to simplify it – could the “on/off” switch be the “enable /disable” switch in the Reactor sensor? (removing the virtual switch)[/quote]

Yes, that should work.

I couldn't find any documentation on the armed/disarmed switch, either... not sure what state that needs to be in.

Thanks again – this looks like a very powerful tool, I’m just working out how to best apply it. :slight_smile:

Armed/disarmed is part of the contract for SecuritySensor1 devices (which a ReactorSensor can emulate). It does not affect the operation of the sensor in any way. All it does is signal to other things, like scene triggers, if the sensor’s tripped state should or should not be reacted to. For example, you may want a motion sensor to turn on an alarm only if the sensor trips and it’s armed (meaning, presumably, you’re not home), but not trip if it senses motion (trips) while you’re at home walking around (sensor disarmed). In contrast, you likely would want a smoke detector to turn on a siren when the sensor trips whether it’s armed or not (arming state doesn’t matter–if there’s fire, tell me). On UI7, the armed/disarmed state is related to house modes, so if you use house modes, the Vera will change the armed/disarmed state when the house mode changes (see My Modes in the Dashboard). But none of this applies in your use case as we’ve set it up above, so don’t worry about it.

There’s some description of armed/disarmed here, but it’s very incomplete (as Vera’s Wiki has unfortunately been for some time): http://wiki.micasaverde.com/index.php/Luup_UPnP_Variables_and_Actions#SecuritySensor1

1 Like

Yup, it’s true. This is a great plugin.

Between this and DEMII, I’m holding off on switching to another platform like Homeseer… Vera has been ticking me off lately, but not quite enough to give up those.

1 Like