SecKatie / ha-wyzeapi

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

Fails with Home assistant 2023.3 beta #462

Closed jscherry closed 1 year ago

jscherry commented 1 year ago

Describe the bug Won't load integration To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

System configuration System: Home assistant os on odroid (home assistant blue) HA Version: 2023.3 beta WyzeApi Version: Newest beta and version .17

home-assistant.log Logger: homeassistant.setup Source: setup.py:205 First occurred: 7:34:47 PM (1 occurrences) Last logged: 7:34:47 PM

Setup failed for custom integration wyzeapi: Requirements for wyzeapi not found: ['wyzeapy==0.5.18'].

For additional information see the readme: https://github.com/JoshuaMulliken/ha-wyzeapi#reporting-an-issue -->


Logger: homeassistant.setup
Source: setup.py:205
First occurred: 7:34:47 PM (1 occurrences)
Last logged: 7:34:47 PM

Setup failed for custom integration wyzeapi: Requirements for wyzeapi not found: ['wyzeapy==0.5.18'].
jscherry commented 1 year ago

I even tried to uninstall, removed from hacs, redownloaded, rebooted, and reinstall but it says this when trying to install Error Config flow could not be loaded: 500 Internal Server Error Server got itself in trouble

chrisvball commented 1 year ago

same here. I can post error, but identical.

jbrown9100 commented 1 year ago

Same for me.

JoeSchubert commented 1 year ago

Is this still a problem?

The error is saying that it can't find that version of the wyzeapy library, which should have been pulled from pypi when you installed/upgraded.

You can see that it's available here: https://pypi.org/project/wyzeapy/ with that version number... So I would venture a guess that this was an issue with pypi not serving it for some limited period of time.

jscherry commented 1 year ago

How do we fix this?

CenterInYou commented 1 year ago

@jscherry an update was just pushed out if you have it enabled to see beta versions but doesn't seem to have fixed it :(

jscherry commented 1 year ago

I've tried the beta's and regular version. Neither work? Does anyone know how we can fix this until it's corrected in the integration?

chrisvball commented 1 year ago

@jscherry I rolled back HA 2023.3 beta back to the prod version 2023.2.5 and 1.17 with Wyze HACS. And everything loaded. For "fun" I took a backup of the VM and joined the beta and then it goes back to the original issue. So restored it and back to working. If I didn't have ~25 Wyze lights and ~20 cams I would just get away from the Wyze ecosystem, I just have so much, but nothing new.. I now just buy Zigbee or anything that isn't WiFi only, even my tuya lights are solid. But honestly if I did it all over I would have just Hue lights, the 20 or so that i have running z2m work flawlessly. Such a superior product, but 3x as much..
I see HA as a way not to be limited by the cloud/internet i just didn't know about it soon enough..

jscherry commented 1 year ago

@chrisvball I'm now restoring the backup also. I just hope someone can fix this issue before 3/1/23 when the regular 2023.3 version gets released. I've been using this integration since it was released and think it's great.

chrisvball commented 1 year ago

My frustration lies with WYZE. I understand they are in the money making business, but they should give you some local access if you have the product licensed. It would be a win win with everyone. I have the unlimited that gives me all the cloud features, but I don't use it, I did it to support their business model. Hoping one day they could give us the rtsp firmware back and at least let a yearly subscriber go local.
Good luck!

brg468 commented 1 year ago

I think the issue is here. There was an update to the HA package constraints that no longer allows the wyzeapy requirements to be met. These are our requirements:

install_requires = \
['aiodns>=3.0.0,<4.0.0',
 'aiohttp>=3.7,<4.0',
 'cchardet>=2.1.7,<3.0.0',
 'pycryptodome>=3.12.0,<4.0.0']

@JoshuaMulliken or @JoeSchubert can you see what can be done to update or remove this requirement? HA is now requiring faust-cchardet>=2.1.18

JoeSchubert commented 1 year ago

I think the issue is here. There was an update to the HA package constraints that no longer allows the wyzeapy requirements to be met. These are our requirements:

