Notification for devices going Offline, Electric, Wifi, Zigbee, & Zwave

Yesterday HE stopped talking to a Kasa wall outlet. In fact, the Kasa app stopped talking to it as well. Both lights were red. A reboot fixed it. Now I am trying to find a way to send a message when a device goes offline. I just installed Health Status. It looks like this app may pick up that a device going offline, but I do not see a way to send a message when it detects this. In the log, I see the HE command to turn off the outlet, but the following entry was not made to see the device turn off. It seems HE could identify the device is not responding and alert on that. I could add logic to detect this, but it would be a lot of confiragtion in every app to catch the devices not responding. Has anyone found a way to send alerts to devices going offline and not just being inactive? In this case, my wife happened to wake up in the middle of the night and see the light was still on. I cannot count on her to catch these problems.

You could look at using Device Activity Check:

This includes the option to send a notification when an issue is identified.

1 Like

In terms of your actual issue with the outlet, when you say a reboot, what exactly did you reboot?

If you continue to have issues... I used to have problems with my Kasa outlets coming back onto the Wi-Fi network whenever I restarted my router, but once I looked at the 2.4GHz (Wi-Fi and Zigbee) channels I was using and made them more compatible, I haven't had an issue since.

1 Like

What you are asking for would need to be implemented on the driver level. You need to have a time-out built into the driver so when you send a command to the device if you don't get a response back it marks it as offline. This is what the Health Check app is designed to check (I think) and that author has started adding it to all of his drivers.

The next best thing is the DAC app (linked above) which looks for devices with no activity. I have been using it for a long time and it is very reliable. Especially good for battery sensors since the battery % is not very reliable.

1 Like

I'd also add to my earlier post, that the DAC will rely on semi-regular reporting or use of the device in some way, which is likely not an issue with the Kasa devices using polling, but not sure how it would go with all their outlets, particularly those without energy monitoring.

I was surprised to see that the commsError custom attribute did not update on an outlet I have had unplugged for some months, even when I tried running the refresh command.

I do have Device Activity Check installed, but the time had not laped to consider the Kasa outlet to have no activity. Plus no activity does not indicate loss communication. I do have devices, such as a switch to turn on a light I may not use for months at a time.

I rebooted the outlet by throwing the circuit breaker off and back on. I have set my router to work with this device on only 2.4ghz, not on mesh as it is in a fixed location, and specfied a preferred router to connect.

Yeah, I thought that was a likely limitation.

The Device Health Status app provides just a convenient way to see the online/offline status of your devices. I am also using the Device Activity check for sending notifications on inactive devices.

This works for almost all of my devices paired directly to HE because they are Tuya, Aqara, Ikea, and Sonoff (now also some Matter Thread devices). However, all these use custom drivers.

1 Like

The Kasa integration has an attribute "commsError". Given that Hubitat does not have some issue, here is how it works.

  • The command (on/off or refresh) is sent via UDP with a 5 second error timeout set.
    • If a response is received, the error time-out is cancelled,
    • If no response, the first Error handling is attempting by retrying the command.
  • This is done automatically for multiple tries.
  • After the last automatic try, the attribute "commsError" is set to true. You can use this in a rule to kick off notifications.

Possible causes of loosing wifi connectivity suddenly:

  • Something has changed in you setup - HUB or WIFI network in the last several days (added new devices, new apps, updated router).
  • ZIGBEE / WIFI Interference. As stated by @sburke781 this is a potential issue. Change your Hubitat Zigbee channel to a high channel and on you router, your 2.4 GHz channel to channel 1.
  • Your Router has too many wifi devices (happened to me) and is dropping devices. (It happens, it has happened to me. I had to add in a mesh to my router.) If you added wifi devices recently, this may be relevant.
  • Interference from your Neighbors Router 2.4 GHz signal (especially relevant in an apartment).

For my hub, I am working on a router ping (easy code) and actions to take if the hub-ethernet interface is off-line. If off for X consecutive pings (5 minutes) I will attempt a single Hub reboot. The only notification will be ERROR messages in the logs.

1 Like

That didn't seem to be my experience @djgutheinz . I mentioned earlier:

Could it be that if the device is completely offline this does not work like you described, or could I have done something wrong? I am still using the custom drivers / app, I have not moved onto the built-in version.

My Kasa wall outlet and plugs all show CommsError True, even though they are working fine.

In the Decos I had set these devices to 2.4 only and set a preferred router connection, plus turned mesh off on the Decos. I changed the Kasa devices back to auto and mesh on. Now they are working fine. Seems like they prefer auto connecting.

I disconnected a WYZE camera this morning. It does not show up on Health Status as a disconnected or inactive device. I would really like some type of notification when devices drop off HE. Right now I have 24 inactive devices in HE onlly because no logic has tripped any action with them. It would not be much fun to go thru the list every day to see what is new.

I expect looking into options for pinging the devices may be the best option across the board, as long as the device responds to a ping request (my Kasa plugs appear to). You can do this using either the custom Hubitat Ping or using the ping action in Rule Machine.

Pinging of the wifi devices would work, but it would be a fair amount of work to set up for all the devices and then maintain with new and removed devices. Plus, it does not solve the issue for Z-Wave and Zigbee devices.