'Unable to connect to the broker'

If discovery is enabled in HA as soon as you setoption19 on in Tasmota it should immediately appear in HA.

both acl.conf and accesscontrollist file is there for all three installation. like i mention before 3x3 combine, 9 different way to set all been tried.

i have mqqttfx running in the background to monitor traffic in all 3 installation. This current one right now yeah zero traffic if i use HA to send an test packet.

The weird part of this is every time i install the addon it give me different unique issue. Even tho all the configuration and way i test is the same. It seem like it wrote some info or auth somewhere HA and even if uninstall it doesn’t fully revise those input. Reinstalling it making it worst or cause conflict.

Hi, I’m quite new in the world of HA, but have experise with other home automation tools.
I am struggling with my Mosquitto Broker. I want to use this in combination with zigbee2mqtt with a CC2531 USB stick.
I installed the add-on zigbee2mqtt and it is working fine. But now the problem is after installing the MQTT Broker. I got the following error:

[14:16:51] INFO: Setup mosquitto configuration
[14:16:51] WARNING: SSL not enabled - No valid certs found!
[14:16:51] INFO: Found local users inside config
[14:16:53] INFO: Initialize Hass.io Add-on services
[14:16:53] INFO: Initialize Home Assistant discovery
[14:16:53] INFO: Start Mosquitto daemon
1589199413: mosquitto version 1.6.3 starting
1589199413: Config loaded from /etc/mosquitto.conf.
1589199413: Loading plugin: /usr/share/mosquitto/auth-plug.so
1589199413: |-- *** auth-plug: startup
1589199413:  ├── Username/password checking enabled.
1589199413:  ├── TLS-PSK checking enabled.
1589199413:  └── Extended authentication not enabled.
1589199413: Opening ipv4 listen socket on port 1883.
1589199413: Opening ipv6 listen socket on port 1883.
1589199413: Opening websockets listen socket on port 1884.
1589199413: Warning: Mosquitto should not be run as root/administrator.
1589199413: New connection from 172.30.32.1 on port 1883.
[INFO] found user on local database
1589199415: New client connected from 172.30.32.1 as mqttjs_e5e86517 (p2, c1, k60, u'user').
1589199472: New connection from 172.30.32.1 on port 1883.
[WARN] Not found homeassistant on local database
1589199474: Socket error on client <unknown>, disconnecting.

It looks the a new client is connected. Is this one still connected or due to 'Socket error client ’ disconnected? In my logging of zigbee2mqtt-add nothing special:

zigbee2mqtt:info  2020-05-11 14:16:55: Connected to MQTT server
zigbee2mqtt:info  2020-05-11 14:16:55: MQTT publish: topic 'zigbee2mqtt/bridge/state', payload 'online'
zigbee2mqtt:info  2020-05-11 14:30:04: MQTT publish: topic 'zigbee2mqtt/0x00158d00032173c0', payload '{"battery":74,"voltage":2955,"temperature":18.23,"humidity":47.02,"pressure":1012.2,"linkquality":55}'

But looking at the integrations–> mqtt broker, there are no devices or entries.
Further, my configuation.yaml I did not changed. Still the same after did a new installation of HA

My config is as follows:

logins:
  - username: <user>
    password: <password>
anonymous: false
customize:
  active: false
  folder: mosquitto
certfile: fullchain.pem
keyfile: privkey.pem
require_certificate: false

Who can help me?

Your user can’t be homeassistant

Yes, I know. I made user : user and password : pass

Further my config of zigbee2mqtt add on:

data_path: /share/zigbee2mqtt
devices: devices.yaml
groups: groups.yaml
homeassistant: true
permit_join: false
mqtt:
  base_topic: zigbee2mqtt
  server: 'mqtt://<ip-adres HA>:1883'
  user: mqtt
  password: mqtt
serial:
  port: /dev/ttyACM0

I changed the user and password tot ‘mqtt’
Now I get the following:

