icanos / hassio-plejd

Hass.io add-on for Plejd home automation devices
Apache License 2.0
126 stars 36 forks source link

Problem to connect to MQTT #20

Closed fwarberg closed 4 years ago

fwarberg commented 4 years ago

Hi!

First I would like to thank you for the nice job! Really looking forward to get it up and running.

I just tried to add-on but it looks like there is a problem connecting to the MQTT. I have verified the credentials used with an other tool and it works fine. The connection looks different to other connections as I cant see any records of "New client connected......" It only says "Socket error on client , disconnecting." That's why I believe it has something to do with MQTT.

I am running Hass.io on VMware.. which is running on an Intel NUC. The MQTT broker is Mosquitto.

Plejd add-on log: [s6-init] making user provided files available at /var/run/s6/etc...exited 0. [s6-init] ensuring user provided files have correct perms...exited 0. [fix-attrs.d] applying ownership & permissions fixes... [fix-attrs.d] done. [cont-init.d] executing container initialization scripts... [cont-init.d] 00-banner.sh: executing...

Hass.io Add-on: Plejd Adds support for the Swedish home automation devices from Plejd.

Add-on version: 0.1.1 You are running the latest version of this add-on. parse error: Expected string key before ':' at line 1, column 4 [20:51:30] ERROR: Unknown HTTP error occured System: (amd64 / qemux86-64) Home Assistant version: 0.103.4 Supervisor version: 193

Please, share the above information when looking for help or support in, e.g., GitHub, forums or the Discord chat.

[cont-init.d] 00-banner.sh: exited 0. [cont-init.d] 01-log-level.sh: executing... [cont-init.d] 01-log-level.sh: exited 0. [cont-init.d] done. [services.d] starting services [services.d] done. [20:51:31] INFO: Starting the Plejd service... [20:51:31] INFO: Verified permissions on startup script [20:51:31] INFO: Executing startup script [20:51:31] INFO: Wrote plejd.json [20:51:31] INFO: Running add-on [20:51:34] INFO: Starting the Plejd service... [20:51:34] INFO: Verified permissions on startup script [20:51:34] INFO: Executing startup script [20:51:34] INFO: Wrote plejd.json [20:51:34] INFO: Running add-on [20:51:36] INFO: Starting the Plejd service... [20:51:36] INFO: Verified permissions on startup script [20:51:36] INFO: Executing startup script [20:51:37] INFO: Wrote plejd.json [20:51:37] INFO: Running add-on [20:51:39] INFO: Starting the Plejd service... [20:51:39] INFO: Verified permissions on startup script [20:51:39] INFO: Executing startup script [20:51:39] INFO: Wrote plejd.json [20:51:39] INFO: Running add-on

Mosquitto logs: 1577304124: New connection from 10.x.x.x on port 1883. 1577304124: Socket error on client , disconnecting. 1577304126: New connection from 10.x.x.x on port 1883. 1577304127: Socket error on client , disconnecting. 1577304129: New connection from 10.x.x.x on port 1883. 1577304129: Socket error on client , disconnecting.

Regards, Fredrik

icanos commented 4 years ago

Please verify that your client_id is unique for both clients, otherwise it will disconnect each other.

fwarberg commented 4 years ago

Hi Marcus I only have two clients. Homeassistant and Plejd. The first connection below is from homeassistant and the second is from the Plejd component.

[18:04:20] INFO: Setup mosquitto configuration [18:04:20] INFO: No local user available [18:04:20] INFO: Initialize Hass.io Add-on services [18:04:20] INFO: Initialize Home Assistant discovery [18:04:20] INFO: Start Mosquitto daemon 1577466260: mosquitto version 1.6.3 starting 1577466260: Config loaded from /etc/mosquitto.conf. 1577466260: Loading plugin: /usr/share/mosquitto/auth-plug.so 1577466260: |-- *** auth-plug: startup 1577466260: ├── Username/password checking enabled. 1577466260: ├── TLS-PSK checking enabled. 1577466260: └── Extended authentication not enabled. 1577466260: Opening ipv4 listen socket on port 1883. 1577466260: Opening ipv6 listen socket on port 1883. 1577466260: Opening websockets listen socket on port 1884. 1577466260: Opening ipv4 listen socket on port 8883. 1577466260: Opening ipv6 listen socket on port 8883. 1577466260: Opening websockets listen socket on port 8884. 1577466260: Warning: Mosquitto should not be run as root/administrator. 1577466261: New connection from 172.30.32.1 on port 1883. [INFO] found homeassistant on local database 1577466261: New client connected from 172.30.32.1 as auto-86344D2A-FD83-3C30-F1B3-7B85DF398CF4 (p2, c1, k60, u'homeassistant'). 1577466291: New connection from 10.20.10.12 on port 1883. 1577466291: Socket error on client , disconnecting

icanos commented 4 years ago

Interesting, I need to add some more debugging to the MQTT client since it looks like there is some error when connecting. I'm about to push a new version to the master branch, I'll get back when that is done :)

icanos commented 4 years ago

Did you have a chance to try the new code?

fwarberg commented 4 years ago

I have downloaded the latest code as per today. Unfortunately it looks like I still have problems. The MQTT logs looks like before.

[s6-init] making user provided files available at /var/run/s6/etc...exited 0. [s6-init] ensuring user provided files have correct perms...exited 0. [fix-attrs.d] applying ownership & permissions fixes... [fix-attrs.d] done. [cont-init.d] executing container initialization scripts... [cont-init.d] 00-banner.sh: executing...

Hass.io Add-on: Plejd Adds support for the Swedish home automation devices from Plejd.

Add-on version: 0.2.1 You are running the latest version of this add-on. parse error: Expected string key before ':' at line 1, column 4 [20:47:10] ERROR: Unknown HTTP error occured System: (amd64 / qemux86-64) Home Assistant version: 0.103.5 Supervisor version: 193

Please, share the above information when looking for help or support in, e.g., GitHub, forums or the Discord chat.

[cont-init.d] 00-banner.sh: exited 0. [cont-init.d] 01-log-level.sh: executing... [cont-init.d] 01-log-level.sh: exited 0. [cont-init.d] done. [services.d] starting services [services.d] done. [20:47:11] INFO: Starting the Plejd service... [20:47:11] INFO: Verified permissions on startup script [20:47:11] INFO: Executing startup script [20:47:12] INFO: Wrote plejd.json [20:47:12] INFO: Running add-on starting Plejd add-on v. 0.2.0 plejd-api: got session token response plejd-api: got sites response wireEvents() [20:47:13] INFO: Starting the Plejd service... [20:47:13] INFO: Verified permissions on startup script [20:47:13] INFO: Executing startup script [20:47:14] INFO: Wrote plejd.json [20:47:14] INFO: Running add-on starting Plejd add-on v. 0.2.0 plejd-api: got session token response plejd-api: got sites response wireEvents() [20:47:16] INFO: Starting the Plejd service... [20:47:16] INFO: Verified permissions on startup script [20:47:16] INFO: Executing startup script [20:47:16] INFO: Wrote plejd.json [20:47:16] INFO: Running add-on

icanos commented 4 years ago

Have been unable to reproduce this and doesn't seem to occur that wildly, closing this issue. Feel free to reopen a new issue with step by step on how to reproduce the issue and/or further information.

fwarberg commented 4 years ago

Hi,

I just wanted to say that it probably was an incorrect password which caused the problem. The next problem was that BT didnt work but now after HassOS 3.10 it works perfekt because they added support fo BT on all platforms.

Keep up the good work 😀

-Fredrik