Skip to content
DaveL17 edited this page Dec 29, 2023 · 9 revisions

You can invoke plugin actions through Python code using the steps outlined below. Each action may be different in the way the method is uses, so it's best to follow the steps for that particular action.

The bundle identifier for the Matplotlib plugin is: com.fogbert.indigoplugin.GhostXML

Adjust Device Refresh Time Refresh Data For All Devices Refresh Data for Device


Adjust Device Refresh Time

You can invoke the Indigo Action item Adjust Device Refresh Time through a simple Python script:

plugin=indigo.server.getPlugin("com.fogbert.indigoplugin.GhostXML")
plugin.executeAction("adjust_refresh_time_for_dev", 1186207654, {'new_refresh_freq': 60})

adjust_refresh_time_for_dev
1186207654 (Device ID - int - required)
{'new_refresh_freq': refresh frequency} (seconds - int - required)

If successful, the plugin is silent. If you receive a InvalidParameter error or an ArgumentError error, check your call to executeAction() to ensure your parameters are correct and in the proper order.


Refresh Data For All Devices

You can invoke the Indigo Action item Refresh Data For All Devices through a simple Python script:

plugin=indigo.server.getPlugin("com.fogbert.indigoplugin.GhostXML")
plugin.executeAction("refresh_data")

refresh_data

This action accepts no other parameters. It is unlikely that calling this Action would result in an error. However, if you call this action with no plugin devices enabled, a warning message will be written to the Events log.


Refresh Data For Device

You can invoke the Indigo Action item Refresh Data For Device through a simple Python script:

plugin=indigo.server.getPlugin("com.fogbert.indigoplugin.GhostXML")
plugin.executeAction("refresh_data_for_dev", 1186207654)

refresh_data_for_dev
1186207654 (Device ID - int - required)

The device does not require any other parameters. If you include a props dictionary it will be ignored. If you receive a ValueError, it is likely that you have not included a valid Indigo device ID. If you receive an ArgumentError it is likely that you did not include a device ID or that the value is not in the proper format (i.e., providing the device ID as a string instead of a required integer.) You must use the device ID--Indigo does not accept a device name in this situation.

Clone this wiki locally