SecKatie / ha-wyzeapi

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

[Bug] Unable to discover Climate Sensor #452

Closed afiune closed 1 year ago

afiune commented 1 year ago

Describe the bug Added one Wyze Climate Sensor and it is not being discovered by HA. When I look at the logs, I see:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/wyzeapy/services/update_manager.py", line 79, in update_next
    updater = heappop(self.updaters)
IndexError: index out of range

Wondering if this PR solves the issue πŸ€” @JoeSchubert https://github.com/JoshuaMulliken/wyzeapy/pull/60

To Reproduce Steps to reproduce the behavior:

  1. Have this integration installed and configured
  2. Add a new Wyze Climate Sensor
  3. Wait.... Nothing happens
  4. Troubleshooting by looking at the logs I see error:
    Traceback (most recent call last):
    File "/usr/local/lib/python3.10/site-packages/wyzeapy/services/update_manager.py", line 79, in update_next
    updater = heappop(self.updaters)
    IndexError: index out of range

Expected behavior I would expect to have a new entity or device in HA.

System configuration System: Bare Metal: Raspberrypi 4 HA Version: 2023.1.6 WyzeApi Version: 0.1.17 (latest)

home-assistant.log Besides the logs posted above, I see these other logs:

2023-01-23 10:53:37.127 DEBUG (MainThread) [custom_components.wyzeapi.light] Creating new WyzeApi light component
2023-01-23 10:53:37.128 DEBUG (MainThread) [custom_components.wyzeapi.switch] Creating new WyzeApi light component
2023-01-23 10:53:37.131 DEBUG (MainThread) [custom_components.wyzeapi.lock] Creating new WyzeApi lock component
2023-01-23 10:53:37.132 DEBUG (MainThread) [custom_components.wyzeapi.climate] Creating new WyzeApi thermostat component
2023-01-23 10:53:37.132 DEBUG (MainThread) [custom_components.wyzeapi.alarm_control_panel] Creating new WyzeApi Home Monitoring System component
2023-01-23 10:53:37.137 DEBUG (MainThread) [custom_components.wyzeapi.sensor] Creating new WyzeApi sensor component
2023-01-23 10:53:37.138 DEBUG (MainThread) [custom_components.wyzeapi.siren] Creating new WyzeApi siren component
JoeSchubert commented 1 year ago

What's a climate sensor though? Is it part of the thermostat system?

I honestly don't think that pr will have any effect. It almost seems as though the climate sensor is a non-entity as far as the integration is concerned.

We... Didn't protect against an empty que as that shouldn't happen. :(

afiune commented 1 year ago

@JoeSchubert thank you for your super fast answer! πŸ™ŒπŸ½

This is the Climate Sensor from Wyze https://www.wyze.com/products/wyze-climate-sensor

Maybe these are not supported? 🀷🏽

afiune commented 1 year ago

Based on https://github.com/JoshuaMulliken/ha-wyzeapi/issues/320, Climate Sensors were dropped, I'm afraid. 😟

I'll have to return the 10 sensors I just bought on Amazon...

JoeSchubert commented 1 year ago

I don't know for sure that climate sensors are the same as the binary sensors that were dropped. Though to be honest, I've never used any of wyze's "sensors".

The binary sensors were dropped because to be useful they had to individually be polled every second (or multiple times a second) which ended up putting extensive stress on Wyze's servers.

I would assume the climate sensors don't need that sort of resolution. If their data is dumped accurately in the get_device_list endpoint, they could likely be added without any real overhead. That endpoint currently it's only queried every 20 minutes or so though... Just based on an arbitrary number I chose when I started polling it on a schedule. I think one of the other issues being worked on may make it be polled now often. However, again... I don't have any of the sensors, so I have no idea what their data would look like

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] commented 1 year ago

This issue was closed because it has been stalled for 5 days with no activity.