jheling / freeathome

Free@Home component for Home Assistant
103 stars 37 forks source link

Problems with the controls (since updating SysAP to 3.2.3 ?) #172

Closed frontside76 closed 3 months ago

frontside76 commented 6 months ago

For about 2 weeks I have been having major problems controlling the free@home components in Home Assistant. For example, I can close 3 roller shutters and when I want to open them again, sometimes it only works with a delay of 1-2 minutes, and sometimes not at all. This then also affects other devices, such as turning lights on and off. That doesn't work anymore either. I then get an error message in the dashboard that a service could not be executed and also lots of messages in the log. Then I can only restart HA completely. And the same thing happens again with the next few actions. I tried to create a dump and a monitor file as described in your documentation, but the files are always empty. But I add HA log with lots of freeathome errors and a screenshot from the dashboard error.

Logfile: home-assistant_2023-12-18T20-33-39.691Z.log

Screenshot:

Screenshot 2023-12-18 213040
rremmelts commented 6 months ago

Same problem here. I can enable free at home lights but not disable them anymore since the new SysAp

jheling commented 6 months ago

It looks like the api of Free@Home has changed. The call for fetching all the devices gives a timeout.

2023-12-18 20:38:04.477 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry 192.168.0.101 for freeathome
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/freeathome/__init__.py", line 77, in async_setup_entry
    await sysap.find_devices()
  File "/config/custom_components/freeathome/fah/pfreeathome.py", line 923, in find_devices
    await self.xmpp.find_devices(self._use_room_names)
  File "/config/custom_components/freeathome/fah/pfreeathome.py", line 645, in find_devices
    config = await self.get_config()
             ^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/freeathome/fah/pfreeathome.py", line 622, in get_config
    my_iq = await self.send_rpc_iq('RemoteInterface.getAll', 'de', 2, pretty_value, 0)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
slixmpp.exceptions.IqTimeout: <iq id="bc303bd727cc4f3eb88274201ba3fc4a" type="set" to="mrha@busch-jaeger.de/rpc" from="installer@busch-jaeger.de/3cd204b5"><query xmlns="jabber:iq:rpc"><methodCall><methodName>RemoteInterface.getAll</methodName><params><param><value><string>de</string></value></param><param><value><i4>2</i4></value></param><param><value><i4>0</i4></value></param><param><value><i4>0</i4></value></param></params></methodCall></query></iq>
2023-12-18 20:54:21.969 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/slixmpp/plugins/xep_0199/ping.py", line 140, in _keepalive
    rtt = await self.ping(self.xmpp.boundjid.host, timeout=self.timeout)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/slixmpp/plugins/xep_0199/ping.py", line 198, in ping
    await self.send_ping(jid, ifrom=ifrom, timeout=timeout)
slixmpp.exceptions.IqTimeout: <iq id="8ab1897a2473438a98b3994a3e0558cb" type="get" to="busch-jaeger.de"><ping xmlns="urn:xmpp:ping" /></iq>
worldfakes commented 5 months ago

I have exactly the same problem since the update to 3.2.3. Is there a solution for this?

derjoerg commented 5 months ago

I'm also on 3.2.3, but for me the integration is working as before... (I only have the deprecation-warnings in the logs as mentioned in #175) If I can provide any information (logs, dumps, ...) I'm happy to help

jheling commented 5 months ago

Ok, if it is working for @derjoerg then it not a breaking change. Then there is probably something wrong in the xml containing the configuration. Can you try to make a dump as described in section 1 of the debugging? Then we can see if there is something odd in this file.

frontside76 commented 5 months ago

@jheling Me? I did both, dump and monitoring file, after i have installed the HACS Integration of freeathome again: freeathome_dump_monitor.zip

Actually the integration works as i should be, no problems with the controls. Now i don't get much errors. Only this Error i get every day more than once:

Logger: homeassistant Source: /usr/src/homeassistant/homeassistant/runner.py:145 First occurred: 04:43:53 (3 occurrences) Last logged: 10:48:53

Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/slixmpp/plugins/xep_0199/ping.py", line 140, in _keepalive rtt = await self.ping(self.xmpp.boundjid.host, timeout=self.timeout) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/slixmpp/plugins/xep_0199/ping.py", line 198, in ping await self.send_ping(jid, ifrom=ifrom, timeout=timeout) slixmpp.exceptions.IqTimeout:

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/slixmpp/plugins/xep_0199/ping.py", line 144, in _keepalive self.xmpp.reconnect(0.0, "Ping timeout after %ds" % self.timeout) TypeError: 'bool' object is not callable

jheling commented 5 months ago

So a re-installation of the integration seems to be the solution. About the ping errors, the slixmpp package is used for the communication between the integration and the free@home sysap. The ping is used to keep the connection open. It seems to be a bug of slixmpp maybe in combination with home assistant. I don't know what to do about it.

frontside76 commented 3 months ago

So a re-installation of the integration seems to be the solution. About the ping errors, the slixmpp package is used for the communication between the integration and the free@home sysap. The ping is used to keep the connection open. It seems to be a bug of slixmpp maybe in combination with home assistant. I don't know what to do about it.

The ping error is fixed meanwhile. Actually there are no Problems for me, this issue can be closed.

frontside76 commented 3 months ago

The problem does not exist anymore.