jheling / freeathome

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

freeathome 2.5.0 #51

Closed steffenaxer closed 4 years ago

steffenaxer commented 4 years ago

I am not able to get a connection to my sysAp. I followed your instructions of the readme. The log show the following message: [slixmpp.xmlstream.xmlstream] Connection failed: [Errno 111] Connect call failed ('::', 5222, 0, 0). I would be very thankful for any supporting advice.

Best, Steffen

jheling commented 4 years ago

Did you put the the host, username and password in the configuration.yaml?

freeathome: host: x.x.x.x username: username password: passwd

steffenaxer commented 4 years ago

Hi, thx for your fast response. Yes I added all infos in the following format:

freeathome:
  host: 192.168.0.42
  username: user
  password: xyz

I know, that the config values are used. Already debuged this. In the log I can see, that the script detects free@home 2.5.0 and tries to connect... but I have no additional information what is going wrong and what is exactly sent.

I'm using hass.io hassos_rpi4-3.13 and have a raspi 4b.

Best Steffen

jheling commented 4 years ago

Did you use spaces for the indents? It looks like the parameters are not recognised. Maybe you could show some more loglines

steffenaxer commented 4 years ago

Yes I used spaces. Was this not correct? Some more log lines. All lines are related with free@home or the slixmpp. Tested also the fork from https://github.com/miezie/freeathome-api and saw that this generates an additonal error line

2020-05-01 18:27:11 ERROR (SyncWorker_5) [homeassistant.loader] Error parsing manifest.json file at /config/custom_components/freeathome/manifest.json: Expecting value: line 8 column 20 (char 223)

went already back to your code... now I only have this lines in log

2020-05-01 18:27:11 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for freeathome which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant. 2020-05-01 18:27:16 DEBUG (MainThread) [homeassistant.bootstrap] Setting up {'onboarding', 'ssdp', 'input_select', 'default_config', 'input_text', 'websocket_api', 'group', 'frontend', 'script', 'webhook', 'updater', 'input_boolean', 'config', 'freeathome', 'scene', 'lovelace', 'api', 'input_number', 'history', 'mobile_app', 'input_datetime', 'met', 'device_automation', 'http', 'zeroconf', 'sun', 'systemhealth', 'zone', 'map'} 2020-05-01 18:27:51 INFO (MainThread) [homeassistant.setup] Setting up freeathome 2020-05-01 18:27:51 WARNING (MainThread) [homeassistant.util.async] Detected I/O inside the event loop. This is causing stability issues. Please report issue to the custom component author for freeathome doing I/O at custom_components/freeathome/fah/settings.py, line 15: with urllib.request.urlopen(http) as url: 2020-05-01 18:27:51 INFO (MainThread) [custom_components.freeathome.pfreeathome] Connect Free@Home installer@busch-jaeger.de 2020-05-01 18:27:51 INFO (MainThread) [custom_components.freeathome.pfreeathome] version: 2.5.0

discovered, message=We have discovered new devices on your network. Check it out, notification_id=config_entry_discovery> 2020-05-01 18:27:57 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event persistent_notifications_updated[L]> 2020-05-01 18:27:57 INFO (MainThread) [custom_components.freeathome.pfreeathome] waiting for connection 2020-05-01 18:27:58 DEBUG (MainThread) [slixmpp.xmlstream.xmlstream] Connection failed: [Errno 111] Connect call failed ('0.0.0.0', 5222) 2020-05-01 18:27:58 DEBUG (MainThread) [slixmpp.xmlstream.xmlstream] Event triggered: connection_failed 2020-05-01 18:27:58 DEBUG (MainThread) [slixmpp.xmlstream.resolver] DNS: Querying for AAAA records. 2020-05-01 18:27:58 INFO (MainThread) [custom_components.freeathome.pfreeathome] waiting for connection 2020-05-01 18:27:58 DEBUG (MainThread) [slixmpp.xmlstream.resolver] DNS: Querying for A records. 2020-05-01 18:27:59 INFO (MainThread) [custom_components.freeathome.pfreeathome] waiting for connection 2020-05-01 18:28:00 INFO (MainThread) [custom_components.freeathome.pfreeathome] waiting for connection 2020-05-01 18:28:01 WARNING (MainThread) [homeassistant.setup] Setup of freeathome is taking over 10 seconds. 2020-05-01 18:28:01 INFO (MainThread) [custom_components.freeathome.pfreeathome] waiting for connection 2020-05-01 18:28:02 INFO (MainThread) [custom_components.freeathome.pfreeathome] waiting for connection 2020-05-01 18:28:03 INFO (MainThread) [custom_components.freeathome.pfreeathome] waiting for connection 2020-05-01 18:28:04 INFO (MainThread) [custom_components.freeathome.pfreeathome] waiting for connection ~ $ cat /config/home-assistant.log | grep free

steffenaxer commented 4 years ago

So if I change the user name to something wrong, I get the message: 2020-05-01 19:14:31 ERROR (MainThread) [custom_components.freeathome.fah.settings] user not found 2020-05-01 19:14:31 INFO (MainThread) [custom_components.freeathome.pfreeathome] Connect Free@Home None 2020-05-01 19:14:31 INFO (MainThread) [homeassistant.setup] Setup of domain freeathome took 0.2 seconds. 2020-05-01 19:14:31 ERROR (MainThread) [homeassistant.setup] Setup failed for freeathome: Integration failed to initialize.

It looks like he is using the credentials but is not getting a feedback or not a correct feedback

jheling commented 4 years ago

Spaces are ok. Looks like something goes wrong with the ip-adress. It should not be the 2.5 version of FAH as there are others users with this version.
I got a pull request for the error with the manifest.json, do you have the lastest version for this file? Maybe this error prevents home assistant getting the specific versions of the libraries. Can you see which version of slixmpp is running now? I know they have released a new version 1.5, maybe there are some bugs in this new version.

steffenaxer commented 4 years ago

Thanks for your help! Yes I'm using the latest version of this file. I think it might be related to docker and network / port settings. I'm new to home assistant (came from openhab). I switched now to rasbian lite and installed as a docker, in order to have more control about the host system. I'm not sure whether I have to set up in/out ports for docker images.

Best, Steffen

jheling commented 4 years ago

Before connecting to the sysap, the driver first opens a json file on the sysap. You can see this with a webbrowser ( xx.xx.xx.xx/settings.json). As the logging shows a value from this file (the jid), it looks like it can find the sysap. I suspect there is going something wrong in the slixmpp framework.

steffenaxer commented 4 years ago

The .json file is reachable from raspi. Here are some addition logs: 2020-05-02 06:59:42 INFO (SyncWorker_19) [homeassistant.util.package] Attempting install of https://github.com/jheling/slixmpp/archive/master.zip#slixmpp==1.4.2.1 2020-05-02 07:00:14 WARNING (MainThread) [slixmpp.stringprep] Using slower stringprep, consider compiling the faster cython/libidn one. 2020-05-02 07:00:15 DEBUG (MainThread) [slixmpp.plugins.base] Loaded Plugin: RFC 6120: Stream Feature: STARTTLS 2020-05-02 07:00:15 DEBUG (MainThread) [slixmpp.plugins.base] Loaded Plugin: RFC 6120: Stream Feature: Resource Binding 2020-05-02 07:00:15 DEBUG (MainThread) [slixmpp.plugins.base] Loaded Plugin: RFC 3920: Stream Feature: Start Session 2020-05-02 07:00:15 DEBUG (MainThread) [slixmpp.plugins.base] Loaded Plugin: RFC 6121: Stream Feature: Roster Versioning 2020-05-02 07:00:15 DEBUG (MainThread) [slixmpp.plugins.base] Loaded Plugin: RFC 6121: Stream Feature: Subscription Pre-Approval 2020-05-02 07:00:15 DEBUG (MainThread) [slixmpp.plugins.base] Loaded Plugin: RFC 6120: Stream Feature: SASL 2020-05-02 07:00:15 DEBUG (MainThread) [slixmpp.plugins.base] Loaded Plugin: XEP-0030: Service Discovery 2020-05-02 07:00:15 DEBUG (MainThread) [slixmpp.plugins.base] Loaded Plugin: XEP-0131: Stanza Headers and Internet Metadata 2020-05-02 07:00:15 DEBUG (MainThread) [slixmpp.plugins.base] Loaded Plugin: XEP-0004: Data Forms 2020-05-02 07:00:15 DEBUG (MainThread) [slixmpp.plugins.base] Loaded Plugin: XEP-0082: XMPP Date and Time Profiles 2020-05-02 07:00:15 DEBUG (MainThread) [slixmpp.plugins.base] Loaded Plugin: XEP-0060: Publish-Subscribe 2020-05-02 07:00:15 DEBUG (MainThread) [slixmpp.plugins.base] Loaded Plugin: XEP-0199: XMPP Ping 2020-05-02 07:00:15 DEBUG (MainThread) [slixmpp.xmlstream.xmlstream] Event triggered: connecting 2020-05-02 07:00:15 DEBUG (MainThread) [slixmpp.xmlstream.resolver] DNS: Querying for AAAA records. 2020-05-02 07:00:15 DEBUG (MainThread) [slixmpp.xmlstream.resolver] DNS: Querying for A records. 2020-05-02 07:00:16 DEBUG (MainThread) [slixmpp.xmlstream.xmlstream] Connection failed: [Errno 111] Connect call failed ('::', 5222, 0, 0) 2020-05-02 07:00:16 DEBUG (MainThread) [slixmpp.xmlstream.xmlstream] Event triggered: connection_failed 2020-05-02 07:00:17 DEBUG (MainThread) [slixmpp.xmlstream.xmlstream] Connection failed: [Errno 111] Connect call failed ('0.0.0.0', 5222) 2020-05-02 07:00:17 DEBUG (MainThread) [slixmpp.xmlstream.xmlstream] Event triggered: connection_failed 2020-05-02 07:00:21 DEBUG (MainThread) [slixmpp.xmlstream.xmlstream] Connection failed: [Errno 111] Connect call failed ('0.0.0.0', 5222) 2020-05-02 07:00:21 DEBUG (MainThread) [slixmpp.xmlstream.xmlstream] Event triggered: connection_failed 2020-05-02 07:00:21 DEBUG (MainThread) [slixmpp.xmlstream.resolver] DNS: Querying for AAAA records. 2020-05-02 07:00:21 DEBUG (MainThread) [slixmpp.xmlstream.resolver] DNS: Querying for A records.

steffenaxer commented 4 years ago

Ok sorry for the trouble. I found the issue. I already had set up a raspi, used as a pihole. In order to play arround, I bought a new one. Both pis had the same hostname, which causes problem. I changed it and I can see now devices in the log :) 2020-05-02 08:17:52 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new light.freeathome entity: light.licht_bad_decke

Best Steffen

steffenaxer commented 4 years ago

Sorry need to reactive this issue. What I found out till now:

Best, Steffen

jheling commented 4 years ago

Have you allready tried the standard hassos version?

The code first tries to setup a normal xmpp connection, after that there is some extra authentication with crypto keys exchanging. If that is ok, then the wait for connection wil proceed. Only the logging can give a clue where the connection fails.

If you still get the DNS error messages, then i suspect it it something network related as it fails with the normal xmpp connection.

steffenaxer commented 4 years ago

Yes for sure, tested the following constellations:

steffenaxer commented 4 years ago

Ok, I'm now able to set up a working connection. If I change from ip to hostname "sysAp" the connections works. Hm, thats strange. Do you have any idea?

jheling commented 4 years ago

No, i have no clue. I know there was an issue that i could not use hostnames to connect the sysap and had to use an ip-adress. Maybe this is fixed in the 1.5 version of slixmpp. I am going to try this myself on my test system.

jheling commented 4 years ago

Yes, the hostname SysAP.local will also work for me. I still don't know why a ip adress doesn't work for you, but this is also a good solution.

steffenaxer commented 4 years ago

Tank you for testing. It might be related to the fact, that I have pihole installed, used as a local dns. The router uses this local pihole as a dns. Pihole sends stuff back to router and than to upstream. Anyway. I'm very happe that this is working right now. And I'm already forked this project in order to contribute.

I'am adding an additional output info from thermostat devices. Also posted this in the openhab communiy. I think, we can close this issue...

Best, Steffen