SecKatie / ha-wyzeapi

Home Assistant Integration for Wyze devices.
740 stars 113 forks source link

[Bug] Lock shows Unavailable with all other devices being available #152

Closed SecKatie closed 2 years ago

SecKatie commented 3 years ago

Checked and did try a reboot earlier... tried another one just now and for some odd reason it worked. Logged in without issues now.

Thank you. All solved for me.

Not here. Still same issues. All the cams come up as valid sensors and trigger normally. But the lock still just comes up "Unavailable". I'm running inside a VMWare host if that matters. I've talked the entire instance of HA down, but i haven't rebooted the ESXi Host itself yet. Although I shouldn't need too.

Originally posted by @LordNex in https://github.com/JoshuaMulliken/ha-wyzeapi/issues/149#issuecomment-831208836

SecKatie commented 3 years ago

This is super weird... have you updated to the latest release? @LordNex

LordNex commented 3 years ago

System Health

version core-2021.5.0
installation_type Home Assistant OS
dev false
hassio true
docker true
virtualenv false
python_version 3.8.9
os_name Linux
os_version 5.4.109
arch x86_64
timezone America/Chicago
Home Assistant Community Store error | failed to load: unknown -- | --
Home Assistant Supervisor host_os | Home Assistant OS 5.13 -- | -- update_channel | stable supervisor_version | supervisor-2021.04.3 docker_version | 19.03.15 disk_total | 125.3 GB disk_used | 46.0 GB healthy | true supported | true board | ova supervisor_api | ok version_api | failed to load: unreachable installed_addons | Duck DNS (1.12.5), File editor (5.3.0), Check Home Assistant configuration (3.7.1), MariaDB (2.3.0), Mosquitto broker (5.1.1), Samba share (9.3.1), AdGuard Home (4.0.0), AirCast (3.0.0), AirSonos (3.0.0), AppDaemon 4 (0.5.1), chrony (2.0.1), ESPHome (1.16.2), Glances (0.11.2), Node-RED (8.2.1), Spotify Connect (0.8.2), Traccar (0.11.0), ZeroTier One (0.10.3), InfluxDB (4.0.4), Grafana (6.2.0), Terminal & SSH (9.1.1), Portainer (1.4.0), DHCP server (1.2), DOODS-amd64 (2), room-assistant (2.16.1), Home Assistant Google Drive Backup (0.103.1), Folding@home (0.2.0), Log Viewer (0.9.1), Tautulli (2.0.5), TasmoAdmin (0.14.0), Network UPS Tools (0.6.2), VLC (0.1.2), RPC Shutdown (2.2), CEC Scanner (2.4)
Lovelace dashboards | 4 -- | -- resources | 27 views | 18 mode | storage
Spotify api_endpoint_reachable | failed to load: unreachable -- | --
LordNex commented 3 years ago

My internet has been acting up. On a 150gig a month cap until skylink gets here in a few months. So a lot of those errors are because of crappy internet connection. But this was occurring the other day before my wife binged watched my bandwidth away

SecKatie commented 3 years ago

If there is anything that changes the packet it will fail signature validation and that might be what is causing it to be unavailable.

That would certainly explain the difference between the lock and the rest of the devices because they do not have a signing mechanism

SecKatie commented 3 years ago

@LordNex have you tested this recently? It seems to only affect you.

LordNex commented 3 years ago

Not not as of yet. We're on vacation up in Wyoming at the moment and ever since the last HACS update, I get page could not be loaded when trying to access HACS. As soon as I get home and can make some tweaks I'll test again and let you know. Thanks again!

JoeSchubert commented 3 years ago

Just to add to this. I would suspect that latency could break the signing for the locks as well, since the timestamp is included in the signature... If you have latency spikes that push the timestamp on the api's end to a different value than yours was during generation... You could very likely just be failing their signature check resultng I'm an error code.

SecKatie commented 2 years ago

@LordNex do you have an update on this?

