Massive delay when physically pressing TP-Link switch

I’ve got a TP-Link HS220 (firmware 1.5.8) dimmer switch. If I physically press the switch (or toggle it via the Kasa app), there is consistently a 40 second delay before HA recognizes that the state of the switch has been changed. If I toggle the switch from within HA, both the Kasa app and the light itself are toggled instantly. I found a Reddit post from a few years ago where somebody had a similar issue: https://www.reddit.com/r/homeautomation/comments/6nyipd/home_assistant_delays_with_tplink_switches/.

Is there any way to remove this delay? I’ve got great WiFi, and the switch is only about 10 feet from the wireless router, so I can’t imagine that’s part of the problem.

Thanks!

I have experienced similar issues. Sometimes up 40 sec as you said. Most of the time it works well with only a sec or two delay. Unfortunately I have not figured out what causes it, but I wondered if HA gets the state from the cloud vs locally? Could it be a cloud issue? It is my understanding that HA get the state locally but I have been wrong before :man_shrugging:

Wrong, my bad, removed

The docs say local polling (https://www.home-assistant.io/integrations/tplink/), but it might pay to look at the source to be sure (https://github.com/home-assistant/home-assistant/tree/dev/homeassistant/components/tplink).

You are likely correct, the code does not show any cloud based polling, and I should have thought about that more clearly, you dont need to supply any cloud credentials.

I’m most likely not requiring F/W rules for them as they are polled through pull (my firewall is only enforcing high to low and not the other way), not pushing like my Wemo’s used to do.

If anybody else comes across this, I ended up using Node-RED and this package https://github.com/caseyjhol/node-red-contrib-tplink which works more consistently.

1 Like

Thank you for posting this. I have been having delays when physically pressing the switch, so I hope this fixes my issues!

I have used the HS200 and never had this problem. After these last updates I started to notice this delay.

Almost 2 years later so I’m not sure if you are using this integration anymore, but wanted to pick your brain.

I’m having an issue where when I setup this node and try deploying it, I get a pop up saying 502 Gateway Error. After that, the nose red GUI goes completely black. I have to go into the json file and disable the flow to get the GUI back.

Not sure if you had to do anything special to get the nose running.