How do I monitor sensor health?

Posted on
Sun Jun 12, 2016 7:46 am
CraftGeek offline
User avatar
Posts: 107
Joined: May 13, 2015

How do I monitor sensor health?

I want to get notification if any of our sensors fail due to malfunction, battery or signal interference. I think the best way to do this would be a trigger on the "Last updated" field, but I can't see how to do it. I can monitor for battery health but that covers only one failure point.

Is it possible to trigger on the "Last updated" field?

If "Last updated" cannot be used in a trigger, how do I create a trigger to sense the health of my various sensors?

Thanks.

Sean

Posted on
Sun Jun 12, 2016 8:34 am
Colorado4Wheeler offline
User avatar
Posts: 2794
Joined: Jul 20, 2009
Location: Colorado

Re: How do I monitor sensor health?

You could roll your own pretty easily using Python and Indigo variables, but other than the basic states that you see on the trigger list you cannot access the advanced device information without doing a little coding.

If all you are thinking about is "if the device hasn't updated in X minutes/hours/seconds/etc, do this" I could probably implement it into Device Extensions since I was already sort of doing that anyway for my own sensors. It's been on my to-do list for a week or so now I just haven't gotten around to implementing it yet.

I'm actually updating that plugin for something else right now anyway, throwing in a quick sensor shouldn't take long, then you can trigger off of the state of the Extended device.

My Modest Contributions to Indigo:

HomeKit Bridge | Device Extensions | Security Manager | LCD Creator | Room-O-Matic | Smart Dimmer | Scene Toggle | Powermiser | Homebridge Buddy

Check Them Out Here

Posted on
Sun Jun 12, 2016 9:33 am
jay (support) offline
Site Admin
User avatar
Posts: 18260
Joined: Mar 19, 2008
Location: Austin, Texas

Re: How do I monitor sensor health?

The Low Battery Notification script might help, though it might not cover all of your sensors (depends on how they are defined).

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Sun Jun 12, 2016 10:22 am
Colorado4Wheeler offline
User avatar
Posts: 2794
Joined: Jul 20, 2009
Location: Colorado

Re: How do I monitor sensor health?

CraftGeek wrote:
Is it possible to trigger on the "Last updated" field?


Now it is :). Check out Device Extensions. I just put up a "pre-release" (so it's not yet documented on the changes) that will let you do just this. Since it's not documented, here is what you do after installing the plugin:

  1. Create a new device
  2. Select EPS - Device Extensions as the Type
  3. Select Conversion Extension as the Model
  4. Select your sensor from the list
  5. Change State to Convert to lastChanged (property)
  6. Change the Conversion Action to Convert Date/Time to Elapsed Minutes
  7. Leave the format alone, it's already the proper format for Indigo date/time defaults
  8. Save it

Right after creating the device it will show a state of X Min since that sensor was last updated. Any change to your sensor will force the plugin to re-calculate the elapsed minutes, but if nothing happens then the plugin will poll the device every 60 seconds to get a status update on it. You can create a trigger based on the "Converted value of device as string" or "Converted value of device as number" to fire your events.

My Modest Contributions to Indigo:

HomeKit Bridge | Device Extensions | Security Manager | LCD Creator | Room-O-Matic | Smart Dimmer | Scene Toggle | Powermiser | Homebridge Buddy

Check Them Out Here

Posted on
Sun Jun 12, 2016 3:21 pm
CraftGeek offline
User avatar
Posts: 107
Joined: May 13, 2015

Re: How do I monitor sensor health?

:D Awesome!!! :D

I'll try it tonight.

Thanks!

Sean

Posted on
Sun Jun 12, 2016 3:30 pm
Colorado4Wheeler offline
User avatar
Posts: 2794
Joined: Jul 20, 2009
Location: Colorado

Re: How do I monitor sensor health?

I officially posted 1.5.0 with the documentation that includes this new bit.

My Modest Contributions to Indigo:

HomeKit Bridge | Device Extensions | Security Manager | LCD Creator | Room-O-Matic | Smart Dimmer | Scene Toggle | Powermiser | Homebridge Buddy

Check Them Out Here

Posted on
Mon Jun 13, 2016 8:38 pm
CraftGeek offline
User avatar
Posts: 107
Joined: May 13, 2015

Re: How do I monitor sensor health?

Works Great! Thanks.

Sean

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 2 guests