Conditions in Schedules and Triggers

Each Schedule and each Trigger have the ability to conditionally fire: that is, when the time/date specifier is reached or the trigger event occurs, you can have other “conditions” checked before the actions are executed. The Condition tab in the Schedule and Trigger dialogs allow you to specify these extra conditions.

Let's take a very common scenario: you want some of your Schedules to not fire when you're on vacation, and likewise you have some other Schedules that you want to fire only when you're on vacation. Here's one way of doing that. The Sample House database that comes with Indigo already contains a variable named houseMode, which is set to a value of awake. Obviously, the intent here was to create some “awake” vs “asleep” mode in your house. However, we're gonna also use this variable to represent another state: vacation. Obviously, we could use another variable just as easily, but it seems like houseMode is pretty much exactly what we need.

First, let's take a Schedule that you've already defined that you only want to fire when you're not on vacation. For example, in the Sample House database, we have a Schedule called trash day reminder. It seems kinda silly to have a reminder to take out the trash happen when you're on vacation. So, let's edit that action so that it will only fire when we're not on vacation:

  1. Double-click on the Schedule (or Trigger) in the List view. This will open up the Edit dialog
  2. Click on the Condition tab
  3. Click on the If Variable radio button
  4. Select houseMode from the popup list of variables
  5. Click on the not equal to: radio button
  6. Enter “vacation” in the text box next to not equal to:
  7. Click the OK button to save the change

That's it! Now, when it's time to fire the actions in the trash day reminder Schedule (or your own Action), Indigo will first make sure that the value of the variable houseMode: if it isn't vacation the actions will fire. You can do the same thing, but in reverse, for things you want to happen only if you're on vacation. For instance, you might want to create a Schedule with some randomized times that turn on/off lights - making your house look more lived in. But you might not want those running when you're at home, so you'd just make the condition “if variable houseMode equals vacation”.

Now, you only need some way of triggering the variable change from awake or asleep to vacation. The easy way is to just change it in the Indigo User Interface or via the web interface. However, you can also create a trigger action so that when you press a button on a controller (say, a KeypadLinc button), it changes the value of the variable to vacation when the button goes on and awake when the button goes off. Or, have a Schedule that changes the variable value when you schedule a vacation start event, and another to change it back when you schedule a return event. The latter has the advantage that if you have different Thermostat settings depending on the variable, you can schedule the return event a couple of hours before you return home so your house is at it's normal temperature when you come back home.

Congratulations! You've now discovered the power of using Conditions in Schedules and Triggers in conjunction with variables to alter the behavior of your Home Automation system.

conditions.txt · Last modified: 2019/01/26 00:10 (external edit)

© Perceptive Automation, LLC. · Privacy