Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breaking Changes with HA update near 2024.1.3 #233

Open
User873902 opened this issue Feb 26, 2024 · 14 comments
Open

Breaking Changes with HA update near 2024.1.3 #233

User873902 opened this issue Feb 26, 2024 · 14 comments

Comments

@User873902
Copy link

Has anyone identified any breaking changes with updates on or after 2024.1.3? I am currently using 2024.2.3 and the WyzeSense integration appears to not be loading - the services are not available.

Will post any debug clues I find.

Last known working version: 2023.12

@stanwebber
Copy link

i'm on 2024.2.4 and can confirm the integration is working; however, i do have a large gap in my activity log starting around jan 17th so it appears to have been offline until just recently.

@User873902
Copy link
Author

User873902 commented Feb 27, 2024

i'm on 2024.2.4 and can confirm the integration is working; however, i do have a large gap in my activity log starting around jan 17th so it appears to have been offline until just recently.

Interesting! I just updated to 2024.2.4 to see if it is fixed. I still have the gap continuing from 1/17/24 onward. I am unable to use the services, "wyzesense.scan" and "wyzesense.remove."

Furthermore, the historic devices report their state as unavailable. I see the warning, "This entity is no longer being provided by the wyzesense integration. If the entity is no longer in use, delete it in settings."

I have the same previously working integration configuration in my config yaml file. The integration appears to be downloaded, but is not running for me. I am using 0.0.11 with HACS. I run HA in docker on linux.

@User873902
Copy link
Author

I wonder if I have an issue with Python 3.12, introduced in 2024.2

`Logger: homeassistant.components.binary_sensor
Source: helpers/entity_platform.py:344
Integration: Binary sensor (documentation, issues)

Error while setting up wyzesense platform for binary_sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 344, in _async_setup_platform
await asyncio.shield(task)
File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/wyzesense/binary_sensor.py", line 116, in setup_platform
ws = beginConn()
^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/decorator.py", line 232, in fun
return caller(func, *(extras + args), **kw)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/retry/api.py", line 73, in retry_decorator
return __retry_internal(partial(f, *args, **kwargs), exceptions, tries, delay, max_delay, backoff, jitter,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/retry/api.py", line 33, in __retry_internal
return f()
^^^
File "/config/custom_components/wyzesense/binary_sensor.py", line 114, in beginConn
return Open(config[CONF_DEVICE], on_event)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/wyzesense/wyzesense_custom.py", line 566, in Open
return Dongle(device, event_handler)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/wyzesense/wyzesense_custom.py", line 288, in init
self.__fd = os.open(device, os.O_RDWR | os.O_NONBLOCK)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
IsADirectoryError: [Errno 21] Is a directory: '/dev/wyzesense'
`

@peterpme
Copy link

peterpme commented Mar 2, 2024

I'm having issues as of this morning. It's been about 6 hours. I will take a look at the code and see if i can make any updates.

@User873902
Copy link
Author

User873902 commented Mar 4, 2024

Updates:

It is quite difficult to quantify this problem, but here's what I've learned:

  • I am able to successfully run/load the WyzeSense integration on now 2024.2.5.
  • I am able to check the configuration (Configuration will not prevent Home Assistant from starting!) and restart home assistant from the Developer Tools UI. The integration will load successfully. Sensors will be readable.
  • However, when I reboot the PC running HA in a docker container. HA is unable to boot because of this integration. (The web interface is unable to load and is functionally unresponsive.) To fix the problem, I have to break the configuration.yaml file (by adding or deleting a space to break the formatting) such that HA is unable to parse the configuration file and then boots into recovery mode. From there, I am able to fix the configuration file with the correct formatting, reboot with the developer tools, and again successfully run the integration. This appears to last until the next time I need to reboot the PC. Thus, HA is unstable for long term use.
  • When I remove the WyzeSense integration, I am able to reboot my PC as needed and HA will load successfully.

@peterpme
Copy link

peterpme commented Mar 9, 2024

Wow, that's interesting. I wasn't able to get it working with 2024.2.5 at all and just downgraded.

@mhpetiwala
Copy link

Wow, that's interesting. I wasn't able to get it working with 2024.2.5 at all and just downgraded.

Which version of HA did you finally use (backed off to) that supported the WyzeSense sensors. I am seeing errors and trying to see what's the last version I could pick where this integration will work... I am running HASS core on RPi 5 on python venv and Python 3.12 that is now part of bookworm release...
thank you in advance.

@stanwebber
Copy link

haos 12.1, ha 2024.3.1 working for me

@mhpetiwala
Copy link

Thx. So you're pretty much on the latest version.

@User873902
Copy link
Author

Agreed! Latest version 2024.3.1 is working! Something must have changed with 2024.3

@peterpme
Copy link

I'll try latest too. Thanks!

@tggman
Copy link

tggman commented Jun 11, 2024

Sorry if this is off topic (?) but have any of you python programmers been able to fix the latest "depreciated constants" issue outlined in #232

@stewjoel
Copy link

stewjoel commented Nov 3, 2024

Sorry if this is off topic (?) but have any of you python programmers been able to fix the latest "depreciated constants" issue outlined in #232

I've updated the code to resolve the all of the errors. Feel free to try out my newer code. https://github.com/stewjoel/ha-wyzesense/

@stanwebber
Copy link

stanwebber commented Nov 4, 2024

i applied stewjoel's edits to binary_sensor.py in my own fork. so far so good. the commits did overwrite the previous fix i applied from issue #189 so we'll see how that goes.

            # From https://github.com/kevinvincent/ha-wyzesense/issues/189
            try:
                entities[event.MAC].schedule_update_ha_state()
            except (AttributeError, AssertionError):
                _LOGGER.debug("wyze Sensor not yet ready for update")

replaced with:

            hass.add_job(entities[event.MAC].async_write_ha_state)
async def update_storage(hass, mac):
    storage = await getStorage(hass)
    if mac not in storage:
        storage.append(mac)
        await setStorage(hass, storage)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants