romedtino / simple-wyze-vac

Home Assistant Custom Component for Wyze Vacuum
49 stars 8 forks source link

Protobuf issues causing Nest and Google Integrations to fail #8

Closed Scags104 closed 2 years ago

Scags104 commented 2 years ago

need to figure out protobuf dependencies -- see below open issue from other forks.

This completely crippled my other integrations and caused me to not even be able to reboot my HA instance.

https://github.com/home-assistant/core/issues/55687

UPDATE: the only solution was uninstalling this intrgration, downgrading from 2021.11.3 to 2021.11.2 and back to 2021.11.3

Scags104 commented 2 years ago

edited the manifest.json to overwrite your requirements with the following:

  "requirements": [
    "wyze_sdk==1.2.2",
    "protobuf==3.13.0"
  ],

this enabled me to load the integration successfully but also after a downgrade/re-upgrade of the OS all is working as intended. I dont know that i would consider this solved but its working.

romedtino commented 2 years ago

That was the previous suggested workaround here - https://github.com/romedtino/simple-wyze-vac/issues/5 which worked for awhile but eventually, you'll notice from time to time, protobuf 3.10.0 gets installed because wyze-sdk depending on blackboxprotobuf which depends on protobuf 3.10.0

I think doing this just creates a race condition and by chance, it is installing protobuf version 3.13.0 after.

I'm toying with a new build that has blackboxprotobuf forked which loosens the dependency requirement from protobuf 3.10.0. Seems to be good so far but we'll have to wait and see if one day I reboot and I see the same error...

romedtino commented 2 years ago

I think I have found a proper way to deal with this issue. Please read the release notes for the latest version - https://github.com/romedtino/simple-wyze-vac/releases/tag/v1.3.8

Scags104 commented 2 years ago

I see the update, just not clear on order of operations. can you confirm? 1) use terminal or ssh to pip uninstall packages 2) reboot? 3) update simple-wyze-vac 4) reboot

Additionally - thank you for your work on this - Wyze has a great product with no Google integrations and this has made that possible through HA.

romedtino commented 2 years ago

Someone mentioned ha core rebuild as a way to cleanup the HA instance which sounds like you can use to replace some of the pip uninstall/extra reboot steps here but I've never tried it. In detail, I would probably do it like this just to make sure:

  1. HACS -> Uninstall/Remove Simple Wyze Vac
  2. Restart HA
  3. Remove simple_wyze_vac entry in configuration.yaml
  4. Restart HA
  5. SSH into the HA instance and make sure wyze-sdk, blackboxprotobuf are no longer installed by checking on terminal with pip show wyze-sdk and pip show blackboxprotobuf. If they are:
    1. pip uninstall wyze-sdk
    2. `pip uninstall blackboxprotobuf
  6. Check which version of protobuf is currently installed by doing pip show protobuf. If it is 3.10.0, Upgrade it either to 3.13.0 or 3.19.1 (which is what I am on and seems to work fine) pip install protobuf==3.19.1
  7. Restart HA
  8. HACS -> Install -> Simple Wyze Vac v1.3.8
  9. Restart HA
  10. Add simple_wyze_vac entry to configuration YAML
  11. Restart HA
  12. Wait until everything loads and SSH back into HA instance. Check which version of protobuf is installed with pip show protobuf again. It should be whatever you updated to in step 6.
  13. Check pip show wyze-sdk, it should have my github repo (e.g. romedtino) instead of shauntarves' repo.

If all went well, everything should be solid.

Scags104 commented 2 years ago

I jumped the gun but i got it working as i saw @allenporters comment in the other closed issue.

I updated from HACS to 1.3.8, rebooted to Nest failures. Ran ha core rebuild and everything is back up and running nicely

Now, whether or not this is in line with your "more permanant fix" im not sure. but it definately was a simpler approach than the above

romedtino commented 2 years ago

🤞🏽. I think if you are able to check that wyze-sdk is using my forked version and/or protobuf is not at 3.10.0 by SSHing into your HA instance, you should be good.

Scags104 commented 2 years ago

Oddly enough pip show :insert package name: on both shows WARNING: Package(s) not found

romedtino commented 2 years ago

Are you running HA on a Docker container? VM? Could be a different machine? I would think protobuf at a minimum would be there. Could also be, didn't wait long enough for all components to load? I notice sometimes after an HA update, it takes a few minutes for the packages to install for the custom components.

Scags104 commented 2 years ago

running on Rpi4. i was up and running for an hour or so when i checked it out, and again now. Definitely odd

romedtino commented 2 years ago

I haven't seen this issue since the transition to wyze-sdk version that uses a branched protobuf and it's been awhile so I'm calling this stale and worked around