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

Latest update disables themostats? #560

Closed
davidhearn3606 opened this issue Mar 21, 2024 · 19 comments · Fixed by #562
Closed

Latest update disables themostats? #560

davidhearn3606 opened this issue Mar 21, 2024 · 19 comments · Fixed by #562
Labels
bug Something isn't working

Comments

@davidhearn3606
Copy link

Describe the bug

After 3/21 update, previously working thermostats are not available
To Reproduce
Install latest wyze integration update

ValueError: <HVACMode.OFF: 'off'> is not a valid HVACMode
2024-03-21 14:10:05.978 WARNING (MainThread) [homeassistant.components.konnected.panel] Exception trying to connect to panel:
2024-03-21 14:10:10.322 ERROR (MainThread) [wyzeapy.services.update_manager] Unknown error happened during updating device info
Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/wyzeapy/services/update_manager.py", line 44, in update
self.device.callback_function(self.device)
File "/config/custom_components/wyzeapi/climate.py", line 316, in async_update_callback
self.async_schedule_update_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1227, in async_schedule_update_ha_state
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 992, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1113, in _async_write_ha_state
state, attr, capabilities, shadowed_attr = self.__async_calculate_state()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1050, in __async_calculate_state
state = self._stringify_state(available)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 998, in _stringify_state
if (state := self.state) is None:
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/climate/init.py", line 322, in getattribute
return super().getattribute(__name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/climate/init.py", line 414, in state
return HVACMode(hvac_mode).value # type: ignore[unreachable]
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/enum.py", line 744, in call
return cls.new(cls, value)
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/enum.py", line 1158, in new
raise ve_exc
ValueError: <HVACMode.HEAT: 'heat'> is not a valid HVACMode
2024-03-21 14:10:35.791 ERROR (MainThread) [wyzeapy.services.update_manager] Unknown error happened during updating device info
Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/wyzeapy/services/update_manager.py", line 44, in update
self.device.callback_function(self.device)
File "/config/custom_components/wyzeapi/climate.py", line 316, in async_update_callback
self.async_schedule_update_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1227, in async_schedule_update_ha_state
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 992, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1113, in _async_write_ha_state
state, attr, capabilities, shadowed_attr = self.__async_calculate_state()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1050, in __async_calculate_state
state = self._stringify_state(available)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 998, in _stringify_state
if (state := self.state) is None:
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/climate/init.py", line 322, in getattribute
return super().getattribute(__name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/climate/init.py", line 414, in state
return HVACMode(hvac_mode).value # type: ignore[unreachable]
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/enum.py", line 744, in call
return cls.new(cls, value)
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/enum.py", line 1158, in new
raise ve_exc
ValueError: <HVACMode.OFF: 'off'> is not a valid HVACMode
2024-03-21 14:10:52.058 WARNING (MainThread) [homeassistant.components.konnected.panel] Exception trying to connect to panel:
2024-03-21 14:11:06.140 ERROR (MainThread) [wyzeapy.services.update_manager] Unknown error happened during updating device info
Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/wyzeapy/services/update_manager.py", line 44, in update
self.device.callback_function(self.device)
File "/config/custom_components/wyzeapi/climate.py", line 316, in async_update_callback
self.async_schedule_update_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1227, in async_schedule_update_ha_state
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 992, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1113, in _async_write_ha_state
state, attr, capabilities, shadowed_attr = self.__async_calculate_state()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1050, in __async_calculate_state
state = self._stringify_state(available)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 998, in _stringify_state
if (state := self.state) is None:
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/climate/init.py", line 322, in getattribute
return super().getattribute(__name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/climate/init.py", line 414, in state
return HVACMode(hvac_mode).value # type: ignore[unreachable]
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/enum.py", line 744, in call
return cls.new(cls, value)
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/enum.py", line 1158, in new
raise ve_exc

@davidhearn3606 davidhearn3606 added the bug Something isn't working label Mar 21, 2024
@SecKatie
Copy link
Owner

@brg468 this seems really weird... Why would an HVACMode not be an HVACMode???

@FrankJaco
Copy link

Happy to see I am not the only one who lost his Wyze Thermostats. What can we provide to help you resolve?

@brg468
Copy link
Collaborator

brg468 commented Mar 21, 2024

I think I see what happened...We were using a HVACMode enum in the wyzeapy lib, but in this change HA also switched to a HVACMode enum in their constants. So we essentially are trying to set the HA state with our enum when its expecting theirs. 😞

@brg468
Copy link
Collaborator

brg468 commented Mar 21, 2024

@SecKatie do you have a thermostat to test on?

@brg468
Copy link
Collaborator

brg468 commented Mar 21, 2024

Anybody wanna test for me?

Download from my branch and replace your climate.py file with the one in my branch and restart. See if that corrects it.

https://github.com/brg468/ha-wyzeapi/tree/update-thermostat

@davidhearn3606
Copy link
Author

davidhearn3606 commented Mar 21, 2024 via email

@davidhearn3606
Copy link
Author

davidhearn3606 commented Mar 21, 2024 via email

@talormanda
Copy link

How do we get this updated in the official build?

@jloberg1
Copy link

I too can confirm the updated climate.py file solved my thermostat issue. You are AWESOME!!!

@carverofchoice
Copy link

Did this get added into the 0.1.24 version that I'm showing is available now?

@brg468
Copy link
Collaborator

brg468 commented Mar 30, 2024

It is not in that version. If yours is working now I wouldn’t upgrade, or follow my instructions above to patch.

@piersonjarvis
Copy link

This also worked for me. Hopefully this gets included in the next version.

@th3jesta
Copy link

th3jesta commented Apr 9, 2024

Worked for me. Thanks so much!

@Mr-Wicket
Copy link

thanks for the patch!

@piersonjarvis
Copy link

It's broken again for me now. Tried reverting to the proper climate.py and back to the branch version, neither are working.

@brg468
Copy link
Collaborator

brg468 commented Apr 19, 2024

Any logs?

@jloberg1
Copy link

I just checked, and my Wyze thermostat is still working. I am current on Home Assistant (not beta) updates and not I am not showing any HACS updates pending. If things change, I will post an update.

@piersonjarvis
Copy link

Logger: homeassistant.components.climate
Source: helpers/entity_platform.py:890
integration: Climate (documentation, issues)
First occurred: 11:18:15 AM (1 occurrences)
Last logged: 11:18:15 AM

Error adding entity climate.thermostat for domain climate with platform wyzeapi
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 890, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1334, in add_to_platform_finish
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 998, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1119, in _async_write_ha_state
state, attr, capabilities, shadowed_attr = self.__async_calculate_state()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1056, in __async_calculate_state
state = self._stringify_state(available)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1004, in _stringify_state
if (state := self.state) is None:
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/climate/init.py", line 328, in getattribute
return super().getattribute(__name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/climate/init.py", line 464, in state
return HVACMode(hvac_mode).value # type: ignore[unreachable]
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/enum.py", line 744, in call
return cls.new(cls, value)
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/enum.py", line 1158, in new
raise ve_exc
ValueError: <HVACMode.AUTO: 'auto'> is not a valid HVACMode

@piersonjarvis
Copy link

I just checked, and my Wyze thermostat is still working. I am current on Home Assistant (not beta) updates and not I am not showing any HACS updates pending. If things change, I will post an update.

I also didn't see any updates, just one day it was showing unavailable again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants