ha-wyzeapi icon indicating copy to clipboard operation
ha-wyzeapi copied to clipboard

[Bug] status update stops working

Open jappish84 opened this issue 2 years ago • 25 comments

Describe the bug I have 5 wyze v2 and 1 wyze v3 cams connected, and while controlling the cameras on and off through service calls works reliably, the status update does not.

I have automations that trigger cameras on/off when certain conditions are met, and the cameras respond every time it seems, but the status gets stuck in "off" state after a few days (seems to only get stuck in "off" state)

I have followed the steps to enable logging for the integration, and manually toggling the switches does not generate any log entry. Trying to toggle a cam switch entity that's 'on' but shows 'off' simply just falls back to 'off' state, even though the cam is on.

Reloading the integrations solves the issue temporarily.

To Reproduce Steps to reproduce the behavior:

  1. Wait
  2. See above

Expected behavior Working state update

System configuration System: hassio, VM HA Version: 2021.11.04 WyzeApi Version: 2021.10.2

home-assistant.log

Can't get any relevant logs

jappish84 avatar Nov 26 '21 16:11 jappish84

@yoinx this seems to be a pattern with the new method. Could requests be failing and then locking up a slot or something?

SecKatie avatar Nov 26 '21 21:11 SecKatie

@JoshuaMulliken it could be. I meant to increase the logging output in the update manager to be able to diagnose issues like this, but I haven't had a chance yet.

I will say that toggling the entry though bypasses the update manager, so it's a little odd that there's no output from that.

JoeSchubert avatar Nov 26 '21 21:11 JoeSchubert

@jappish84 I'm looking into this still. Found something interesting... Just out of curiosity is one of your devices a lock? If so, does it also have a keypad?

JoeSchubert avatar Dec 04 '21 03:12 JoeSchubert

Thanks @yoinx really appreciate the work you all are putting into it.

No locks unfortunately, just cams, five v2 cams, and one v3 cam, that's all that's connected to the account.

jappish84 avatar Dec 04 '21 06:12 jappish84

Ah, thanks. Must just be a coincidence then that mines failing on a call for the lock. The call that was failing was one that I had modified fairly recently which was what made me think that might be a smoking gun.

Just because I'm all about full transparency... What I'm seeing is that after awhile (no real specific time) I get a 502/Bad Gateway, which then cascades up and kills the update manager. We're working on adding in some error handling for that which should hopefully prevent this from happening.

JoeSchubert avatar Dec 04 '21 13:12 JoeSchubert

Sounds great, just let me know if there if you need any further info or additional testing 👍

jappish84 avatar Dec 04 '21 14:12 jappish84

This should be resolved in the new beta: 2021.12.1b1

JoeSchubert avatar Dec 05 '21 23:12 JoeSchubert

I'm new to HA and came across your Wyze integration. I've had this problem, where status is not updated from Wyze. I have plugs and locks (with keypads). After an undetermined amount of time if a lock is manually changed the status in HA is not updated. Being new and not knowing much at all, can someone help me figure out out to get the beta channel in HACS? image I've selected the beta checkbox, but am still only presented with 2021.11.1

xdreamwalker avatar Dec 07 '21 12:12 xdreamwalker

We had to remove the beta I referenced above due to login issues introduced with it (presumably from what I did to fix this issue). So I have to dig into that before we put out a new beta.

JoeSchubert avatar Dec 07 '21 12:12 JoeSchubert

Btw local control for bulbs coming soon. I have not investigated if that is implemented for the switches but you can see my progress on it here: https://mulliken.net/blog/reverse-engineering-iot-communication

SecKatie avatar Dec 08 '21 15:12 SecKatie

Seems similar to the issue in #322 and #321. Might also be the reason why the (most recent and accurate) IP is not loaded in #315

SecKatie avatar Jan 06 '22 19:01 SecKatie

Seems similar to the issue in #322 and #321. Might also be the reason why the (most recent and accurate) IP is not loaded in #315

A few of my color bulbs still fail to respond to HA commands for days at a time while still functioning as expected in the Wyze app. During that time, their state typically reverts back to their actual state a few seconds after an attempt is made to change their state in HA.

