Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| scenes_restore_state [2019/09/17 19:59] – [Create ON Trigger Action] jay | scenes_restore_state [2026/04/07 18:27] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Create a scene (multiple devices on/off with one command) that restores prior settings ====== | ||
| + | This is an advanced scene scenario (requiring Indigo 7.4+), based on the basic [[scenes]] How-To, with some additional functionality. It is sometimes desirable to return a light or other device to a previous state when a " | ||
| + | |||
| + | Earlier versions of this how-to required scripts - but with Indigo 7.4+, you can do it completely through the UI. | ||
| + | |||
| + | ===== What you need to start ===== | ||
| + | * Some devices to control (typically lights, but could also be devices such as window shade controllers) | ||
| + | * Something to trigger the scene (typically a switch or remote) | ||
| + | |||
| + | ===== Scenario Overview ===== | ||
| + | To recap the [[scenes]] scenario: Joe has some nice wall sconce lights in his TV room that are controlled by an [[inst_in_wall_dimmer|SwitchLinc]] and a table lamp connected through an [[inst_plug_in_dimmer|ICON Lamp Module]]. He also has just installed some X10 controllable window shades (an X10 ON command lowers them, an X10 OFF command raises them in this example). He has a [[inst_controller|ControLinc]] that he wants to set up so that when he hits Button 1 ON, the sconces dim to 20%, the table lamp turns off, and the window shades go down. Here's the difference between the basic scenario and this one: when he hits Button 1 OFF, the sconces, the table lamp, and the window shades will return to their previous state. In other words, the room will look like it did before he pressed the Button 1 ON. This scenario will require Indigo 4.0 Pro since we'll need to use some AppleScript. | ||
| + | |||
| + | ===== Steps to create this scenario ===== | ||
| + | This scenario isn't really too difficult, but it does require a Python script, which we will provide here: | ||
| + | |||
| + | === Create a variable for each device for which you want to restore the state === | ||
| + | - Open the Variable window by selecting **'' | ||
| + | - Click on the **'' | ||
| + | - Double-click on the new variable' | ||
| + | - Repeat steps 2 and 3 again, this time naming the variable " | ||
| + | - Repeat steps 2 and 3 once more, this time naming the variable " | ||
| + | |||
| + | You now have 3 variables, named " | ||
| + | |||
| + | === Create ON Trigger Action === | ||
| + | So, now we need to create 2 trigger actions so that when Joe presses the right buttons on his ControLinc, the actions listed in the scenario above happen correctly. The first one will be for the On command: | ||
| + | |||
| + | - Select **'' | ||
| + | - Click the **'' | ||
| + | - Name the trigger "Start watching a movie" | ||
| + | - Select **'' | ||
| + | - Click the **'' | ||
| + | - Select the name of the ControLinc from the device popup next to the word **'' | ||
| + | - Select **'' | ||
| + | - That specifies that this trigger will fire when the Button 1 ON command is received from the ControLinc - now select the **'' | ||
| + | - Select **'' | ||
| + | - In the **'' | ||
| + | - In the resulting config dialog (click **'' | ||
| + | - Click the **'' | ||
| + | - Click the **'' | ||
| + | - Repeat steps 9-13 for the lamp device and the shades device (on the latter, you'll select **'' | ||
| + | - That takes care of storing the states, now we want to actually change them to their desired states - click on the **'' | ||
| + | - Select **'' | ||
| + | - Select the device that represents the sconces from the **'' | ||
| + | - Enter 20 in the text field next to **'' | ||
| + | - Now, add another for the lamp by clicking on the **'' | ||
| + | - Select **'' | ||
| + | - Select the device that represents the table lamp from the **'' | ||
| + | - Now, add one more for the blinds by clicking on the **'' | ||
| + | - Select **'' | ||
| + | - Select **'' | ||
| + | - Select the device that represents the blinds from the **'' | ||
| + | |||
| + | That's it! So, to recap, what we did was create a trigger action that will fire when " | ||
| + | |||
| + | === Create OFF Trigger Action === | ||
| + | As you may have guessed, we need to create another trigger like the one above, except it reverses the process: | ||
| + | |||
| + | - Select **'' | ||
| + | - Click the **'' | ||
| + | - Name the trigger "Stop watching a movie" | ||
| + | - Select **'' | ||
| + | - Click the **'' | ||
| + | - Select the name of the ControLinc from the device popup next to the word **'' | ||
| + | - Select **'' | ||
| + | - That specifies that this trigger will fire when the Button 1 Off command is received from the ControLinc - now select the **'' | ||
| + | - Select **'' | ||
| + | - Select **'' | ||
| + | - Select the device that represents the sconces from the **'' | ||
| + | - Click the **'' | ||
| + | - Click the **'' | ||
| + | - Select **'' | ||
| + | - Select **'' | ||
| + | - Select the device that represents the lamp from the **'' | ||
| + | - Click the **'' | ||
| + | - Click the **'' | ||
| + | - Select **'' | ||
| + | - Select **'' | ||
| + | - Select the device that represents the shades from the **'' | ||
| + | - Click the **'' | ||
| + | |||
| + | ===== Congratulations! ===== | ||
| + | You've now created two scenes for Joe's TV room: one he'll use when watching a movie and another that returns the room to its previous state. As you can probably see, there are other things you can do to make this scene even more useful: if you have an [[inst_irlinc|Infrared receiver]], you could program a button on your current IR remote to trigger the actions. If you have A/V devices supported by a [[http:// | ||
| + | |||
| + | ====== A word about Action Groups ====== | ||
| + | In a simple trigger action, there is probably only one action that you want to take. In the scenario that we just finished, though, we have several actions we want to perform (adjust 2 different lights and the window shades). Indigo lets you specify multiple actions in the " | ||