How do you tell if a device is currently connected to the hub?

Short answer: look at the "Last Activity" column on the Devices page and guess whether it's been too long. :slight_smile: You can sort on this column to make it easier. There isn't a good way to know the instant most devices effectively go offline since each has a varying amount of time between "check-ins" or other activity depending on the device, its firmware l how it's used, etc. (for example, I have a non-power-monitoring outlet that only generates activity activity when turned on or off, so if you have one that says on for days or weeks at a time, it may be fine despite not having registered recent activity).

There are also community apps out there like Device Watchdog and Device Monitor that can monitor this for you and notify you or let you view it more easily. Some of these (plus Hubitat Safety Monitor, built in) can also monitor battery levels, which may help you prevent this in non-mains-powered devices.

1 Like

Thanks for the information. Seems like the only way to know if a device is currently connected to the hub or has dropped off is to accidently discover it has failed to perform a task. This does not seem like a very good way to monitor the health of your Hubitat system.

3 Likes

This is not accurate.
As in post 2 there are apps out there which allow you to do this.
I use Device Watchdog by @bptworld to do this very thing.
Give it a try. It works well for me.

The truth is, devices are not always connected to the hub. Zigbee and Z-wave aren't like wifi where devices have a persistent connection to the hub in case there is traffic. Battery powered sensors will go to sleep until they have an event to report or are executing a "check-in". So, they may not send a signal to the hub for hours. So, dropping off the network means that it hasn't checked in within the appropriate amount of time. Technically speaking, devices are supposed to "drop off" the network all the time in order to save battery power.

2 Likes

No, as I mentioned, there are both manual and automated ways to check a device's last activity. This will be different for each device. Zigbee and Z-Wave generally only send messages when needed in order to conserve bandwidth, power (for battery devices), etc. This is not a a Hubitat issue; it's just how the devices and protocols work. Check the "Events" tab and "Last Activity" item on the device page to see what's normal for yours. If you have one you care a lot about but doesn't check in unless something happens (e.g., an outlet that only sends on/off events), it's possible a periodic trigger in Rule Machine for a "refresh" (and then an app like Device Watchdog that can check last activity) might be an automated way to do this. (But I'd avoid doing too many frequent refreshes lest you clog your network needlessly. See all the pitfalls of Z-Wave polling, which this would be quite similar to.)

For plugged-in devices, clicking Refresh in its device should generate some kind of log activity as the device responds reporting its status etc. Its the closest thing to ping we have, but as has been stated above, only applies to always-on devices.

Thanks for the information.

I have placed two IKEA ZigBee repeaters in my house. Those are what I'm wondering about. Is there some way to determine if in fact some device further away from the hub than the repeater is using the repeater?

With Zigbee, you can use an Xbee to map your network but it requires quite a bit of setup and of course, the device. There's a thread here that discusses them. But in my experience none of my devices connect directly to the hub. They all go through the repeaters.

http://[your_hub_ip]/hub/zigbee/getChildAndRouteInfo

seems to provide a low level glimpse into what the hub is seeing in terms of zigbee, repeaters and routes.

1 Like

Where did you find this. Very useful. Do you know if there is a similar feature for Zwave?

In response to the general question:
How do you tell if a device is currently connected to the hub?
I wish to offer a multi-faceted answer, for those who are reading this forum entry:

  1. For Xiaomi devices:
  • as reported by @veeceeoh these devices report their status every 50-60 minutes, so I use the Device Watchdog app, and I check for Activity within the past 1 hour
  1. For Orvibo Zigbee devices:
  • these devices (outlets, and switches) do not report every hour, so what I do is that I have made up a RM 4 rule to do a refresh on these devices every day at a set time; 1 minute after that time, I have set Device Watchdog to run, and I check for Status (which will tell me if they are still active)
    While these apps will not tell me when these devices have dropped from the mesh, they will tell me, at a certain daily time, if they are still connected to my hub.

@zarthan, @jon1 , @jtmpush18,

I use the link provided by job not sure how to read it..any help?

Parent child parameters
EzspGetParentChildParametersResponse [childCount=5, parentEui64=0000000000000000, parentNodeId=65535]

Child Data
child:[Smartthings Multipurpose Sensor, FA60, type:EMBER_SLEEPY_END_DEVICE]
No information for Child 1
No information for Child 2
child:[Xiaomi Backyard Motion Sensor, DAEB, type:EMBER_SLEEPY_END_DEVICE]
child:[Xiaomi Passage Motion Sensor 1, C71A, type:EMBER_SLEEPY_END_DEVICE]

Neighbor Table Entry
[Ikea Zigbee Repeater - Passage, BE55], LQI:255, age:3, inCost:1, outCost:1
[Ikea Zigbee Repeater, C4C6], LQI:254, age:4, inCost:1, outCost:1

Route Table Entry
status:Unused
status:Unused
status:Unused
status:Unused
status:Unused

@austhrow I am no expert and the getChildAndRouteInfo page doesn't paint a full picture. Another thing about the getChildAndRouteInfo page is that it will keep changing. At least in this view, it looks like you don't have many devices and all of them are directly connected to the hub i.e. nothing needs to route through other devices. The two Ikea devices at this point aren't repeating for anything as shown by the empty routing table.
If the Xiaomi devices aren't reliable and the purpose of the Ikea devices is to improve connectivity for those devices, you may need to reposition the Ikea devices. You could force a repair by turning off the Zigbee radio for 20 minutes from the settings page.

2 Likes