Because the bulbs were still available in HA, I was able to see and confirm that the IP address listed in the bulb's HA attributes matched their actual value (as per my router and the Wyze App).

I thought about re-opening #315 but in the end figured it would be redundant.

tggman avatar Jan 07 '22 04:01 tggman

@tggman it may also be because the encryption value is not correct. I am not sure if they rotate that value.

SecKatie avatar Jan 07 '22 13:01 SecKatie

It seems to be stable for me. Let me know how it is for all of you

SecKatie avatar Apr 03 '22 17:04 SecKatie

I find it beeing stable now! Great work! Thanks!

jappish84 avatar Apr 03 '22 17:04 jappish84

I'm having this issue now with my wyze light strips. I can turn them on and off in the app and everything is up to date, but if I turn on or off the lights with the physical button, HA doesn't update to match the status.

bobloadmire avatar Apr 04 '22 03:04 bobloadmire

Does the app reflect the correct state when you use the physical button? I don’t know that I ever tried it..

brg468 avatar Apr 04 '22 19:04 brg468

Does the app reflect the correct state when you use the physical button? I don’t know that I ever tried it..

yes the app does update, although it's a few seconds delayed. I was under the impression since the strips are under local control it would pretty much be instant?

bobloadmire avatar Apr 04 '22 21:04 bobloadmire

I’m pretty sure the Wyze app doesn’t use local control at all, and this integration only uses local control for commands, the state is still polled on an interval.

brg468 avatar Apr 05 '22 01:04 brg468

well crap

bobloadmire avatar Apr 05 '22 02:04 bobloadmire

My color bulbs status in HA only works for an hour or so after reloading the wyze service. Been like this for a few months now. I'll try to look at the logs to see if I can diagnose.

EDIT: well i guess this could be my issue "2022-04-07 11:56:31 DEBUG (MainThread) [wyzeapy.wyze_auth_lib] Response: <ClientResponse(https://api.wyzecam.com/app/v2/device/get_property_list) [429 Too Many Requests]>"

jk111 avatar Apr 07 '22 15:04 jk111

Shit looks like they are tightening the screws...

SecKatie avatar Apr 08 '22 15:04 SecKatie

wyze is in process of locking down everything that they don't provide directly via a license, etc. Couple reasons they gave for what is worth:

  • Security report showed multiple vulnerabilities (some two (2) years old) that they are patting themselves on the back about kinda of fixing a few days ago. They included "unauthorized" integrations as a risk.
  • Webview is supposed to be coming out of beta, but who knows. They pulled RTSP firmware for the cams "until they can work out some issues and it will be some time" Basically they fear people don't buy subscriptions if they use rtsp.. BS

If anyone has the latest RTSP firmware for the Pan (v1 not v2) or can point me where to get it.. I am determined to get some use for the 25 or so cams (all on subscriptions), lots of lights (Joshua Mulliken has us covered), switches (agin JM has that), basically everything they offer.. I am determined to get all these cameras working inside of HA, just for principal.
big picture, i'm moving away from IP based devices for everything. The cameras, I just want to know before I tap out, that I tried everything. I just keep telling myself that i'm getting experience with NVR, Motion, etc all in HA. Of course I have yet to watch one of my Wyze cams on the HA dashboard. Nest was a pain, but at least i got it there..

chrisvball avatar Apr 12 '22 06:04 chrisvball

@chrisvball Here's the RTSP firmware. According to doc: "Please note that the Wyze Cam Pan firmware file is not compatible with Wyze Cam Pan v2."

prnewman avatar May 03 '22 17:05 prnewman

Hi all. I'm seeing the same thing on my Wyze thermostats and bulbs. I have schedules set in the Wyze app to change the thermos a few times a day and they will get stuck on on and not update for a day or two. I tried setting up an automation, but that actually seemed to make it worse because of too many polls probably. image

manofpants avatar Jul 25 '22 15:07 manofpants

Hi I have implement a fix to this bug. I tested several days and it seems working correctly now. @JoshuaMulliken can you take a look? https://github.com/JoshuaMulliken/wyzeapy/pull/54

widewing avatar Oct 07 '22 07:10 widewing

I have published the fix from @widewing !!

Thank you for your contribution!

SecKatie avatar Oct 20 '22 18:10 SecKatie