Page 1 of 1

Using %%d:DEVICEID:STATEKEY%% in e-mail notification

PostPosted: Tue Mar 22, 2016 7:21 pm
by Pierre
Hi guys,

I wish to use the available notification plug-in to generate email with rich content, ex: In the situation of a High Temperature condition detected, start cooling process, but send periodic Warning message with actual Temp in order to follow the tendency of the measured temperature and the cooling process.

I wish to use the %%d:DEVICEID:STATEKEY%% , but I don't know where to start with this.

Thanks in advance

Piere

Re: Using %%d:DEVICEID:STATEKEY%% in e-mail notification

PostPosted: Tue Mar 22, 2016 7:40 pm
by FlyingDiver
Which plugin are you trying to use? My BetterEmail plugin will send emails and you can call it's action from any trigger you set up to detect the over/under temperature condition. Then you can use the %%d:DEVICEID:STATEKEY%% syntax in the template for either the subject or the body of the email.

Re: Using %%d:DEVICEID:STATEKEY%% in e-mail notification

PostPosted: Tue Mar 22, 2016 8:16 pm
by Pierre
Hi Joe,

I will certainly use use your plug-in for e-mail. For now, I was just trying to do build rich notification with Growl to learn how to use the %%d:DEVICEID:STATEKEY%% syntax, but I don't know where to find the state key values.

Thanks for you plugin reference, it looks great

Pierre

Re: Using %%d:DEVICEID:STATEKEY%% in e-mail notification

PostPosted: Wed Mar 23, 2016 2:21 am
by FlyingDiver
You're looking for the list of states available for a specific device? In the main Indigo database window, select a device (any device). Then drag the top of the gray details panel (bottom of right side of window) up from the little dot above the device name. The panel will expand and show the device specific "Custom States" below the "Device Details". Those are the STATEKEY names you can use.

Re: Using %%d:DEVICEID:STATEKEY%% in e-mail notification

PostPosted: Thu Mar 24, 2016 4:52 pm
by Pierre
HI,

Are you talking about the Custom States value that are visible under the device details at the bottom of the main Device windows ?

Thanks in advance

Pierre

Re: Using %%d:DEVICEID:STATEKEY%% in e-mail notification

PostPosted: Thu Mar 24, 2016 4:59 pm
by FlyingDiver
Pierre wrote:
HI,

Are you talking about the Custom States value that are visible under the device details at the bottom of the main Device windows ?

Thanks in advance

Pierre


Yes.

Re: Using %%d:DEVICEID:STATEKEY%% in e-mail notification

PostPosted: Thu Mar 24, 2016 6:45 pm
by Pierre
Ok, we were talking about the same thing.

I was testing a new Insteon Thermostat 2441ZTH and their is no custom property at all.

Thanks for your help

Pierre

Re: Using %%d:DEVICEID:STATEKEY%% in e-mail notification

PostPosted: Thu Mar 24, 2016 6:54 pm
by FlyingDiver
Pierre wrote:
Ok, we were talking about the same thing.

I was testing a new Insteon Thermostat 2441ZTH and their is no custom property at all.

Thanks for your help

Pierre


If it's a standard device type, like a thermostat, then you don't need the custom properties. The device details should list the standard device properties you can reference.

Using %%d:DEVICEID:STATEKEY%% in e-mail notification

PostPosted: Fri Mar 25, 2016 4:09 am
by DaveL17
For any Inidigo device, you can get a list of all available device states with the following Python snippet (replace the number with the device ID of your device):
Code: Select all
dev = indigo.devices[71199202]
indigo.server.log(str(dev.states))

Which, for this device type, yields:
Code: Select all
  Script                          States : (dict)
     humidityInput1 : 22 (real)
     humidityInputsAll : 22 (string)
     hvacFanMode : 1 (integer)
     hvacFanMode.ui : always on (string)
     hvacFanModeIsAlwaysOn : true (bool)
     hvacFanModeIsAuto : false (bool)
     hvacOperationMode : 2 (integer)
     hvacOperationMode.ui : cool on (string)
     hvacOperationModeIsAuto : false (bool)
     hvacOperationModeIsCool : true (bool)
     hvacOperationModeIsHeat : false (bool)
     hvacOperationModeIsOff : false (bool)
     hvacOperationModeIsProgramAuto : false (bool)
     hvacOperationModeIsProgramCool : false (bool)
     hvacOperationModeIsProgramHeat : false (bool)
     setpointCool : 78 (real)
     setpointHeat : 72 (real)
     temperatureInput1 : 75 (real)
     temperatureInputsAll : 75 (string)

Then it's just:
Code: Select all
%%d:71199202:setpointHeat%%