Given the above how might one write a rule engine that says for example 'turn on X but only if sensor Y has reported something/anything in the last z hours?

If there is no report in z hours we consider the device dead and want to fail safely by not turning on X.

Thanks for any help.

There's no easy way. Rules do not have access to the "Last Activity At" data on a device. However, if you're expecting specific events from a sensor and not just activity (which may or not result in an event, like "motion active" or "battery 100%"), then you could certainly leverage that information. For example, one rule (or part of one rule) could trigger on "motion changed" (which will respond to "motion active" or "motion inactive"), then set a global variable, local variable, Private Boolean, virtual or other device state, or whatever you want, and that variable/device could be checked in your other rule (or elsewhere in the same rule, depending on whether it makes sense to have these in the same rule).

That's the general idea. I don't have a specific example to show you, nor would I go crazy with writing a bunch of rules like this. I prefer to use one of the solutions that I'm sure was mentioned above (probably Device Monitor and Device Watchdog; I wrote Device Activity Check in the meantime) to periodically check if I think it's bee "too long" since some of my devices last sent anything to the hub. But if you have automations where it's crucial that you don't sometimes find out a bit too late, something like the above could work. Otherwise, I think I've only had lights stay on once or twice because a motion sensor died before I caught it, and I consider that a low-priority problem given that they'd have stayed on 100% of the time too if I myself forgot and didn't have sensors at all. :slight_smile:

I have to say this is somewhat disappointing coming from SmartThings. The SmartThings hub would grey out devices that dropped off the mesh, Zwave or Zigbee, And I ran an app that monitored check-in events specifically. Monitoring general events doesn't help, I have devices that don't get used all the time. For example, I have a zwave module on my fireplace that doesn't get used in the summer, but I'd still like to know if it is functioning so that I can have confidence it will work when I want it. It's obviously not impossible for the hub to determine if a device is no longer checking in because SmartThings has this ability.

There are a few ways to do this on Hubitat, but none of them will "gray out" anything in the UI. The "Last Activity" column on the "Devices" page, the "Last Activity At" field on the "Device" page, or the activity columns in Settings > Z-Wave Details (nothing like this for Zigbee) are good indicators. As you note, one problem is that some devices don't send anything to the hub except during user interaction, so time alone isn't a good indicator--a "long" time could be normal for a particular device. However, "Last Activity (At)" doesn't necessarily mean "events"--any network communication counts, even if it does not result in an event. More on that later.

It is true is that is no built-in method to automate the checking of these like there is with Device Health on ST. There are several community options for this, however (Device Watchdog, Device Monitor, and Device Activity Check are three I know of).

Speaking of Device Health, last time I used ST on a regular basis, it seems like lots of people were having problems with it and a frequent suggestion was to turn it off. Have things changed enough that it works well now? Or does the new app have a different method? Last I checked it seemed like ST DTHs implemented this capability and periodically "pinged"/refreshed the device, which is also something I wouldn't want to do--traffic just for the sake of traffic, plus this is likely to eat batteries on battery-powered Zigbee devices and do nothing at all on non-beaming battery-powered Z-Wave devices, though the wake-up interval on those is usually configurable and should be predictable. For mains-powered devices, it would probably be a good indicator of if they're still "online," but I again wouldn't go crazy with these intervals (not sure what ST DTHs tend to do here).

In the case of your fireplace, it's likely a "Refresh" command like I mentioned above would update "Last Activity At" if it does respond (even if it does not generate an event). This could be automated with a rule, though I think Device Monitor can automate it too (and I'm thinking of adding something similar to Device Activity Check). You could couple it with one of the above activity-monitoring apps to get the effect you want, seeing whether the device has sent/received anything recently (even if you had to force it to, as I think ST DTHs do).

1 Like

I was using a separate app for alerting in ST, I believe it was called Deice Monitor also. I hear you on the battery drain, I was mainly using it for hardwired devices. In addition to the fireplace example, I also have an dusk to dawn lighting automation, where I had a zwave switch die, I would have never know without the Device Monitor alert unless I decided to come in through the back door at night at some point. Sounds like I need to learn a bit more about the apps you mentioned, I tried out a couple of them already but they seemed to report last activity and as with the fireplace, not all of my devices get used on a daily basis.

Hi,

I've been using Device Watchdog to monitor when devices might have disconnected from the hub. I prefer to be proactive a spend a bit of extra time to find issues before someone else in the family reports that something doesn't work anymore.

I have a few devices that don't update their "Last Activity At" field very often. One of the devices in particular is a Zigbee socket that uses the Generic Zigbee Outlet driver.
Unless the socket is actually toggled on or off the the Last Activity At is not updated

I've also tried the Refresh command in the device and while I can see in the info log and the debug log that the device is on the network and active the DTH isn't updating the "Last Activity At" field.

For these devices Device Watchdog isn't able to accurately tell me if the device is really off the network, what is the alternative?

There was a thread about it that I read a few days ago but I cannot find it anymore where if I remember correctly the "Last Activity At" is meant to be updated by the DTH and not all DTHs do that. I know that my sockets same as my battery powered devices do send a regular update but that doesn't seem to be saved anywhere that I can find.

In the case where "Last Activity At" isn't updated by the driver what do people typically do? Is there any other options available for monitoring devices that may fall off the network?

I see that Markus had done up new generic drivers with a presence detection. How do people use the presence feature for that purpose? Is there an app that's used with that?

If there are any threads that someone can direct me to that would be great as I haven't been able to find the information after a good bit of searching and reading a bunch of long threads.

Thank you