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

Device unavailable after update to 0.4.8 #36

Open
lanwin opened this issue Feb 5, 2025 · 8 comments
Open

Device unavailable after update to 0.4.8 #36

lanwin opened this issue Feb 5, 2025 · 8 comments

Comments

@lanwin
Copy link

lanwin commented Feb 5, 2025

Used Version of Home Assistant: 2025.1.4
Used Version of ha-pysmaplus: 0.4.8

Describe the bug, Remarks, ...
Device is unavailable in HW after update to 0.4.8. After downgrade to 0.4.7 it works again.

Used Interface/Access Method
see https://raw.githubusercontent.com/littleyoda/ha-pysmaplus/main/docs/images/interfaces.png
Speedwire: [x]
Webconnect: [ ]
EnnexOS-based: [ ]
Energymeter/SHM2: [ ]
SHM2 with Grid Guard Code: [ ]

List of the integrated SMA devices
Inverter: STP 10000TL-20

Screenshots and Diagnose Information

Image

In HA Log I see the following error.

2025-02-05 08:52:02.826 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry STP 10000TL-20 (sw305048063) for pysmaplus
homeassit  | Traceback (most recent call last):
homeassit  |   File "/usr/src/homeassistant/homeassistant/config_entries.py", line 640, in __async_setup_with_context
homeassit  |     result = await component.async_setup_entry(hass, self)
homeassit  |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
homeassit  |   File "/config/custom_components/pysmaplus/__init__.py", line 109, in async_setup_entry
homeassit  |     sma_device_info = device_list[entry.data[CONF_DEVICE]]
homeassit  |                       ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
homeassit  | KeyError: '305048063'
@littleyoda
Copy link
Owner

Was passiert, wenn du die Integration neu lädst?

Es gibt immer noch ein Problem mit Speedwire, dass Geräte nicht sofort erkannt werden.

https://github.com/littleyoda/ha-pysmaplus/blob/main/docs/faq.md#speedwire-inverter-and-battery-storage

@lanwin
Copy link
Author

lanwin commented Feb 8, 2025

Hmm ich wollte gerade schreiben das beim neuladen der gleiche Fehler passiert. Aber auch das Downgrade auf 4.7. zeigt aktuell den Fehler.

Traceback (most recent call last):
  File "/usr/local/lib/python3.13/asyncio/tasks.py", line 507, in wait_for
    return await fut
           ^^^^^^^^^
asyncio.exceptions.CancelledError

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

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 637, in __async_setup_with_context
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/pysmaplus/__init__.py", line 111, in async_setup_entry
    sensor_def = await sma.get_sensors(entry.data[CONF_DEVICE])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/pysmaplus/device_speedwire.py", line 529, in get_sensors
    raise e
  File "/usr/local/lib/python3.13/site-packages/pysmaplus/device_speedwire.py", line 524, in get_sensors
    await asyncio.wait_for(fut, timeout=self._protocol._overallTimeout)
  File "/usr/local/lib/python3.13/asyncio/tasks.py", line 506, in wait_for
    async with timeouts.timeout(timeout):
               ~~~~~~~~~~~~~~~~^^^^^^^^^
  File "/usr/local/lib/python3.13/asyncio/timeouts.py", line 116, in __aexit__
    raise TimeoutError from exc_val
TimeoutError

Ich bin mir nicht ganz sicher, aber ich hatte mit der anderen extension https://github.com/eddso/ha_sma_speedwire keine connection Probleme.

Was evtl auch noch interessant ist. Als ich zeitweise beide extension installiert und konfiguriert hatte, funktionierte ha_sma_speedwire plötzlich nicht mehr. Kann es sein das das Problem mehrere gleichzeitige Verbindungsversuche sind?

@littleyoda
Copy link
Owner

Ich hatte in der letzten Version bei der Seriennummer die genutzt, die auch ha_sma_speedwire nutzt. Das kann zu Problemen führen. In der nächsten Version werde ich wieder eine andere nutzen.

Es gibt aber auch (unbestätigte) Aussagen, dass die Anzahl der Speedwire Verbindungen limitiert sind.

Ansonsten bist du wohl vom dem folgenden Problem betroffen, welches ich aktuell nicht korrigiert bekomme:

https://github.com/littleyoda/ha-pysmaplus/blob/main/docs/faq.md#speedwire-inverter-and-battery-storage

@lanwin
Copy link
Author

lanwin commented Feb 9, 2025

Ich hab komischerweise mit der 0.4.7 gerade wieder das es zu einem timeout beim sensor_def = await sma.get_sensors(entry.data[CONF_DEVICE]). Testweise habe ich mal den Sunny Explorer gestartet. Der funktioniert ohne Probleme.

@lanwin
Copy link
Author

lanwin commented Feb 9, 2025

Sehr merkwürdig. Ich hab jetzt testweise noch mal https://github.com/eddso/ha_sma_speedwire hinzugefügt und konfiguriert und plötzlich gehen beide.

BTW ich bin selbst Software Entwickler. Wenn ich irgendwas testen oder ausprobieren soll, dann sag Bescheid.

@littleyoda
Copy link
Owner

Ich befürchte mir ist gerade nicht zu helfen :-)

Ich muss mal von meiner Integration und von ha_sma_speedwire alle Pakete mitloggen.
Sie analysieren, um die Unterschiede zu bestimmen. Ich hoffe, dass ich daraus eine Idee bekommen kann, was schief läuft.

Wobei:
Ich habe hier mal dokumentiert, was ich als erstes auf dem langen Weg benötige.

Danach muss ich dann nochmal den Parser heraus kramen, der mit TCPDUMP zu recht kommt und schauen, ob er auch die ausgehenden Pakete parsen kann.

Wenn das alles funktioniert, kann ich mir die Unterschiede zwischen den beiden Integrationen anschauen.

@lanwin
Copy link
Author

lanwin commented Feb 9, 2025

Ich versuche mal ob ich die beiden dumps die Woche erzeugen kann. Kann ich dir die Dumps irgendwie "privat" zukommen lassen. Da ich nicht weiß welche Daten da ausgetauscht werden, möchte ich die nicht für jedermann sichtbar hochladen.

@littleyoda
Copy link
Owner

klar:
https://littleyoda.github.io/

danke

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants