tschamm / boschshc-hass

Home Assistant component for accessing Bosch Smart Home Controller using boschshcpy python library.
Other
157 stars 24 forks source link

Error when loading the Bosch SHC integration #131

Closed erd82 closed 7 months ago

erd82 commented 8 months ago

Hi, like the recent issue https://github.com/tschamm/boschshc-hass/issues/130 I am having the same issue again on another HA and Bosch SHC instance. This time I already run the latest version on Bosch SHC. But it still brings the error: image

I tried everything, but nothing worked.

The logs show the following:

Logger: homeassistant.config_entries
Source: config_entries.py:402
First occurred: 22:05:24 (1 occurrences)
Last logged: 22:05:24

Error setting up entry shc*****9 for bosch_shc
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 402, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/bosch_shc/__init__.py", line 62, in async_setup_entry
    session = await hass.async_add_executor_job(
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/boschshcpy/session.py", line 48, in __init__
    self._enumerate_all()
  File "/usr/local/lib/python3.11/site-packages/boschshcpy/session.py", line 65, in _enumerate_all
    self._enumerate_userdefinedstates()
  File "/usr/local/lib/python3.11/site-packages/boschshcpy/session.py", line 125, in _enumerate_userdefinedstates
    raw_states = self._api.get_userdefinedstates()
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/boschshcpy/api.py", line 156, in get_userdefinedstates
    return self._get_api_result_or_fail(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/boschshcpy/api.py", line 80, in _get_api_result_or_fail
    self._process_nok_result(result)
  File "/usr/local/lib/python3.11/site-packages/boschshcpy/api.py", line 123, in _process_nok_result
    raise SHCSessionError(
boschshcpy.exceptions.SHCSessionError: SHC Error (message: API call returned non-OK result (code 404)!: b'')

Is anyone able to help?

erd82 commented 8 months ago

No idea what the problem could be? Do you need anymore information?

tschamm commented 8 months ago

What version do you have installed on the Smart Home Controller? Maybe it is not running the latest version, supporting already the user defined states? With version 10.18.3249-29469 no problems happen in my test installation.

matzidp8 commented 8 months ago

Hallo,

ich habe genau das gleiche Problem wie @erd82 mit der Version 0.4.74. Hier kommt beim manuellen neu laden der Integration der Fehler "Fehler beim einrichten"

Und wenn ich einzelne Geräte über ein Automation neu laden lasse, kommt folgender Fehler.

Fehler einzelne Geräte neu laden

Bei der Version 0.4.70 und 0.4.71 kommt folgender Fehler beim Versuch die Intergration manuell neu zu laden.

Neu laden Version 0 4 71

Aufgefallen ist mir dies weil ich eine Automation habe, die früh um 07:00 Uhr zwei Geräte der Bosch Integration neu lädt, weil ab und zu die Geräte offline waren. Dies hatte gut funktioniert.

Automation Bosch Integration neu laden

Ich bin jetzt wieder auf Version 0.4.63 zurück, hier funktioniert alles.

Ich habe die aktuelle Version 10.18.3249-29469 auf dem Smart Home Controller 1 drauf. Aber das Problem war auch schon mit der Version 10.18.3249-29655.

erd82 commented 8 months ago

Hi,

in the second system, we could finally solve the problem as well - by updating the Bosch SHC again.

Here we had the challenge that the mobile App did not tell us that a new SHC version was available. The reason here was that the SHC had no direct connection the the Internet (so no connection to the server).

Finally please ensure that you definitely update the SHC. Then the HACS integration is able to communicate with the SHC.

Hope this helps

matzidp8 commented 8 months ago

Finally please ensure that you definitely update the SHC. Then the HACS integration is able to communicate with the SHC..

Hope this helps

Ich habe auf dem Smart Home Controller von Bosch die aktuellste Firmware 10.18.3249-29469 heute aufgespielt. Aber leider wie oben beschrieben die Probleme mit den Versionen ab 04.0.71, von der Bosch SHC Integration..

Mit der Version 04.0.63 von der Bosch SHC Integration funktioniert es und macht keine Probleme beim manuellen neu laden der Integration

danielschmitz87 commented 7 months ago

Kann mir jemand sagen wie ich auf die Version 04.0.63 zurückgehen kann. Unter HACS kann ich maximal auf 04.0.71 zurück gehen und das behebt das Problem nicht. Ich habe das gleiche Problem wie oben beschrieben. Nach dem Update läd die Integration nicht mehr.

matzidp8 commented 7 months ago

@danielschmitz87 auf welcher Version warst du? Ich bin aktuell noch bei Version 04.0.63 und wollte mal auf 04.0.78 updaten, aber wenn da das Problem auch noch vorhanden ist, dann bleibe ich bei meiner.

Geh mal hier im Forum oben links auf Code dann bei Master auf Tags. Hier kannst du die alte Version auswählen und links bei Code den Ordner als ZIP Ordner runterladen. Ordner entzippen und bei costum components ist der Bosch SHC Ordner zu finden.

Über das Addon Filebrowser kannst du nun theoretisch die Dateien vom Ordner Bosch SHC einfach bei Dir reinkopieren, also praktisch nur die Dateien vom heruntergeladenen Ordner bei Dir im HA ersetzen. Habe ich aber so noch nicht versucht. Der Bosch Ordner ist über den Filebrowser im Home Assistant unter Homeassistant/costum components zu finden.

Vieleicht hilft ja hier ein Profi weiter, falls du es versuchst mach vorher ein Backup

danielschmitz87 commented 7 months ago

@tschamm hast du noch Ideen bevor ich @matzidp8 Idee versuche umzusetzen?

tschamm commented 7 months ago

Thank you for your detailed description what was going wrong, I actually did not test to reload the integration. I assume the problem should be fixed with version 0.4.80.

danielschmitz87 commented 7 months ago

Hi, the problem still exists in the latest version. Attached please find the error messages.

bosch fehler 3 bosch fehler 2 bosch fehler 1

tschamm commented 7 months ago

Thanks for reporting, but that doesnt help much. Can you send me the full log, especially what's going wrong in event.py. Please also comment out line 49 in custom_components/bosch_shc/__init.py and test if its working then.

danielschmitz87 commented 7 months ago

home-assistant_2024-01-18T07-35-31.011Z.log

Hi @tschamm is this the right log?

danielschmitz87 commented 7 months ago

Can you tell me the content of line 49 because in line 49 in my editor I just see a ")" :-D

danielschmitz87 commented 7 months ago

Ok found it according to my editor line 49 is Platform.EVENT,

danielschmitz87 commented 7 months ago

I commented out line 49 and now it says 2024-01-18 09:21:35.853 ERROR (MainThread) [homeassistant.loader] Unexpected exception importing component custom_components.bosch_shc File "/config/custom_components/bosch_shc/init.py", line 56, in

tschamm commented 7 months ago

What is the version of HA you are running? Looks for me as if you are running an older version where Event Platform ist not yet available?

danielschmitz87 commented 7 months ago

Home Assistant 2023.7.0.dev20230626

tschamm commented 7 months ago

Ok, then you would need to update to 2024.1.0 at least. Platform Event and Valve has been introduced into HA only just recently.

danielschmitz87 commented 7 months ago

Perfect I used the latest version but the wrong repository :-) Thank you very much, everthing works now

matzidp8 commented 7 months ago

@danielschmitz87 funktioniert bei Dir jetzt alles mit der Bosch SHC Version 0.4.82? Auch das manuelle laden der Bosch Integration?

Und das laden einzelner Geräte über z.B. einer Automation, dies kannst du auch ohne erstellen einer Automation unter Entwicklerwerkzeuge-Dienste mit den Dienst Home Assistant Core Integration: Konfigurationseintrag neu laden testen?

Einfach ein Bosch Gerät auswählen und den Button Dienst ausführen drücken. Zeitgleich wenn du ein zweites Fenster offen hast mit Einstellungen-Geräte und Dienste-Bosch SHC, dann siehst du nach drücken des Button Dienst ausführen, ob die Bosch SHC Integration neu lädt.

Wäre schön wenn du das mal testen könntest, bevor ich auch auf die neuste Version update.