install_requires = \
['aiodns>=3.0.0,<4.0.0',
 'aiohttp>=3.7,<4.0',
 'cchardet>=2.1.7,<3.0.0',
 'pycryptodome>=3.12.0,<4.0.0']

@JoshuaMulliken or @JoeSchubert can you see what can be done to update or remove this requirement? HA is now requiring faust-cchardet>=2.1.18

I'd be willing to bet it's a 1for1 swap based on the way that they're commit blocks that one and says that it's been replaced with faust-cchardet>=2.1.18

jscherry commented 1 year ago

I've been looking through the cose trying to find where 'cchardet>=2.1.7,<3.0.0', is in hopes to edit it to faust-cchardet>=2.1.18 to see if that would fix the problem. Can someone please tell me where to find this piece of code so I can try it? The regular home assistant 2023.3 will be released this coming Wednesday and I'd like to be able to upgrade. Thanks, Jeff.

brg468 commented 1 year ago

That won’t work, it’s part of the wyzeapy library that’s published to PyPi. The best you could try is find the package-constraints.txt file in HA and comment out the line that blocks cchardet, which I linked to in the comment above. It does fix the issue, but the wyzeapy requirements need to be updated to correctly fix it.

dnestico commented 1 year ago

Happening on full release too

brg468 commented 1 year ago

This probably goes without saying but don’t upgrade to 2023.3 until the fix is merged.

tm24fan8 commented 1 year ago

Wish I had seen this before updating. Thankfully I only have 2 Wyze lights...bad news is, they're the ones by my wife's desk. I'm gonna have some splainin to do LOL

brg468 commented 1 year ago

Anyone that already upgraded, you can try editing yourmanifest.json file found in config->custom_components->wyzeapi and replacing the current requirements block with this and restart:

  "requirements": [
    "git+https://github.com/brg468/wyzeapy.git@update-deps#wyzeapy==0.5.19"
  ],

You may have to delete and reload the integration but I don’t think so. When a new version is available in HACS it will overwrite this. Obviously do this at your own risk, worst case redownload the integration from HACS.

jdeath commented 1 year ago

git+https://github.com/brg468/wyzeapy.git@update-deps#wyzeapy==0.5.19

Thanks. That worked. I first tried just removing the version number and it didn't work!

wildoracle commented 1 year ago

Anyone that already upgraded, you can try editing yourmanifest.json file found in config->custom_components->wyzeapi and replacing the current requirements block with this and restart:

  "requirements": [
    "git+https://github.com/brg468/wyzeapy.git@update-deps#wyzeapy==0.5.19"
  ],

You may have to delete and reload the integration but I don’t think so. When a new version is available in HACS it will overwrite this. Obviously do this at your own risk, worst case redownload the integration from HACS.

I tried this but got the following error:

Logger: homeassistant.util.package
Source: util/package.py:107
First occurred: 3:03:32 PM (15 occurrences)
Last logged: 3:29:49 PM

Unable to install package wyzeapy==0.5.16: ERROR: Cannot install wyzeapy==0.5.16 because these package versions have conflicting dependencies. ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts [notice] A new release of pip is available: 23.0 -> 23.0.1 [notice] To update, run: pip install --upgrade pip
brg468 commented 1 year ago

That’s the original error. Double check your manifest.json file that it’s exactly as above.

CenterInYou commented 1 year ago

Thanks so much @brg468 !!! If you lived in the Twin Cities I'd take you out for a beer!

azsparks commented 1 year ago

Thanks @brg468 The manifest.json edit worked perfectly!

brg468 commented 1 year ago

Glad it worked everyone! Hopefully have the official fix out soon.

wildoracle commented 1 year ago

That’s the original error. Double check your manifest.json file that it’s exactly as above.

I must not understand, but I'll wait for the official fix. Here's the entire contents of my manifest.json file including the edit you posted:

{
  "domain": "wyzeapi",
  "version": "0.1.18b1",
  "name": "Wyze",
  "config_flow": true,
  "iot_class": "cloud_polling",
  "documentation": "https://github.com/JoshuaMulliken/ha-wyzeapi#readme",
  "issue_tracker": "https://github.com/JoshuaMulliken/ha-wyzeapi/issues",
  "requirements": [
    "git+https://github.com/brg468/wyzeapy.git@update-deps#wyzeapy==0.5.19"
  ],
  "codeowners": [
    "@JoshuaMulliken"
  ]
}
brg468 commented 1 year ago

That’s the original error. Double check your manifest.json file that it’s exactly as above.

I must not understand, but I'll wait for the official fix. Here's the entire contents of my manifest.json file including the edit you posted:

{
  "domain": "wyzeapi",
  "version": "0.1.18b1",
  "name": "Wyze",
  "config_flow": true,
  "iot_class": "cloud_polling",
  "documentation": "https://github.com/JoshuaMulliken/ha-wyzeapi#readme",
  "issue_tracker": "https://github.com/JoshuaMulliken/ha-wyzeapi/issues",
  "requirements": [
    "git+https://github.com/brg468/wyzeapy.git@update-deps#wyzeapy==0.5.19"
  ],
  "codeowners": [
    "@JoshuaMulliken"
  ]
}

Hmm based on the error you posted, something seems off. It seems like it’s trying to install a wyzeapy from a few versions ago. You don’t have a wyzeapy folder in your config folder do you?

scottjl commented 1 year ago

Anyone that already upgraded, you can try editing yourmanifest.json file found in config->custom_components->wyzeapi and replacing the current requirements block with this and restart:

  "requirements": [
    "git+https://github.com/brg468/wyzeapy.git@update-deps#wyzeapy==0.5.19"
  ],

You may have to delete and reload the integration but I don’t think so. When a new version is available in HACS it will overwrite this. Obviously do this at your own risk, worst case redownload the integration from HACS.

just changed out the one line, rebooted my yellow, wyze is working again. didn't have to re-install or change any configs, thankfully.

jason1980p commented 1 year ago

Anyone that already upgraded, you can try editing yourmanifest.json file found in config->custom_components->wyzeapi and replacing the current requirements block with this and restart:

  "requirements": [
    "git+https://github.com/brg468/wyzeapy.git@update-deps#wyzeapy==0.5.19"
  ],

You may have to delete and reload the integration but I don’t think so. When a new version is available in HACS it will overwrite this. Obviously do this at your own risk, worst case redownload the integration from HACS.

Thank you! Thank you! Thank you!!! This worked!

wildoracle commented 1 year ago

That’s the original error. Double check your manifest.json file that it’s exactly as above.

I must not understand, but I'll wait for the official fix. Here's the entire contents of my manifest.json file including the edit you posted:

{
  "domain": "wyzeapi",
  "version": "0.1.18b1",
  "name": "Wyze",
  "config_flow": true,
  "iot_class": "cloud_polling",
  "documentation": "https://github.com/JoshuaMulliken/ha-wyzeapi#readme",
  "issue_tracker": "https://github.com/JoshuaMulliken/ha-wyzeapi/issues",
  "requirements": [
    "git+https://github.com/brg468/wyzeapy.git@update-deps#wyzeapy==0.5.19"
  ],
  "codeowners": [
    "@JoshuaMulliken"
  ]
}

Hmm based on the error you posted, something seems off. It seems like it’s trying to install a wyzeapy from a few versions ago. You don’t have a wyzeapy folder in your config folder do you?

No, I have a wyze_config.ini file in the config folder though...

Cl3tus commented 1 year ago

Anyone that already upgraded, you can try editing yourmanifest.json file found in config->custom_components->wyzeapi and replacing the current requirements block with this and restart:

  "requirements": [
    "git+https://github.com/brg468/wyzeapy.git@update-deps#wyzeapy==0.5.19"
  ],

You may have to delete and reload the integration but I don’t think so. When a new version is available in HACS it will overwrite this. Obviously do this at your own risk, worst case redownload the integration from HACS.

This is exactly the comment that helped me out getting it to work again. Thanks!

wildoracle commented 1 year ago

That’s the original error. Double check your manifest.json file that it’s exactly as above.

