romedtino / simple-wyze-vac

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

[BUG] After configuration it's not adding entities #75

Open atomicangel opened 7 months ago

atomicangel commented 7 months ago

Describe the bug There is an error occurring when attempting to initially login to the integration.

To Reproduce Steps to reproduce the behavior:

  1. Start setup of simple-wye-vac per directions and do the reboot of HAOS.
    • I tried both "Restart Home Assistant" and a full reboot of the VM it's running in.
  2. Login to Wyze in the configuration panel
  3. It says it was successful
  4. Integration shows error in the logs as pasted.
Source: config_entries.py:406
First occurred: 11:38:14 PM (2 occurrences)
Last logged: 11:39:46 PM

Error setting up entry Simple Wyze Vac for simple_wyze_vac
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 406, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/simple_wyze_vac/__init__.py", line 95, in async_setup_entry
    "filter": vac_info.supplies.filter.remaining,
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/wyze_sdk/models/devices/vacuums.py", line 970, in remaining
    return self.type.max_hours - self.usage
           ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
TypeError: unsupported operand type(s) for -: 'int' and 'NoneType'

Expected behavior I expected the entities to populate and the vacuum to be added to my dashboard.

Simple Wyze Vac Version

Wyze Vacuum Firmware Version

Home Assistant Version Core: 2024.1.3 Supervisor: 2023.12.1 Operating System: 11.4 Frontend: 20240104.0

Additional context Add any other context about the problem here.

atomicangel commented 7 months ago

I read one of the other reports, all I ended up needing to do was delete the first key I made and regenerate a new one. Maybe put a "Troubleshooting" section that outlines that as a possibility?

ajincitti commented 5 months ago

I am also having this issue, however I have two Wyze Robot Vacuums. One is on the firmware that you have 1.6.306 and then I have an older one that is stuck on 1.6.130.

I have had this integration working for months, today I added the new vac with the 1.6.306 firmware and it broke my entire integration, when I deleted the new vac I reloaded the integration and it works as expected.

Seems like something in the new firmware is making this difficult for us.

romedtino commented 5 months ago

It seems like 1.6.306 has changed the endpoints since that traceback points to be an issue from wyze-sdk

I would track this for a fix to this issue https://github.com/shauntarves/wyze-sdk/issues/130