KASA Integration: devices not responding or reporting properly

They respond instantly even when the status update is slow/delayed.

However when when the delay is present, if you turn a light on, it will not turn back off until hubitat actually shows that it is on.

Wifi is good. Rssi is good, no packet loss running a constant ping.

1 Like

In my case, I have 8 Kasa HS103 devices, all of them are set to static IPs via IP reservations from my DHCP server. It should be noted that all Kasa devices, Hubitat, and all other IOT devices reside on their own network with their own SSID that is separate from my "main" network with computers, streaming devices, and our personal devices like phones and tablets.

Of these 8 devices, there is 1 particular switch that seems to fail to report its status fairly often after having been turned off via the light switch on the wall in that room (Zooz Zen71 paddle switch in scene controller mode). When this happens, Hubitat will continue to show the device is ON even though it is OFF. I believe I have now determined that this seems to break On/Off functionality via the Dashboard or via "toggle" commands from button devices, or via rules that depend on the device state. However, if I go to the actual device page, it will respond to ON or OFF commands, and it also responds via Google Home integration thru Hubitat. Other HS103 devices seem to occasionally hang like this too, but the one in my bedroom for my wife's lamp seems to do it more often than any of the others..

All Kasa switches report the status based on data received from the device. If you remove power from the device, there is no response from the status request message. No response means the switch (and other values) do not change. So, if it was on, it will stay on until it receives a message from the device saying it is off.

No you misunderstood what I mean. The switch on the wall does not "cut power" to the Kasa device. Obviously then the device would be off and not respond to anything at all. The switch on the wall is a button controller, and tells Hubitat to tell the Kasa device to switch on or off depending on the reported status of that device and others in the room. Because the button on the wall switch will trigger different actions based on the status of the devices in the room, not knowing the correct status of the Kasa device will cause those actions to break too.

Does the device turn on/off via the Device's page (from devices tab)? Does it report properly from there?

The device page will show the wrong status when this issue occurs, however from there it WILL turn on or off regardless of what Hubitat thinks the status of the switch is. So it seems that Hubitat can still command the device even if it does not know the state, but state-dependent triggers and actions obviously fail. It seems "toggle" commands fail when this occurs, and control from the Hubitat dashboard fails, but "ON" or "OFF" commands still seem to work whether sent from the device page or from Google Home or Kasa app (I never use Kasa app in real life though). The thing is, its very random. It works fine for a few days and then I'll have a day with a few hiccups. It's been a few days now, except when it happened once last night and of course it was working fine again by the time I tried to run a debug log. Today so far it has been totally fine again.

intermittent I can not fix without a log when the condition occurs. Intermittent often (but not always) indicated a problem in the Hubitat ecosystem. But without logs and without being able to duplicate, what would you have me do?

To be totally fair, I actually think its these devices and not Hubitat or your driver/application. So, I don't honestly think there is anything you can do... Unfortunately, I think this is more a result of me trying to use cheap hardware instead of spending money on proper Z-wave triggered plugs...

1 Like

I wanted to update this thread as the problem has been corrected. I began to realize that the issue presented around the same time I had decided to use some old Wemo plugs in my house for the Christmas lights and tree and automate them with Hubitat.. Ever since I removed the WEMO CONNECT app from Hubitat along with the two Wemo wifi plugs from my network, I have NOT experienced any issues between Hubitat and Kasa. It's been four weeks now with zero issues.

1 Like

I'm having the same issue with a Kasa HS210 3-way switch. Functions through the device app just fine but the status doesn't update, which makes the switch on the dashboard fairly useless.

You can see the relay value flipping back and forth here in the log, though for some reason there's only 1 "info" tag showing the status as off.

1 Like

Sorry for the red slash, thought I copied it before the errant keystroke.

1 Like

Observation. (starting from the "switch: off" highlight).

  • setRelayState(switch = 1)relay to 1 (switch on) sent and accepted by the device.
  • Status request sent and received (with relay_stat still 0 (off).
  • All subsequent message have relay_state = 0 (off)
  • Question: When sending on command, is the switch turning on.

Assessment: The actual device's status report is apparently causing the error (this is new). The driver is reporting the value iaw the status report and the Hub is working as specified. It may be a case of needing a wait in the request for the status or an error in the device itself.
Question: Is this a new device?
Question: Did the device previously work acceptably?

Actions to assist me.

  • Thru off the switch.
  • IN preferences, select Reboot and Save Preferences. THEN ...
  • Turn on debug logging, open a logging window, and complete the following steps while logging.
  • Turn switch on and note:
    • Switch actually on?
    • Dashboard updated?
    • If Dashboard did not update, wait 30 seconds then run REFRESH
      • Dashboard updated?
  • Turn the switch off. Same questions.
    • Switch actually off?
    • Dashboard updated?
    • If Dashboard did not update, wait 30 seconds then run REFRESH.
      • Dashboard updated?

Post logs either way. I need to know if either the reboot or the REFRESH fixed the issue.

Can only help so much right now but:

Yes, from the device panel, the switch responds instantaneously to on and off.

In my testing, the status never updates, regardless of how long I waited for it to. (I only sent you the last 4 attempts to give you some data but not blow you up.)

This is a new device.
New to Hubitat, as in just setting things up for the first time this week, so not applicable.

I will have to provide the above "later" and if that's not tonight, it might not be for a day or 2. Just a heads up.

EDIT: One other note, I did reboot the hub before capturing those logs to see if that would fix it, however the behavior remained the same.

Thanks for all the help thus far.

Reboot the actual kasa device. There is a reboot in the preferences. Also, what does the device indicate in the Kasa Phone App?

Ok, so rebooting the device seemed to have helped, but not completely fixed it.

It appears now that using the device controls toggles the status off and on as it should BUT through the dashboard it seems sluggish to pick up the status change. While it works, it only does a time or 2 before it locks up and becomes unresponsive.

To answer your questions:

  • Turn on switch and note:
    • Switch actually on? Yes
    • dashboard updated? To hourglass
    • If not, wait 30 seconds and run Refresh - When i went to run refresh, I noticed the device status is now out of sync. IE the lights are on but the status says they're off.
      • Further testing shows that the Refresh does seem to fix it.
  • same happens with turning it off

Maybe you already know this (or maybe I misread something), but unlike Z-wave plus or Zigbee devices, Kasa devices don’t send status updates to the hub, they have to be polled for the updated status. So I wouldn’t expect the status to update on the dashboard right away unless it’s being changed by the hub.

Freeboro is receiving the updates. The issue yesterday was that the status message from the device was always reporting OFF. This is a device problem. My driver also polls for status every poll interval PLUS after a hubitat command received and accepted (per a device message).

2 Likes

Workaround pending eventual fix.

Use the "Set Poll Interval" command and set the poll interval to 5 seconds. Refresh the browser and check the state.pollInterval is 5 seconds to verify (see example below).

  • image

This essentially will do a "refresh" every 5 seconds as a backup to the standard state detection.

A fix will be coming out in next week. If you use the built-in app, it will be in a future release (as determined by the Hubitat staff) after I complete and verify the fix). If you use the community integration, it will be announced here and you will use standard update instructions.

Dave

1 Like

Sounds good, thank you!

Sorry, I posted an update that didn't go through and I just caught it.

image