kdoh82 commented 2 years ago

Just updated to the latest release (2021.9.6b2) and had this happen to me as well. On the latest version of HA (2021.9.7) and no matter what I do only the lock comes back unavailable. Tried reloading the integration, disable/reenable, restart HA. Always comes back unavailable.

kdoh82 commented 2 years ago

Rebooted my computer and issue was still there. Downgraded to 2021.9.5 and the lock came back. If you need me to run tests to gather logs/etc. just let me know.

terrycarlin commented 2 years ago

I also upgraded to 2021.9.6b2 and lost my connection to my lock. I rolled back and it reappeared. Haven’t had time to investigate but maybe this weekend.

On Sep 23, 2021, at 10:17 AM, kdoh82 @.***> wrote:

Rebooted my computer and issue was still there. Downgraded to 2021.9.5 and the lock came back. If you need me to run tests to gather logs/etc. just let me know.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/JoshuaMulliken/ha-wyzeapi/issues/152#issuecomment-926005616, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGVNVD4TSJ4TWDET4CIFIDUDNOLNANCNFSM44A6TULQ. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

SecKatie commented 2 years ago

Yeah, that is a beta release and it might be related to the keypad. @kdoh82 @terrycarlin do yall have keypads?

kdoh82 commented 2 years ago

no just a lock. no keybap

On Thu, Sep 23, 2021 at 4:30 PM Joshua Mulliken @.***> wrote:

Yeah, that is a beta release and it might be related to the keypad. @kdoh82 https://github.com/kdoh82 @terrycarlin https://github.com/terrycarlin do yall have keypads?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/JoshuaMulliken/ha-wyzeapi/issues/152#issuecomment-926131082, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOPJRXOKIMF3TAZIHARODHLUDOE4RANCNFSM44A6TULQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

terrycarlin commented 2 years ago

Also, I didn’t see any battery data for any of my battery operated Wyze devices in HA. Did a grep battery on the sources of the custom_component and the API library and only found references to battery in the lock code. But I haven’t been able to look any further.

On Sep 23, 2021, at 1:35 PM, kdoh82 @.***> wrote:

no just a lock. no keybap

On Thu, Sep 23, 2021 at 4:30 PM Joshua Mulliken @.***> wrote:

Yeah, that is a beta release and it might be related to the keypad. @kdoh82 https://github.com/kdoh82 @terrycarlin https://github.com/terrycarlin do yall have keypads?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/JoshuaMulliken/ha-wyzeapi/issues/152#issuecomment-926131082, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOPJRXOKIMF3TAZIHARODHLUDOE4RANCNFSM44A6TULQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/JoshuaMulliken/ha-wyzeapi/issues/152#issuecomment-926134269, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGVNVDXEVNLRU2J5JVTPALUDOFRJANCNFSM44A6TULQ. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

SecKatie commented 2 years ago

@kdoh82 @terrycarlin Try the latest beta. It is working for me! Thanks to @yoinx

kdoh82 commented 2 years ago

yes working for me too now. thanks! is there any way we can get the battery level to show up as a sensor in the battery class that way the icon automatically updates depending on the level? i guess i can create my own battery class sensor and set the state to be the attribute value of the battery as well correct?

kdoh82 commented 2 years ago

Here's what I did to get a custom battery sensor using the value from the lock attribute that way the icon automatically updates on lovelace with the right percentage of battery.

  # Custom Front Door Lock Battery Percentage Sensor from Wyze Lock Attribute - 'lock battery'
  - platform: template
    sensors:
      front_lock_battery:
        device_class: battery
        friendly_name: Front Lock Battery
        unit_of_measurement: "%"
        value_template: "{{ state_attr('lock.front_door', 'lock battery') | replace('%', '') }}"
SecKatie commented 2 years ago

@kdoh82 That's awesome! Would you mind sharing this in the discussion forums as a show and tell?

kdoh82 commented 2 years ago

Just shared it over there under the Lock Battery Status post.