1589202311: New connection from 172.30.32.1 on port 1883.
[INFO] found mqtt on local database
1589202313: New client connected from 172.30.32.1 as mqttjs_c7bb67d9 (p2, c1, k60, u'mqtt').
1589202345: New connection from 172.30.32.1 on port 1883.
[WARN] Not found homeassistant on local database
1589202347: Socket error on client <unknown>, disconnecting.

Could it be that another connection - with ‘homeassistent’ - also try connect and therefore the broker stops?? How can I check where the new connection with ‘homeassistance’ comes from?

Delete integration
Then you will have the same integration but it will say in the card configuration yaml

@doktordoc Delete integration? All the devices? Or the MQTT Broker? I already did, but with no succes.
And what do you mean with the same integration. My configuration.yaml is almost empty. As it was at the installation of HA

try delete integration from ui, add this to config yaml, with your data

mqtt:
broker: 192.168.0.00:1883
username: aaaaaa
password: aaaaaa
discovery: true

Integration on ui? Delete the MQTT broker?

I add what you supposed, @doktordoc, in config/configuration.yaml
Now I get the following error:


2020-05-12 20:52:32 WARNING (MainThread) [homeassistant.components.mqtt] Data in your configuration entry is going to override your configuration.yaml: {'broker': 'core-mosquitto', 'discovery': True, 'password': 'if7ahphoh0ak2waecee5je4fa0AeGae3iezeiyoo0peeshiiShob4queec0ahquo', 'port': 1883, 'protocol': '3.1.1', 'username': 'homeassistant'}
2020-05-12 20:52:35 ERROR (Thread-2) [homeassistant.components.mqtt] Unable to connect to the MQTT broker: Connection Refused: not authorised.
2020-05-12 20:52:35 WARNING (Thread-2) [homeassistant.components.mqtt] Disconnected from MQTT (5).

make new user in users,

follow this

The example is wrong. Everything after mqtt: needs 2 spaces in front.

mqtt:
  broker: 

and so on.

Now I get


2020-05-12 20:52:32 WARNING (MainThread) [homeassistant.components.mqtt] Data in your configuration entry is going to override your configuration.yaml: {'broker': 'core-mosquitto', 'discovery': True, 'password': 'if7ahphoh0ak2waecee5je4fa0AeGae3iezeiyoo0peeshiiShob4queec0ahquo', 'port': 1883, 'protocol': '3.1.1', 'username': 'homeassistant'}
2020-05-12 20:52:35 ERROR (Thread-2) [homeassistant.components.mqtt] Unable to connect to the MQTT broker: Connection Refused: not authorised.
2020-05-12 20:52:35 WARNING (Thread-2) [homeassistant.components.mqtt] Disconnected from MQTT (5).

Either you configure your broker through the integration, or through configuration.yaml. you can’t do both.

I did a complete reinstall of HA, and now it works!
Thanks @francisp and @doktordoc for helping!

15 - 20 h later I find this comment and get MQTT working on HASSio.

you sir are a saint

1 Like

OMG this has been a diagnosis nightmare getting Hassio MQTT Integration to connect to Mosquitto MQTT Broker using SSL; until I came across @Echo_NL (thanks!) note on Nov '18 to fully remove the mqtt: block from configuration.yaml … Removed the block and eveything connected up.

1 Like

Hello,

I have same issue.
i try to uninstall/restart hasio.io/install

i have fresh install of hasio.io and mqtt.
I do not have any mqtt configuration in configuration.yaml
my config is simple:

logins:

  • username: pai
    password: password
    anonymous: true
    customize:
    active: false
    folder: mosquitto
    certfile: fullchain.pem
    keyfile: privkey.pem
    require_certificate: false

I use letsencrypt for ssl.

log:
1611591937: New connection from 172.30.32.1 on port 1883.
[WARN] Not found homeassistant on local database
1611591938: Socket error on client , disconnecting.
1611592058: New connection from 172.30.32.1 on port 1883.
1611592058: Socket error on client , disconnecting.

Ed