Natywna integracja z Home Assistant (komponent) 2.1

  • 338 Odpowiedzi
  • 22513 Wyświetleń
*

Offline SebiCo

  • ***
  • 225
    • Zobacz profil
Odp: Natywna integracja z Home Assistant (komponent) 2.1
« Odpowiedź #270 dnia: Lutego 21, 2022, 11:08:25 »
Moim zdaniem daj tak jak jest - jeśli ktoś wywoła serwis rozłączenia to przecież ma świadomość, że encje nie będą dostępne. Poza tym wywołanie tego serwisu będzie raczej okazjonalne i nie często wykorzystywane, tylko w specyficznych sytuacjach.

*

Offline admin

  • *****
  • 1657
  • Twórca i moderator forum
    • Zobacz profil
    • Forum ExtaLife
Odp: Natywna integracja z Home Assistant (komponent) 2.1
« Odpowiedź #271 dnia: Lutego 21, 2022, 11:10:33 »
Moim zdaniem daj tak jak jest - jeśli ktoś wywoła serwis rozłączenia to przecież ma świadomość, że encje nie będą dostępne. Poza tym wywołanie tego serwisu będzie raczej okazjonalne i nie często wykorzystywane, tylko w specyficznych sytuacjach.
Dokładnie, dlatego proponuję aby wydać tak jak jest. Ale nie o same nowe usługi tu chodzi, tylko nawet o to co było do tej pory. Generalnie dobrze by było widzieć, że encje są niedostępne, gdy integracja utraci połączenie, niezależnie czy użytkownik świadomie dokonał rozłączenia, czy z jakiś względów integracja stracił połączenie np kontroler się zawiesił. Wg mnie to przydatny feature, ale będzie musiał poczekać, aż uda się opanować sytuację w kodzie.
Elementy systemu, których używam: 3xSRP-22, 5xRDP-21, 3xROP-22, 4x ROP-21, 1xP-456/36, 1xRNK-24, 3x RNP-21, 1xRCT-22, aplikacja na Android oraz iOS + Home Assistant

*

Offline SebiCo

  • ***
  • 225
    • Zobacz profil
Odp: Natywna integracja z Home Assistant (komponent) 2.1
« Odpowiedź #272 dnia: Lutego 21, 2022, 11:26:38 »
Tak dokładnie, ale jeśli funkcjonalność kontroli połączenia działa to warto wydać już teraz, a dostępność encji potraktować jako kolejny feature do późniejszego wdrożenia.

*

Offline admin

  • *****
  • 1657
  • Twórca i moderator forum
    • Zobacz profil
    • Forum ExtaLife
Odp: Natywna integracja z Home Assistant (komponent) 2.1
« Odpowiedź #273 dnia: Lutego 21, 2022, 12:18:42 »
Oj niedobrze :(. Usunąłem to, ale nadal sypie błędami. Albo coś gdzieś pominąłem, albo w obecnej wersji integracji też występuje ten błąd tylko nikt go nie zauważył. Będę musiał na spokojnie przyjrzeć się sprawie.

Obecny kod z nowymi usługami i poprawkami wydaję po raz pierwszy jako wersję alpha: https://github.com/dgtal1/extalife_custom_component/releases/tag/2.1.3a0

Wygląda na to, że działa i może nawet nie będzie sprawiać żadnych problemów, ale błędy w logu mnie hamują. Tak więc zostawiam do testowania, ale nie polecam do stosowania na instancji produkcyjnej. Jak będę miał rozwiązanie to oczywiście opublikuję stabilną (miejmy nadzieję) betę.
Elementy systemu, których używam: 3xSRP-22, 5xRDP-21, 3xROP-22, 4x ROP-21, 1xP-456/36, 1xRNK-24, 3x RNP-21, 1xRCT-22, aplikacja na Android oraz iOS + Home Assistant

*

Offline SebiCo

  • ***
  • 225
    • Zobacz profil
Odp: Natywna integracja z Home Assistant (komponent) 2.1
« Odpowiedź #274 dnia: Lutego 21, 2022, 13:12:10 »
Niestety nie widzę serwisów connect i disconnect, są tylko refresh_state, restart i test_button
W cover tez coś sie rozjechało:
Logger: homeassistant.components.cover
Source: components/extalife/cover.py:90
Integration: Roleta (documentation, issues)
First occurred: 13:05:14 (2 occurrences)
Last logged: 13:05:14

Error adding entities for domain cover with platform extalife
Error while setting up extalife platform for cover
Traceback (most recent call last):
  File "/data/data/pl.sviete.dom/files/usr/lib/python3.9/site-packages/homeassistant/helpers/entity_platform.py", line 382, in async_add_entities
    await asyncio.gather(*tasks)
  File "/data/data/pl.sviete.dom/files/usr/lib/python3.9/site-packages/homeassistant/helpers/entity_platform.py", line 614, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/data/data/pl.sviete.dom/files/usr/lib/python3.9/site-packages/homeassistant/helpers/entity.py", line 782, in add_to_platform_finish
    self.async_write_ha_state()
  File "/data/data/pl.sviete.dom/files/usr/lib/python3.9/site-packages/homeassistant/helpers/entity.py", line 539, in async_write_ha_state
    self._async_write_ha_state()
  File "/data/data/pl.sviete.dom/files/usr/lib/python3.9/site-packages/homeassistant/helpers/entity.py", line 574, in _async_write_ha_state
    attr.update(self.state_attributes or {})
  File "/data/data/pl.sviete.dom/files/usr/lib/python3.9/site-packages/homeassistant/components/cover/__init__.py", line 251, in state_attributes
    if (current := self.current_cover_position) is not None:
  File "/data/data/pl.sviete.dom/files/usr/lib/python3.9/site-packages/homeassistant/components/extalife/cover.py", line 90, in current_cover_position
    pos = val if self.is_inverted_control else 100 - val
TypeError: unsupported operand type(s) for -: 'int' and 'NoneType'
:(

*

Offline admin

  • *****
  • 1657
  • Twórca i moderator forum
    • Zobacz profil
    • Forum ExtaLife
Odp: Natywna integracja z Home Assistant (komponent) 2.1
« Odpowiedź #275 dnia: Lutego 21, 2022, 13:16:07 »
Po logach wygląda, że używasz integracji wbudowanej w AIS (chyba że podmieniłeś pliki w środku AIS) a nie custom_component z kodem z githuba? Co widzisz w pliku services.yaml?
Elementy systemu, których używam: 3xSRP-22, 5xRDP-21, 3xROP-22, 4x ROP-21, 1xP-456/36, 1xRNK-24, 3x RNP-21, 1xRCT-22, aplikacja na Android oraz iOS + Home Assistant

*

Offline SebiCo

  • ***
  • 225
    • Zobacz profil
Odp: Natywna integracja z Home Assistant (komponent) 2.1
« Odpowiedź #276 dnia: Lutego 21, 2022, 13:31:42 »
ok juz wiem co się zadziało
Podmieniłem oczywiście w custom, ale stąd nie chce się uruchomic i wystartowała z wbudowanej (czego nie zauważyłem).
Teraz usunąłem wbudowaną i z custom integracja nie uruchamia sie w ogóle :(
Przy próbie instalacji mam błąd
Błąd
Nie udało się wczytać interfejsu konfiguracji: [object Object]

w logah
Logger: homeassistant.components.websocket_api.http.connection
Source: loader.py:642
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 13:26:06 (1 occurrences)
Last logged: 13:26:06

[2668703832] Error handling message: Unknown error
Traceback (most recent call last):
  File "/data/data/pl.sviete.dom/files/usr/lib/python3.9/site-packages/homeassistant/components/websocket_api/decorators.py", line 27, in _handle_async_response
    await func(hass, connection, msg)
  File "/data/data/pl.sviete.dom/files/usr/lib/python3.9/site-packages/homeassistant/components/frontend/__init__.py", line 683, in websocket_get_translations
    resources = await async_get_translations(
  File "/data/data/pl.sviete.dom/files/usr/lib/python3.9/site-packages/homeassistant/helpers/translation.py", line 311, in async_get_translations
    cached = await cache.async_fetch(language, category, components)
  File "/data/data/pl.sviete.dom/files/usr/lib/python3.9/site-packages/homeassistant/helpers/translation.py", line 221, in async_fetch
    await self._async_load(language, components_to_load)
  File "/data/data/pl.sviete.dom/files/usr/lib/python3.9/site-packages/homeassistant/helpers/translation.py", line 236, in _async_load
    for translation_strings in await asyncio.gather(
  File "/data/data/pl.sviete.dom/files/usr/lib/python3.9/site-packages/homeassistant/helpers/translation.py", line 156, in async_get_component_strings
    await gather_with_concurrency(
  File "/data/data/pl.sviete.dom/files/usr/lib/python3.9/site-packages/homeassistant/util/async_.py", line 185, in gather_with_concurrency
    return await gather(
  File "/data/data/pl.sviete.dom/files/usr/lib/python3.9/site-packages/homeassistant/util/async_.py", line 183, in sem_task
    return await task
  File "/data/data/pl.sviete.dom/files/usr/lib/python3.9/site-packages/homeassistant/loader.py", line 614, in async_get_integration
    integration = await _async_get_integration(hass, domain)
  File "/data/data/pl.sviete.dom/files/usr/lib/python3.9/site-packages/homeassistant/loader.py", line 642, in _async_get_integration
    raise IntegrationNotFound(domain)
homeassistant.loader.IntegrationNotFound: Integration 'extalife' not found.

Logger: homeassistant.config_entries
Source: config_entries.py:726
First occurred: 13:27:14 (2 occurrences)
Last logged: 13:30:59

Cannot find integration extalife
« Ostatnia zmiana: Lutego 21, 2022, 13:35:21 wysłana przez SebiCo »

*

Offline admin

  • *****
  • 1657
  • Twórca i moderator forum
    • Zobacz profil
    • Forum ExtaLife
Odp: Natywna integracja z Home Assistant (komponent) 2.1
« Odpowiedź #277 dnia: Lutego 21, 2022, 14:09:47 »
Hmm, może być tak, że AIS nadal próbuje ładować integrację wbudowaną z wewnętrznego folderu a tam nic nie ma i failuje. Spróbuj w takim razie skopiować pliki z githuba do wewnętrznego folderu integracji, restart i zobacz ponownie. Takich powżnych problemów ze startem nie przewiduję. Na moim HA dev nic takiego nie miało miejsca a potencjalne problemy mogą się wydarzyć dopiero podczas pracy integracji a nie już przy ładowaniu. Nie ma nawet problemu ze składnią, tylko wygląda jakby w folderze integracji nie było plików, a AIS chce je załadować, bo ma takie config entry.
Elementy systemu, których używam: 3xSRP-22, 5xRDP-21, 3xROP-22, 4x ROP-21, 1xP-456/36, 1xRNK-24, 3x RNP-21, 1xRCT-22, aplikacja na Android oraz iOS + Home Assistant

*

Offline SebiCo

  • ***
  • 225
    • Zobacz profil
Odp: Natywna integracja z Home Assistant (komponent) 2.1
« Odpowiedź #278 dnia: Lutego 21, 2022, 14:26:21 »
Tak dokładnie zrobiłem i działa :)
Ale co ciekawe "stara" integracja działa w custom bez problemu, a "nowa" tylko w wewnętrznym

Oczywiście serwisy connect i disconnect działają :D

*

Offline admin

  • *****
  • 1657
  • Twórca i moderator forum
    • Zobacz profil
    • Forum ExtaLife
Odp: Natywna integracja z Home Assistant (komponent) 2.1
« Odpowiedź #279 dnia: Lutego 21, 2022, 14:56:27 »
Tak dokładnie zrobiłem i działa :)
Ale co ciekawe "stara" integracja działa w custom bez problemu, a "nowa" tylko w wewnętrznym

Oczywiście serwisy connect i disconnect działają :D

Nie potrafię tego wytłumaczyć. W nowej wersji nie ma niczego co mogłoby wspłynąć na to, że działa albo jako wbudowana albo jako custom. Tutaj żadnych zmian nie było, a u mnie na HA dev mam ją właśnie jako custom_component :)
Elementy systemu, których używam: 3xSRP-22, 5xRDP-21, 3xROP-22, 4x ROP-21, 1xP-456/36, 1xRNK-24, 3x RNP-21, 1xRCT-22, aplikacja na Android oraz iOS + Home Assistant

*

Offline SebiCo

  • ***
  • 225
    • Zobacz profil
Odp: Natywna integracja z Home Assistant (komponent) 2.1
« Odpowiedź #280 dnia: Lutego 21, 2022, 15:12:49 »
Specjalnie jeszcze raz sprawdziłem i u mnie nie chce ruszyć z custom, poczekamy zobaczymy jak u innych ;)

Odp: Natywna integracja z Home Assistant (komponent) 2.1
« Odpowiedź #281 dnia: Lutego 22, 2022, 20:40:27 »
Jeszcze nie wiem, co się stało, ale objaw ten sam przed i po wgraniu nowej wersji integracji (wygląda jak w wątku powyżej, więc będę próbował sobie też poradzić):

Logger: homeassistant.config_entries
Source: components/extalife/helpers/device.py:7
First occurred: 20:34:10 (1 occurrences)
Last logged: 20:34:10

Error setting up entry efc-01 for extalife
Traceback (most recent call last):
  File "/data/data/pl.sviete.dom/files/usr/lib/python3.9/site-packages/homeassistant/config_entries.py", line 313, in async_setup
    result = await component.async_setup_entry(hass, self)  # type: ignore
  File "/data/data/pl.sviete.dom/files/usr/lib/python3.9/site-packages/homeassistant/components/extalife/__init__.py", line 140, in async_setup_entry
    Core.create(hass, config_entry)
  File "/data/data/pl.sviete.dom/files/usr/lib/python3.9/site-packages/homeassistant/components/extalife/helpers/core.py", line 40, in create
    inst = Core(config_entry)
  File "/data/data/pl.sviete.dom/files/usr/lib/python3.9/site-packages/homeassistant/components/extalife/helpers/core.py", line 60, in __init__
    from .device import DeviceManager
  File "/data/data/pl.sviete.dom/files/usr/lib/python3.9/site-packages/homeassistant/components/extalife/helpers/device.py", line 7, in <module>
    from homeassistant.components.automation import AutomationActionType, state
ImportError: cannot import name 'state' from 'homeassistant.components.automation' (/data/data/pl.sviete.dom/files/usr/lib/python3.9/site-packages/homeassistant/components/automation/__init__.py)
« Ostatnia zmiana: Lutego 22, 2022, 22:12:59 wysłana przez Fantomas »
Elementy systemu, których używam: Bramka AIS DEV 3 + pilot, EFC-01, 3x ROP-01, 3x ROP-02, RDP-01, ROP-07, RNK-02, 5x RNK-04, RNP-01, P-257/2, 2x ROP-21, 3x ROP-22, 5x RNK-24, RCK-21, 3x RCR-21, RCM-21, 4x RGT-01, urządzenia Zigbee, kamera IP.

Odp: Natywna integracja z Home Assistant (komponent) 2.1
« Odpowiedź #282 dnia: Lutego 22, 2022, 22:11:43 »
Dalej to samo, a podmieniłem pliki z wewnętrznej integracji AIS na te z githuba, wg powyższego opisu powinno być dobrze, a nie jest.
Jednak zawołam "pomocy!".
Elementy systemu, których używam: Bramka AIS DEV 3 + pilot, EFC-01, 3x ROP-01, 3x ROP-02, RDP-01, ROP-07, RNK-02, 5x RNK-04, RNP-01, P-257/2, 2x ROP-21, 3x ROP-22, 5x RNK-24, RCK-21, 3x RCR-21, RCM-21, 4x RGT-01, urządzenia Zigbee, kamera IP.

*

Offline admin

  • *****
  • 1657
  • Twórca i moderator forum
    • Zobacz profil
    • Forum ExtaLife
Odp: Natywna integracja z Home Assistant (komponent) 2.1
« Odpowiedź #283 dnia: Lutego 22, 2022, 22:21:10 »
Dalej to samo, a podmieniłem pliki z wewnętrznej integracji AIS na te z githuba, wg powyższego opisu powinno być dobrze, a nie jest.
Jednak zawołam "pomocy!".
Na stabilnej (miejmy nadzieję) wersji 2.1.2 też się sypie? Jeśli tak to coś się musiało zmienić ostatnio w HA do czego integracja jeszcze nie jest przystosowana..daj znać.

Przypuszczam że ten błąd pochodzi od automatyzacji która, używa device Automation a nie encji. Przejrzyj automatyzacje jakie masz z urządzeniami Exta Life i jeśli diagnoza się potwierdzi to zmień odwołanie z urządzeń na encje
« Ostatnia zmiana: Lutego 22, 2022, 22:23:59 wysłana przez admin »
Elementy systemu, których używam: 3xSRP-22, 5xRDP-21, 3xROP-22, 4x ROP-21, 1xP-456/36, 1xRNK-24, 3x RNP-21, 1xRCT-22, aplikacja na Android oraz iOS + Home Assistant

Odp: Natywna integracja z Home Assistant (komponent) 2.1
« Odpowiedź #284 dnia: Lutego 22, 2022, 22:44:16 »
Na wersji dostarczonej z AIS:
Logger: homeassistant.config_entries
Source: components/extalife/pyextalife.py:797
First occurred: 22:40:12 (1 occurrences)
Last logged: 22:40:12

Error setting up entry efc-01 for extalife
Traceback (most recent call last):
  File "/data/data/pl.sviete.dom/files/usr/lib/python3.9/asyncio/tasks.py", line 492, in wait_for
    fut.result()
asyncio.exceptions.CancelledError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/data/data/pl.sviete.dom/files/usr/lib/python3.9/site-packages/homeassistant/components/extalife/pyextalife.py", line 793, in async_send_message_await_response
    await asyncio.wait_for(fut, timeout)
  File "/data/data/pl.sviete.dom/files/usr/lib/python3.9/asyncio/tasks.py", line 494, in wait_for
    raise exceptions.TimeoutError() from exc
asyncio.exceptions.TimeoutError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/data/data/pl.sviete.dom/files/usr/lib/python3.9/site-packages/homeassistant/config_entries.py", line 313, in async_setup
    result = await component.async_setup_entry(hass, self)  # type: ignore
  File "/data/data/pl.sviete.dom/files/usr/lib/python3.9/site-packages/homeassistant/components/extalife/__init__.py", line 188, in async_setup_entry
    return await initialize(hass, config_entry)
  File "/data/data/pl.sviete.dom/files/usr/lib/python3.9/site-packages/homeassistant/components/extalife/__init__.py", line 302, in initialize
    await data.async_start_polling(poll_now=True)
  File "/data/data/pl.sviete.dom/files/usr/lib/python3.9/site-packages/homeassistant/components/extalife/__init__.py", line 362, in async_start_polling
    await self.async_execute_status_polling()
  File "/data/data/pl.sviete.dom/files/usr/lib/python3.9/site-packages/homeassistant/components/extalife/__init__.py", line 369, in async_execute_status_polling
    await self._async_update_callback()
  File "/data/data/pl.sviete.dom/files/usr/lib/python3.9/site-packages/homeassistant/components/extalife/__init__.py", line 389, in _async_update_callback
    channels = await self.controller.async_get_channels()
  File "/data/data/pl.sviete.dom/files/usr/lib/python3.9/site-packages/homeassistant/components/extalife/pyextalife.py", line 466, in async_get_channels
    resp = await self._connection.async_execute_command(cmd, None)
  File "/data/data/pl.sviete.dom/files/usr/lib/python3.9/site-packages/homeassistant/components/extalife/pyextalife.py", line 815, in async_execute_command
    response = await self.async_send_message_await_response(msg, command)
  File "/data/data/pl.sviete.dom/files/usr/lib/python3.9/site-packages/homeassistant/components/extalife/pyextalife.py", line 797, in async_send_message_await_response
    raise TCPConnError("Disconnected while waiting for API response!")
homeassistant.components.extalife.pyextalife.TCPConnError

Na 2.1.2 praktycznie to samo:
Logger: homeassistant.config_entries
Source: components/extalife/pyextalife.py:798
First occurred: 22:51:07 (1 occurrences)
Last logged: 22:51:07

Error setting up entry efc-01 for extalife
Traceback (most recent call last):
  File "/data/data/pl.sviete.dom/files/usr/lib/python3.9/asyncio/tasks.py", line 492, in wait_for
    fut.result()
asyncio.exceptions.CancelledError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/data/data/pl.sviete.dom/files/usr/lib/python3.9/site-packages/homeassistant/components/extalife/pyextalife.py", line 794, in async_send_message_await_response
    await asyncio.wait_for(fut, timeout)
  File "/data/data/pl.sviete.dom/files/usr/lib/python3.9/asyncio/tasks.py", line 494, in wait_for
    raise exceptions.TimeoutError() from exc
asyncio.exceptions.TimeoutError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/data/data/pl.sviete.dom/files/usr/lib/python3.9/site-packages/homeassistant/config_entries.py", line 313, in async_setup
    result = await component.async_setup_entry(hass, self)  # type: ignore
  File "/data/data/pl.sviete.dom/files/usr/lib/python3.9/site-packages/homeassistant/components/extalife/__init__.py", line 144, in async_setup_entry
    return await initialize(hass, config_entry)
  File "/data/data/pl.sviete.dom/files/usr/lib/python3.9/site-packages/homeassistant/components/extalife/__init__.py", line 248, in initialize
    await data.async_start_polling(poll_now=True)
  File "/data/data/pl.sviete.dom/files/usr/lib/python3.9/site-packages/homeassistant/components/extalife/__init__.py", line 308, in async_start_polling
    await self.async_execute_status_polling()
  File "/data/data/pl.sviete.dom/files/usr/lib/python3.9/site-packages/homeassistant/components/extalife/__init__.py", line 315, in async_execute_status_polling
    await self._async_update_callback()
  File "/data/data/pl.sviete.dom/files/usr/lib/python3.9/site-packages/homeassistant/components/extalife/__init__.py", line 335, in _async_update_callback
    channels = await self.controller.async_get_channels()
  File "/data/data/pl.sviete.dom/files/usr/lib/python3.9/site-packages/homeassistant/components/extalife/pyextalife.py", line 425, in async_get_channels
    resp = await self._connection.async_execute_command(cmd, None)
  File "/data/data/pl.sviete.dom/files/usr/lib/python3.9/site-packages/homeassistant/components/extalife/pyextalife.py", line 818, in async_execute_command
    response = await self.async_send_message_await_response(msg, command)
  File "/data/data/pl.sviete.dom/files/usr/lib/python3.9/site-packages/homeassistant/components/extalife/pyextalife.py", line 798, in async_send_message_await_response
    raise TCPConnError(
homeassistant.components.extalife.pyextalife.TCPConnError
« Ostatnia zmiana: Lutego 22, 2022, 22:53:40 wysłana przez Fantomas »
Elementy systemu, których używam: Bramka AIS DEV 3 + pilot, EFC-01, 3x ROP-01, 3x ROP-02, RDP-01, ROP-07, RNK-02, 5x RNK-04, RNP-01, P-257/2, 2x ROP-21, 3x ROP-22, 5x RNK-24, RCK-21, 3x RCR-21, RCM-21, 4x RGT-01, urządzenia Zigbee, kamera IP.