Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| indigo_2025.1_documentation:events_data_passing [2025/09/23 10:34] – [How do you pass data through?] davel17 | indigo_2025.1_documentation:events_data_passing [2025/12/14 20:10] (current) – [How do you pass data through?] jay | ||
|---|---|---|---|
| Line 46: | Line 46: | ||
| < | < | ||
| + | message = {" | ||
| indigo.trigger.execute(trigger_instance, | indigo.trigger.execute(trigger_instance, | ||
| </ | </ | ||
| Line 55: | Line 56: | ||
| * You probably want to name your keys with something that's easily identified with your plugin. For instance, the Z-Wave plugin uses the prefix `zwavecmd-` for it's keys that describe the event data that it passes through. | * You probably want to name your keys with something that's easily identified with your plugin. For instance, the Z-Wave plugin uses the prefix `zwavecmd-` for it's keys that describe the event data that it passes through. | ||
| * We tried to use dashes `-` as separators rather than underscores - we think that's a better option for string keys. | * We tried to use dashes `-` as separators rather than underscores - we think that's a better option for string keys. | ||
| - | | + | |
| FYI, you can pass arbitrary data around using the IOM and the various `.execute()` actions on Triggers, Schedules, and Action Groups. Just pass through //'' | FYI, you can pass arbitrary data around using the IOM and the various `.execute()` actions on Triggers, Schedules, and Action Groups. Just pass through //'' | ||
| Line 94: | Line 95: | ||
| This is a complete action handler with type hints. While we don't envision a scenario where //'' | This is a complete action handler with type hints. While we don't envision a scenario where //'' | ||
| - | === Examples of how it may be used === | + | === Examples of How Events Data Can Be Used === |
| + | There are likely a lot of different scenarios where //'' | ||
| - | There are likely a lot of different scenarios where //'' | + | Create an Action: |
| + | * Create an Action Group called "Log Event Data" | ||
| + | * Select **Server Actions** > **Script and File Actions** > **Execute Script** | ||
| + | * Select Embedded Python and enter the following short script into the code block. Notice that we didn't do anything special to access the //'' | ||
| + | < | ||
| + | indigo.server.log(f" | ||
| + | </ | ||
| + | * Select OK | ||
| + | |||
| + | Create a Trigger to fire the action: | ||
| + | * Create a Trigger called "Log Event Data" | ||
| + | * You can link it to an event, but for this example the event type doesn' | ||
| + | * You can also set a Condition, but for this example the condition doesn' | ||
| + | * On the Actions tab, select **Server Actions** > **Execute Actions Group** | ||
| + | * Select the "Log Event Data" Action you created above | ||
| + | * Select OK | ||
| + | |||
| + | Now, from the Actions list in Indigo, highlight the "Log Event Data" Trigger and select **Execute Actions Only**. When your Trigger fires the script, something similar to the following should appear in the Events log: | ||
| + | |||
| + | < | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | </ | ||
| + | It's that simple. | ||
| + | |||
| + | === Get Creative === | ||
| + | The new //'' | ||