Question re where to source State ID's

Posted on
Tue Jan 26, 2021 1:02 am
hwitten offline
Posts: 627
Joined: Dec 26, 2007
Location: British Columbia

Question re where to source State ID's

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.

Posted on
Tue Jan 26, 2021 5:49 am
DaveL17 offline
User avatar
Posts: 6739
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Question re where to source State ID's

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)

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Tue Jan 26, 2021 5:27 pm
hwitten offline
Posts: 627
Joined: Dec 26, 2007
Location: British Columbia

Re: Question re where to source State ID's

Thank you very much.

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 2 guests