Page 1 of 1

Question re where to source State ID's

PostPosted: Tue Jan 26, 2021 1:02 am
by hwitten
Coming to the party kinda late but I just replaced an aging DSC with a current panel and EnvisaLink 4. Have everything working. Am now working on email messaging and control page(s).

Can't quite wrap my head around State ID's, which I want/need, for use with BetterEmail, etc.
I will tackle it again tomorrow when fresh but thought I'd ask in case I'm just tired and missing something obvious as to where to find the State ID's for KeyPad, etc.

If it's written up already, my apologies. A pointer to same would be very much appreciated.

BTW... a BIG thank you for the Plugin.

Re: Question re where to source State ID's

PostPosted: Tue Jan 26, 2021 5:49 am
by DaveL17
Within the Indigo UI, click on the device you're interested in. In the lower pane below the pane that displays the device details you will sometimes see a device states pane. You may have to scroll to see it (Apple has hidden scroll bars by default, so this is less than obvious). This pane is where you can see any custom states that a plugin device makes available.

The Better Email plugin supports what are called device substitutions. You reference these with the device ID and custom state name (it doesn't have to be a plugin device) using this structure:
Code: Select all
%%d:12345678:stateName%%
or for variables:
Code: Select all
%%v:12345678%%
(this works for variables, too.) Then simply refer to the substitution in your email message:

The value of the state is %%d:12345678:stateName%%.

To see all the states that a device has available, you can use a small bit of Python code:
Code: Select all
dev = indigo.devices[12345678]
indigo.server.log(str(dev.states))


(If it's not obvious, you need to replace 12345678 with the ID of your device)

Re: Question re where to source State ID's

PostPosted: Tue Jan 26, 2021 5:27 pm
by hwitten
Thank you very much.