| Both sides previous revision Previous revision Next revision | Previous revision |
| indigo_2025.2_documentation:plugin_guide [2026/05/04 15:23] – [Usage Guidance] davel17 | indigo_2025.2_documentation:plugin_guide [2026/05/04 23:49] (current) – [Plugin] davel17 |
|---|
| </Action> | </Action> |
| </code> | </code> |
| Notice that the ''uiPath="hidden"'' attribute will keep the action from displaying in the Indigo UI, but it will still be callable by your users using the URL structure shown above. | Notice that the ''uiPath="hidden"'' attribute will keep the action from displaying in the Indigo UI, but it will still be callable by your users using the URL structure shown above. Using the hidden attribute is optional but it is recommended for actions that are meant to be used solely as an API (otherwise, they will appear in Indigo's list of available actions. |
| |
| Here's how an action method is defined in your plugin: | Here's how an action method is defined in your plugin: |
| some_other_value = action.props["someOtherKey"] | some_other_value = action.props["someOtherKey"] |
| | |
| | # the reply must be valid JSON or an indigoDict() object |
| | reply = indigo.Dict() |
| | reply["content"] = some_other_value * 2 |
| | reply["status_code"] = 200 |
| return some_result | return some_result |
| </code> | </code> |
| |
| <code> | <code> |
| my_api_key = abcd1234efgh # obtained through the user's Indigo account | import httpx |
| myyreflector = "someReflectorID" # the name of the user's server machine on their Indigo account | |
| PLUGINID = "com.something.myPlugin" | |
| |
| my_url = https://myreflector.indigodomo.net/message/PLUGINID/actionId/?other=args&api-key=KEYHERE | MY_API_KEY = "abcd1234efgh" # obtained through the user's Indigo account |
| | MY_REFLECTOR = "someReflectorID" # the name of the user's server machine on their Indigo account |
| | PLUGIN_ID = "com.something.myPlugin" |
| | ACTION_ID = "handle_message" # The ID from Actions.xml (not an Action object ID number) |
| | |
| | # The payload must be valid JSON. The API does not support binary encoding and payloads should be of a reasonable size. |
| | payload = { |
| | "someKey": 1, |
| | "someOtherKey": 2, |
| | "field3": 3, |
| | } |
| | |
| | my_url = "https://MY_REFLECTOR.indigodomo.net/message/PLUGIN_ID/ACTION_ID/?other=payload&api-key=MY_API_KEY" |
| | response = httpx.get(my_url, verify=False) |
| | |
| | print(f"{response.status_code}") |
| | print(f"{response.text}") |
| </code> | </code> |
| |
| under construction | ''my_url'' will contain the response of a successful call (if the action returns a response) or an error if the call was unsuccessful (error codes above). Using the above example, the resonse will include ''24,691,356'' or "someOtherKey" * 2. |
| ===== Event and Message Flow ===== | ===== Event and Message Flow ===== |
| Under some circumstances, the Indigo Server will send callbacks to your plugin based on events that take place. For example, if your plugin devices expose features like Turn On, Turn Off or Status Request, Indigo will send a callback to your plugin so you can take actions on these events. There are many different callbacks that can occur which are documented extensively in the [[https://github.com/IndigoDomotics/IndigoSDK/releases/tag/v2025.1|SDK]]. | Under some circumstances, the Indigo Server will send callbacks to your plugin based on events that take place. For example, if your plugin devices expose features like Turn On, Turn Off or Status Request, Indigo will send a callback to your plugin so you can take actions on these events. There are many different callbacks that can occur which are documented extensively in the [[https://github.com/IndigoDomotics/IndigoSDK/releases/tag/v2025.1|SDK]]. |