Device state - not working

Posted on
Sat Oct 05, 2019 5:56 pm
SMUSEBY offline
Posts: 511
Joined: Sep 16, 2009
Location: California

Device state - not working

I've tried two ways to report the device state as I read the documentation (one at the bottom of the plug-in, the other from documentation), and neither is inserting the device state into the email message created.

Two lines from my better email plug-in:
Code: Select all
The Tank temperature is %%d:892742387:StateID%%.
Tank is now %%d:163642000:someStateID%%.


Resulting in the email message,
The Tank temperature is .
Tank is now .

Note: the tank temperature is a Phidgets device, not a variable.

Posted on
Sat Oct 05, 2019 6:21 pm
FlyingDiver offline
User avatar
Posts: 7217
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Device state - not working

SMUSEBY wrote:
I've tried two ways to report the device state as I read the documentation (one at the bottom of the plug-in, the other from documentation), and neither is inserting the device state into the email message created.

Two lines from my better email plug-in:
Code: Select all
The Tank temperature is %%d:892742387:StateID%%.
Tank is now %%d:163642000:someStateID%%.


Resulting in the email message,
The Tank temperature is .
Tank is now .

Note: the tank temperature is a Phidgets device, not a variable.


Why do you not have the actual state name/ID in there?

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Sat Oct 05, 2019 6:49 pm
SMUSEBY offline
Posts: 511
Joined: Sep 16, 2009
Location: California

Re: Device state - not working

I used the device ID.
What is the "actual state name ID"?

Posted on
Sat Oct 05, 2019 6:54 pm
FlyingDiver offline
User avatar
Posts: 7217
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Device state - not working

SMUSEBY wrote:
I used the device ID.
What is the "actual state name ID"?


Devices have states. You need to identify which state you want in there. I'm not a Phidgets user, so I don't know what those devices use. If it's a simple value sensor (one value per device), use "sensorValue" if you want the raw number, "sensorValue.ui" if you want the formatted number that's shown in the Indigo UI.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Sat Oct 05, 2019 6:56 pm
SMUSEBY offline
Posts: 511
Joined: Sep 16, 2009
Location: California

Re: Device state - not working

what value do I use for a device (on or off?)?

Posted on
Sat Oct 05, 2019 6:58 pm
FlyingDiver offline
User avatar
Posts: 7217
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Device state - not working

SMUSEBY wrote:
what value do I use for a device (on or off?)?


An on/off sensor, like a motion sensor? That would be 'onOffState'.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Sat Oct 05, 2019 7:49 pm
SMUSEBY offline
Posts: 511
Joined: Sep 16, 2009
Location: California

Re: Device state - not working

Not a sensor; for this instance, I want the on/off state for a device.
Is there a list of Indigo states that would be appropriate for this field? I'm guessing that the syntax needs to be precise.

Posted on
Sat Oct 05, 2019 8:13 pm
FlyingDiver offline
User avatar
Posts: 7217
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Device state - not working

SMUSEBY wrote:
Not a sensor; for this instance, I want the on/off state for a device..


A sensor is a device.

SMUSEBY wrote:
Is there a list of Indigo states that would be appropriate for this field? I'm guessing that the syntax needs to be precise.


You need to take this over to the Phidgets forum/thread. This is not a Better Email issue. The states are defined by the plugin, unless it's derived from a standard Indigo base device. In which case it'll be one of the state names I already gave you.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Sat Oct 05, 2019 9:17 pm
SMUSEBY offline
Posts: 511
Joined: Sep 16, 2009
Location: California

Re: Device state - not working

OK.
Thanks.

Posted on
Sun Oct 06, 2019 11:37 am
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

Re: Device state - not working

In the Main Window grab the divider above the Device Details section and drag upward to expose all of the Custom States defined by the device. So in the case below which is for a Timer device the stateIDs that could be used are longStatusString, timeLeftDays, etc. Not shown in that list will be the non-custom states, which are the ones built-in to the device type. So for example, an On/Off Relay device or an On/Off Sensor device always has a state of onOffState defined (which might be what you are after). Other examples, a dimmer device always has brightnessLevel. You can also log all of the states to the Event Log by choosing the Plugins->Open Scripting Shell menu item then pasting in something like this (substitute in correct device ID you are interested in for someDevIdHere):

indigo.server.log(unicode(indigo.devices[someDevIdHere].states))
Attachments
Screen Shot 2019-10-06 at 12.29.59 PM.png
Screen Shot 2019-10-06 at 12.29.59 PM.png (169.21 KiB) Viewed 3793 times

Image

Posted on
Sun Oct 06, 2019 2:06 pm
SMUSEBY offline
Posts: 511
Joined: Sep 16, 2009
Location: California

Re: Device state - not working

This sounds like what I need. However, I can't find the window over Device Details. (the attached shows where I'm looking).
Attachments
2019-10-06_1302.png
2019-10-06_1302.png (176.84 KiB) Viewed 3777 times

Posted on
Sun Oct 06, 2019 2:15 pm
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

Re: Device state - not working

Click-drag on the thumbnail grabby thingie (the small gray circle) that is directly above the "left .53" and drag up – it will expose the device states view.

Image

Posted on
Sun Oct 06, 2019 2:18 pm
FlyingDiver offline
User avatar
Posts: 7217
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Device state - not working

You need to drag up on the "dimple". See the image.

But in this case, you don't need to see what's in there. This is a standard on/off device. As I stated above, the name of the state is 'onOffState'.
Attachments
2019-10-06_1302.png
2019-10-06_1302.png (179.09 KiB) Viewed 3773 times

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Sun Oct 06, 2019 2:23 pm
SMUSEBY offline
Posts: 511
Joined: Sep 16, 2009
Location: California

Re: Device state - not working

Wow!
My peeling of the Indigo onion continues.

Posted on
Sun Oct 06, 2019 2:33 pm
SMUSEBY offline
Posts: 511
Joined: Sep 16, 2009
Location: California

Re: Device state - not working

small bug: in the Device Details window, onOffState is written as On State (which I just discovered, does not work).

Who is online

Users browsing this forum: No registered users and 6 guests

cron