Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| indigo_2025.1_documentation:overview [2025/09/22 19:58] – created - external edit 127.0.0.1 | indigo_2025.1_documentation:overview [2025/10/22 20:48] (current) – [Web Server Event] davel17 | ||
|---|---|---|---|
| Line 160: | Line 160: | ||
| Plugins may define events as well - these will be listed below the '' | Plugins may define events as well - these will be listed below the '' | ||
| + | ==== Web Server Event ==== | ||
| + | |||
| + | {{: | ||
| + | |||
| + | Use the type //'' | ||
| + | |||
| + | ^ Field ^ Description ^ | ||
| + | | Webhook ID | This is a random code generated by Indigo. It's used to identify which webhook is associated with the event. You can use the code provided or use one of your own. NOTE: if someone has your Reflector URL and the webhook ID, they can cause the event to fire. If you use your own ID, it's best not to make it easily guessable.| | ||
| + | | Webhook Method\\ [POST] | Use //'' | ||
| + | | POST Processing\\ [JSON] | this type of webhook will accept a POST and interpret the payload as JSON. | | ||
| + | | POST Processing\\ [HTML Form] | this type of webhook will accept a POST with optional form data, which will be converted into a dict of name value pairs and passed through as data. | | ||
| + | | Webhook Method\\ [GET] | this type of webhook will accept a GET and will pass through any query arguments as the data element. GET webhooks do not have settings for processing the associated payload. | | ||
| + | |||
| + | You can find more information on the [[indigo_2025.1_documentation: | ||
| ===== Schedules ===== | ===== Schedules ===== | ||
| Line 441: | Line 455: | ||
| {{open_file_action.png? | {{open_file_action.png? | ||
| - | This will open the specified file (full path using *nix slashes ("/" | + | This will open the specified file (full path using *nix slashes ("/" |
| == Run Shell Script == | == Run Shell Script == | ||
| {{run_shell_script_action.png? | {{run_shell_script_action.png? | ||
| Line 453: | Line 467: | ||
| == Write to Log == | == Write to Log == | ||
| - | {{write_to_log_action_2023_1.png?nolink|Write to Log Action Image}} | + | {{: |
| - | This will write the specified text into the event log - optionally with the specified type string. In addition, you can select from three logging levels: '' | + | This will write the specified text into the event log - optionally with the specified type string. |
| + | |||
| + | In addition, you can select from three logging levels: '' | ||
| == Email Event Log Data == | == Email Event Log Data == | ||
| {{email_log_action.png? | {{email_log_action.png? | ||
| Line 487: | Line 503: | ||
| Use this action type to allow Indigo to fire Apple Shortcuts, provided your server is running a version of macOS that supports the Shortcuts app. The configuration dialog will present a list of all Shortcuts on the server machine as well as an input field to pass optional text to the selected shortcut when it's run. | Use this action type to allow Indigo to fire Apple Shortcuts, provided your server is running a version of macOS that supports the Shortcuts app. The configuration dialog will present a list of all Shortcuts on the server machine as well as an input field to pass optional text to the selected shortcut when it's run. | ||
| - | {{: | + | {{: |
| + | |||
| + | The mechanism in Shortcuts to get a dictionary from input is extremely picky about the JSON that it's fed. When checked, the checkbox in this dialog explicitly encodes the input as JSON to make things work better. It defaults to off so existing shortcuts won't be encoded. If you pass an [[indigo_2025.1_documentation: | ||
| + | |||
| + | You can also optionally save any return data to a variable. | ||
| ==== Variable Actions ==== | ==== Variable Actions ==== | ||
| {{variable_actions_type_menu.png? | {{variable_actions_type_menu.png? | ||
| Line 509: | Line 529: | ||
| Click the '' | Click the '' | ||
| + | === Insert Event Data into Variable === | ||
| + | {{: | ||
| + | |||
| + | Click the '' | ||
| === Toggle Variable === | === Toggle Variable === | ||
| {{toggle_variable_action.png? | {{toggle_variable_action.png? | ||
| Line 818: | Line 842: | ||
| "If variable" | "If variable" | ||
| </ | </ | ||
| + | |||
| + | ==== Condition Scripts ==== | ||
| If, however, you still can't express your conditional logic using the rule editor, you can still select the '' | If, however, you still can't express your conditional logic using the rule editor, you can still select the '' | ||
| Line 829: | Line 855: | ||
| </ | </ | ||
| The ''// | The ''// | ||
| + | |||
| + | In Indigo 2025.1+, you can access the new Event Data dictionary that's passed through the chain to perform custom logic. For instance, you can create a simple condition script that will look at the event data from a Z-Wave Command Received trigger to decide if you want the actions to process or not. This is what the event_data dictionary would look like from a Z-Wave Command Received trigger: | ||
| + | |||
| + | < | ||
| + | event_data = { | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | The script could look something like this: | ||
| + | |||
| + | < | ||
| + | # Devices that you want to continue processing | ||
| + | my_device_list = [1234567890, | ||
| + | if event_data[" | ||
| + | return True | ||
| + | return False | ||
| + | </ | ||
| + | |||
| + | The **'' | ||
| ----------------------- | ----------------------- | ||
| //Z-Wave® is a registered trademark of Sigma Designs, Inc. Indigo' | //Z-Wave® is a registered trademark of Sigma Designs, Inc. Indigo' | ||