Trying To Read Device Status. Any Ideas

Hi All.
I'm trying to right a Rule that will 'read' the status of a device but for the life of me I cannot find a way of doing it. There is an app called 'Device Monitor' but that doesn't seem to work for me. It reports some of my devices that have not reported but they are actually ACTIVE.

image

In webCoRE, (sorry to swear :slight_smile: ) I could do this by selecting $status as seen below.
image

I've looked at Custom Commands but cannot work out how to do it or even if it is possible.
Any guidance would be great.
TIA.

What do you mean "read" the status of device? You select motion as the capability and then either active or inactive. You can't capture the status of a device in the action of a rule because there's nowhere to capture it to. It has to be in a condition or trigger of the rule.

If you look at a device you can see the status of the device. It is either ACTIVE or INACTIVE.
It could be a contact sensor, motion sensor, smoke sensor, anything.
I'm just trying to read the status of the device.
For example, when Xiaomi/Aqara sensors become unresponsive, after a period of time they become INACTIVE. This is the state I'm trying to read.

image

Well, you're not going to be able to "read" this in an action (or custom command), because custom commands issue commands to a device, not read the state of devices. Like I said, if you "reading" it in the action of a rule, what are you going to do with that? There's no were for you to store it and no way to respond to it. It would have to be in the If part of the rule for you to do anything with it. But the device's status is not exposed to Rule Machine...only that standard set of capabilities.

Check out this post. This app might be what you are looking for.

@Ryan780 the app you listed is the one he already tried, Device Monitor.

@bobbles, there is a discussion around this in the link below. It involves the author of Device Monitor and probably explains why this app is not working for you. The HE engineers are working on correcting this.

getLastActivity()? - #11 by ericm

2 Likes

Thanks @stephack
I will track that thread and see if there is a solution provided.
For me it's nice to be able to know when things have become unresponsive so that I can have a look/fix them before my wife notices. (Hopefully). :wink:

2 Likes

But if they are listed as INACTIVE in HE, that's what needs to be fixed. Being able to read that status won't help if the status is wrong. Or am I missing something?

When my Xiaomi devices show as INACTIVE, they are.
That is why i want to know and get a report for the status.
It could be because the battery has gone dead as the battery reporting on these is very inaccurate.

Okay....and why can't you use Device Monitor? Do the Xiaomi devices always show up in Device Monitor as INACTIVE even when they are ACTIVE? I'm still confused on how it doesn't work. You can't use it for ALL of your devices. For example, virtual devices often show as inactive if you haven't used them in a while. you have to exclude those from being checked.

I have some Z-Wave contact sensors that are working fine. No issues at all. They are on my garage doors and use the Generic Z-Wave Contact Sensor.
Problem.
If door isn't opened for a few hours, Device Monitor reports them as inactive. They are not.
That is why Device Monitor does not work for some of my devices and what I am using them for.

I know and I don't need to or want to check them.

Okay....but that's probably because you have device monitor set to report based not just on status but on "last report" time which is problematic for battery devices. If the status says ACTIVE in HE the it should say ACTIVE in Device monitor. When you say

Do you mean that they are actually listed as ACTIVE in HE or just that the devices are working?

I have tried various permutations with the settings that are allowed in Device Monitor and it does not work for me and judging from the thread quoted above other people require this option too.
I will follow the other thread and see if a option is provided that works for me.

You didn't answer my question. Is it that the device is listed in both HE and Device Monitor as INACTIVE when it shouldn't be or that Device Monitor is listed a device as INACTIVE when it is listed as ACTIVE in HE?

No.

Yes.

Then yeah, that sounds like the same problem everyone else is having that they are working on.

Yep, that's really what we need. The device active/inactive isn't really going to get us what we're looking for. I have Xioami and other devices that show Inactive (i guess because they haven't checked in for a while ? :man_shrugging:), but they're not disconnected from my system. If I trigger them they show active.

I really just want a simple app that looks at last activity and shows me a per-device status with a color indication.

Green (it's connected)
Yellow (it hasn't checked in for a while)
Red (it's been too long since last check in)

I'd like to be able to specify the length of time before a Yellow card is thrown down, and the length of time before a Red card is thrown down, but on a PER DEVICE basis. That way I could adjust for devices that check in at different intervals.

1 Like

I've posted an update to Device monitor that uses Active / Inactive state. The option was already there, but was written for SmartThings' OFFLINE / ONLINE state.

Just enable the two inactive / active options shown above and you will get alerts only when a device shows inactive in the HE devices page.

As @stephack mentioned, the developers are fixing an issue that is making it show an inaccurate "last activity" time when you go into the Device Monitor status screen.

2 Likes

Thanks @ericm
I'll give it a try.

Just for reference if anyone else stumbles across this thread, here is the app.

1 Like