I must not understand, but I'll wait for the official fix. Here's the entire contents of my manifest.json file including the edit you posted:

{
  "domain": "wyzeapi",
  "version": "0.1.18b1",
  "name": "Wyze",
  "config_flow": true,
  "iot_class": "cloud_polling",
  "documentation": "https://github.com/JoshuaMulliken/ha-wyzeapi#readme",
  "issue_tracker": "https://github.com/JoshuaMulliken/ha-wyzeapi/issues",
  "requirements": [
    "git+https://github.com/brg468/wyzeapy.git@update-deps#wyzeapy==0.5.19"
  ],
  "codeowners": [
    "@JoshuaMulliken"
  ]
}

Hmm based on the error you posted, something seems off. It seems like it’s trying to install a wyzeapy from a few versions ago. You don’t have a wyzeapy folder in your config folder do you?

I seem to have a bigger issue than Wyze - I can no longer restart Home Assistant?! I don't know how to fix this but I submitted an issue to Home Assistant Core about it... do you have any quick fix for this? The system cannot restart because the configuration is not valid: Integration error: config_editor - Integration 'config_editor' not found.

@brg468 makes sense now why I was still seeing the original error in my logs... because HA wasn't actually restarting! :)

UPDATE: I had to go into Settings>Restart Home Assistant>Advanced Options>REBOOT system in order to clear out the junk from "config_editor"! Now I've made the 'requirements' code adjustment to the manifest.json and can finally reboot. I wonder why Home Assistant says it can't restart, but that's not entirely true, since forcing it to REBOOT clears up the issue?

bbushelle commented 1 year ago

Made the change posted by brg468 to manifest.json and did a full reboot but am getting the following error:

Failed to call service light/turn_on. BulbService.turn_on() missing 1 required position argument: 'local_control'

Still trying to troubleshoot/resolve but wondering if anyone else encountered this as well?

brg468 commented 1 year ago

@bbushelle I’m not seeing that error, is this when you turn a light on/off? Just tried turning several on and off with no issues. What version of the Wyze integration are you running?

bbushelle commented 1 year ago

@brg468 - yes when toggling on/off

"version": "2021.11.1"

I'm wondering if that is my problem since I'm seeing "version": "0.1.18b1" as current now.

HACS isn't telling me there is an update available so will try manually doing that

brg468 commented 1 year ago

2021.11.1 is the Wyze version? That’s really old! 😛 (over 2 years based on the numbering) I’m guessing your Wyze integration is missing local control for bulbs which is what the newer dependency is looking for.

run1fast commented 1 year ago

I'm on that same Wyze version "version": "2021.11.1". Its always worked OK for me, until this recent HA update. So I did the update brg468 recommended which fixed the integration. But now getting the same error as bbushelle. Just pulled the "version": "0.1.18b1", updated, restarted HA. The error message is gone and I can now control my wyze lights. At least they work, but there is a LONG delay. From when I turn on a bulb in HA, it takes nearly 8-10 secs for the bulb to turn on. When I try to turn it off, I click the slider in HA, 2 secs later, the slider automatically goes back to on. Then I try it again, wait 8sec and the bulb turns off.

bbushelle commented 1 year ago

@brg468 lol yup. I guess when things don't yell at me to be updated they get forgotten as long as they're still working.

Lights are working again and no delay like @run1fast is experiencing. I upgraded my version to 0.1.17

JAudi23 commented 1 year ago

Anyone that already upgraded, you can try editing yourmanifest.json file found in config->custom_components->wyzeapi and replacing the current requirements block with this and restart:

  "requirements": [
    "git+https://github.com/brg468/wyzeapy.git@update-deps#wyzeapy==0.5.19"
  ],

You may have to delete and reload the integration but I don’t think so. When a new version is available in HACS it will overwrite this. Obviously do this at your own risk, worst case redownload the integration from HACS.

This fixed it for me as well.

christophermichaelshaw commented 1 year ago

@JAudi23 Thank you for the clear instructions for a fix!

@JoshuaMulliken Any idea when this PR will be merged/approved?

