signalkraft / mypyllant-component

Home Assistant component for the myVAILLANT API, controls Vaillant devices such as aroTHERM heatpumps and ecoTEC boilers
https://signalkraft.com/mypyllant-component/
MIT License
133 stars 19 forks source link

Govee integration kills MyVaillant #54

Closed alexskynet closed 7 months ago

alexskynet commented 10 months ago

Before submitting a new issue

Problem description

Please everyone be warned that Govee integration kills MyVaillant creating duplicated devices at first ( mine is VR 940F, ) and then killing any attempt to read data on the Vaillant's API site.

I'M using 0.6.1 and crashed my head agains the wall before discovering that simply removing the Govee integration fixes the trouble.

It also seems that the "Govee lan" integration can coexist with MyVaillant

Be warned!

Logs follows

Logs


2023-11-27 10:01:13.928 ERROR (MainThread) [custom_components.mypyllant] Unexpected error fetching myVAILLANT data: 'types.UnionType' object has no attribute '__origin__'
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/dacite/types.py", line 22, in extract_origin_collection
    return collection.__extra__
           ^^^^^^^^^^^^^^^^^^^^
AttributeError: 'types.UnionType' object has no attribute '__extra__'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 290, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/mypyllant/__init__.py", line 222, in _async_update_data
    data = [
           ^
  File "/config/custom_components/mypyllant/__init__.py", line 222, in <listcomp>
    data = [
           ^
  File "/usr/local/lib/python3.11/site-packages/myPyllant/api.py", line 292, in get_systems
    async for home in homes:
  File "/usr/local/lib/python3.11/site-packages/myPyllant/api.py", line 266, in get_homes
    yield Home.from_api(**dict_to_snake_case(home_json))
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/myPyllant/models.py", line 122, in from_api
    return from_dict(
           ^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/dacite/core.py", line 64, in from_dict
    value = _build_value(type_=field_type, data=field_data, config=config)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/dacite/core.py", line 101, in _build_value
    if is_subclass(type_, cast_type):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/dacite/types.py", line 168, in is_subclass
    if is_generic_collection(sub_type):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/dacite/types.py", line 147, in is_generic_collection
    origin = extract_origin_collection(type_)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/dacite/types.py", line 24, in extract_origin_collection
    return collection.__origin__
           ^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'types.UnionType' object has no attribute '__origin__'
2023-11-27 10:01:14.005 ERROR (MainThread) [custom_components.mypyllant] Unexpected error fetching myVAILLANT data: 'types.UnionType' object has no attribute '__origin__'
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/dacite/types.py", line 22, in extract_origin_collection
    return collection.__extra__
           ^^^^^^^^^^^^^^^^^^^^
AttributeError: 'types.UnionType' object has no attribute '__extra__'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 290, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/mypyllant/__init__.py", line 249, in _async_update_data
    async for system in await self.hass.async_add_executor_job(
  File "/usr/local/lib/python3.11/site-packages/myPyllant/api.py", line 292, in get_systems
    async for home in homes:
  File "/usr/local/lib/python3.11/site-packages/myPyllant/api.py", line 266, in get_homes
    yield Home.from_api(**dict_to_snake_case(home_json))
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/myPyllant/models.py", line 122, in from_api
    return from_dict(
           ^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/dacite/core.py", line 64, in from_dict
    value = _build_value(type_=field_type, data=field_data, config=config)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/dacite/core.py", line 101, in _build_value
    if is_subclass(type_, cast_type):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/dacite/types.py", line 168, in is_subclass
    if is_generic_collection(sub_type):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/dacite/types.py", line 147, in is_generic_collection
    origin = extract_origin_collection(type_)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/dacite/types.py", line 24, in extract_origin_collection
    return collection.__origin__
           ^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'types.UnionType' object has no attribute '__origin__'
2023-11-27 10:01:14.053 WARNING (MainThread) [custom_components.mypyllant.binary_sensor] No system data, skipping binary sensors
2023-11-27 10:01:14.055 WARNING (MainThread) [custom_components.mypyllant.sensor] No system data, skipping sensors
2023-11-27 10:01:14.055 WARNING (MainThread) [custom_components.mypyllant.sensor] No daily data, skipping sensors
2023-11-27 10:01:14.056 WARNING (MainThread) [custom_components.mypyllant.climate] No system data, skipping climate
2023-11-27 10:01:14.056 WARNING (MainThread) [custom_components.mypyllant.water_heater] No system data, skipping water heater
2023-11-27 10:01:17.270 ERROR (MainThread) [homeassistant.helpers.event] Error while processing template: Template<template=({{ state_attr('climate.zone_0','current_temperature') | float}}) renders=2>
miho9 commented 10 months ago

I have noticed the same behavior. Govee Bluetooth for some H5075 thermometers/hygrometers. They are actually quite useful when fine-tuning a heating system. So the two integrations co-existing would be rather nice.

signalkraft commented 10 months ago

There's unfortunately no good fix for that. Govee requires a certain version of a library that seems to have buggy caching which causes this exact error. You could open a issue in Govee's Github and ask them to downgrade, or use the fixed MR https://github.com/konradhalas/dacite/pull/237

VaillantHassIo commented 7 months ago

is it sufficient to disable the bluetooth devices found?

edit: disabled the bluetooth HASS integration and continue to use BLE instead

signalkraft commented 7 months ago

https://github.com/signalkraft/mypyllant-component/releases/tag/v0.7.4b6 should work better with Govee, since the conflicting requirement is removed.