Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
indigo_7_documentation:plugins:variable_substitution [2017/01/18 17:29] jayindigo_7_documentation:plugins:variable_substitution [2025/02/18 20:36] (current) – external edit 127.0.0.1
Line 1: Line 1:
 +====== Substitutions ======
 +
 +Plugin writers can enable configuration text fields to accept special markup that will substitute a variable or device state value at runtime. Any string with the following markup will have an Indigo variable value substituted:
 +
 +<code>%%v:VARID%%</code>
 +
 +VARID is the unique variable ID as found in the UI in various places.
 +
 +So, for instance, if one of your actions is to use the [[growl_1|Growl plugin]] to do a notification, in the title and/or description fields you could enter something like this:
 +
 +<code>Turn on the A/C unit - the outside temperature is %%v:VARID%%.</code>
 +
 +The value specified would be substituted just before the notification was sent.
 +
 +Likewise, if you use the following markup:
 +
 +<code>%%d:DEVID:STATEID%%</code>
 +
 +The STATEID of the device whose ID is DEVID will be substituted. For instance, an iTunes Server device from the iTunes plugin has a state named **''album''**. So, if the ID of your iTunes server device was 123456, then this would insert the album title into the field:
 +
 +<code>The current album playing is %%d:123456:album%%.</code>
 +
 +Note - not all text fields will support substitution. The plugin developer must enable it specifically. Check the plugin documentation to see if the field you're interested in supports substitution.