gmitchell3 commented 1 year ago

Anyone that already upgraded, you can try editing yourmanifest.json file found in config->custom_components->wyzeapi and replacing the current requirements block with this and restart:

  "requirements": [
    "git+https://github.com/brg468/wyzeapy.git@update-deps#wyzeapy==0.5.19"
  ],

You may have to delete and reload the integration but I don’t think so. When a new version is available in HACS it will overwrite this. Obviously do this at your own risk, worst case redownload the integration from HACS.

@brg468 Thank you so much for this easy to follow and apply fix. It worked great. Much appreciated.

PaPaTheGMan commented 1 year ago

Anyone that already upgraded, you can try editing yourmanifest.json file found in config->custom_components->wyzeapi and replacing the current requirements block with this and restart:

  "requirements": [
    "git+https://github.com/brg468/wyzeapy.git@update-deps#wyzeapy==0.5.19"
  ],

You may have to delete and reload the integration but I don’t think so. When a new version is available in HACS it will overwrite this. Obviously do this at your own risk, worst case redownload the integration from HACS.

Thanks - this worked for me. Very much appreciated, I have multiple camera turn-on/off automations based on presence and this brings everything back online!

1PlusN commented 1 year ago

Anyone that already upgraded, you can try editing yourmanifest.json file found in config->custom_components->wyzeapi and replacing the current requirements block with this and restart:

  "requirements": [
    "git+https://github.com/brg468/wyzeapy.git@update-deps#wyzeapy==0.5.19"
  ],

You may have to delete and reload the integration but I don’t think so. When a new version is available in HACS it will overwrite this. Obviously do this at your own risk, worst case redownload the integration from HACS.

works like a charm!

dorgan commented 1 year ago

wish i had known about this before upgrading....Trying to update manifest.json now but it seems to not be working....

brg468 commented 1 year ago

@dorgan I'm happy to help but you'll have to be more specific than 'not working'

dorgan commented 1 year ago

@brg468 a full restart and I am good now. Thanks!

bl232 commented 1 year ago

Anyone that already upgraded, you can try editing yourmanifest.json file found in config->custom_components->wyzeapi and replacing the current requirements block with this and restart:

  "requirements": [
    "git+https://github.com/brg468/wyzeapy.git@update-deps#wyzeapy==0.5.19"
  ],

You may have to delete and reload the integration but I don’t think so. When a new version is available in HACS it will overwrite this. Obviously do this at your own risk, worst case redownload the integration from HACS.

I encountered this issue (the fix worked for me) and just wanted to say thanks for all the time and effort put into fixing these kinds of things. The reading lights in my bedroom are now working again :)

jayste4 commented 1 year ago

Anyone that already upgraded, you can try editing yourmanifest.json file found in config->custom_components->wyzeapi and replacing the current requirements block with this and restart:

  "requirements": [
    "git+https://github.com/brg468/wyzeapy.git@update-deps#wyzeapy==0.5.19"
  ],

You may have to delete and reload the integration but I don’t think so. When a new version is available in HACS it will overwrite this. Obviously do this at your own risk, worst case redownload the integration from HACS.

I encountered this issue (the fix worked for me) and just wanted to say thanks for all the time and effort put into fixing these kinds of things. The reading lights in my bedroom are now working again :)

I modified the manifest.json then updated to 2023.3.1 and the Wyze intergration is working.

droptopgokart commented 1 year ago

@brg468 lol yup. I guess when things don't yell at me to be updated they get forgotten as long as they're still working.

Lights are working again and no delay like @run1fast is experiencing. I upgraded my version to 0.1.17

How do you upgrade without the HACS prompt? I'm getting the same error.

brg468 commented 1 year ago

@brg468 lol yup. I guess when things don't yell at me to be updated they get forgotten as long as they're still working. Lights are working again and no delay like @run1fast is experiencing. I upgraded my version to 0.1.17

How do you upgrade without the HACS prompt? I'm getting the same error.

Find the integration in HACS->three dots upper right->redownload button.

rnlascano commented 1 year ago

Tks!. That worked!