Home Assistant cannot connect to the broker. Here’s what I’ve set and what I see:
Mosquitto is seeing my devices fine. It’s just not being found by Home Assistant.
This excerpt from MQTT log shows this:
[WARN] Not found homeassistant on local database
1541619621: Socket error on client <unknown>, disconnecting.
[INFO] found ashscott on local database
1541619623: Client DVES_4558BB already connected, closing old connection.
1541619623: Client DVES_4558BB disconnected.
I see this on the overview:
I’d really appreciate some help. My problem is exceeding my skill level!
Also tried without username and password in Mosquito config.
I still get the ‘unable to connect to the broker’ message.
This is what I get in the Mosquitto log after restarting it:
[INFO] Setup mosquitto configuration [INFO] No local user available [INFO] Initialize Hass.io Add-on services [INFO] Initialize Home Assistant discovery [INFO] Start Mosquitto daemon 1541659280: mosquitto version 1.4.15 (build date 2018-05-08 10:35:06+0000) starting 1541659280: Config loaded from /etc/mosquitto.conf. 1541659280: *** auth-plug: startup 1541659280: ** Configured order: http 1541659280: Opening ipv4 listen socket on port 1883. 1541659280: Opening ipv6 listen socket on port 1883. 1541659280: Opening websockets listen socket on port 1884. 1541659280: Opening ipv4 listen socket on port 8883. 1541659280: Opening ipv6 listen socket on port 8883. 1541659280: Opening websockets listen socket on port 8884. 1541659280: Warning: Mosquitto should not be run as root/administrator. 1541659281: New connection from 10.0.1.28 on port 1883. [WARN] Not found homeassistant on local database 1541659283: Socket error on client <unknown>, disconnecting. 1541659283: New connection from 10.0.1.174 on port 1883. [WARN] Not found homeassistant on local database
It seems that Mosguitto is running but can’t find Home Assistant and that Home Assistant is running and can’t find Mosquitto.
I’ve now reinstalled Mosquitto MQT and set it to run.
This is the log:
[INFO] Setup mosquitto configuration
[INFO] No local user available
[INFO] Initialize system configuration.
[INFO] Initialize Hass.io Add-on services
[INFO] Initialize Home Assistant discovery
[INFO] Start Mosquitto daemon
1541661462: mosquitto version 1.4.15 (build date 2018-05-08 10:35:06+0000) starting
1541661462: Config loaded from /etc/mosquitto.conf.
1541661462: *** auth-plug: startup
1541661462: ** Configured order: http
1541661462: Opening ipv4 listen socket on port 1883.
1541661462: Opening ipv6 listen socket on port 1883.
1541661462: Opening websockets listen socket on port 1884.
1541661462: Opening ipv4 listen socket on port 8883.
1541661462: Opening ipv6 listen socket on port 8883.
1541661462: Opening websockets listen socket on port 8884.
1541661462: Warning: Mosquitto should not be run as root/administrator.
When I then go to Integrations it’s there, discovered, now asking to be configured.
Clicking the one click configure has it return with ‘Unable to connect to the broker’ again.
looks like you’re almost there! All your devices are connected to Mosquitto again, so that is running fine. I think the problem is Home Assistant due to this error in your Mosquitto log:
[WARN] Not found homeassistant on local database
This doesn’t mean Home Assistant can’t find your Mosquitto broker, but Mosquitto is telling you someone is trying to log on with the username “homeassistant” which is no longer allowed.
Make sure mqtt: in your configuration.yaml is gone for good.
In the config box from the Mosquitto addons do not use “homeassistant” or “addons” as the
username, anything else will work. For good measure set “anonymous” to “true”
Remove the inegration and restart homeassistant.
After the restart add the inegration again, using the username and password you’ve set in Mosquitto config
and use "core-mosquitto" as the broker. I also enabled discovery there and all is well for me.
mqtt is commented out in configuration.yaml and only exists in automation.yaml as mqtt.publish
Here’s the log again:
[INFO] Setup mosquitto configuration
[INFO] Found local users inside config
[INFO] Initialize system configuration.
[INFO] Initialize Hass.io Add-on services
[INFO] Initialize Home Assistant discovery
[INFO] Start Mosquitto daemon
1541663641: mosquitto version 1.4.15 (build date 2018-05-08 10:35:06+0000) starting
1541663641: Config loaded from /etc/mosquitto.conf.
1541663641: *** auth-plug: startup
1541663641: ** Configured order: http
1541663641: Opening ipv4 listen socket on port 1883.
1541663641: Opening ipv6 listen socket on port 1883.
1541663641: Opening websockets listen socket on port 1884.
1541663641: Opening ipv4 listen socket on port 8883.
1541663641: Opening ipv6 listen socket on port 8883.
1541663641: Opening websockets listen socket on port 8884.
1541663641: Warning: Mosquitto should not be run as root/administrator.
Where does it say unable to connect to broker? in the log you’ve just posted i don’t see any devices connecting to mosquitto, nor do i see any error’s…
18-11-08 08:10:38 INFO (MainThread) [hassio.auth] Success login from ashscott
18-11-08 08:11:01 INFO (MainThread) [hassio.auth] Auth request from core_mosquitto for ashscott
18-11-08 08:11:03 INFO (MainThread) [hassio.auth] Success login from ashscott
18-11-08 08:11:17 INFO (MainThread) [hassio.auth] Auth request from core_mosquitto for ashscott
18-11-08 08:11:19 INFO (MainThread) [hassio.auth] Success login from ashscott
The username in MQTT mosquitto is set to mqtt though!
I’ve tried it with the ashscott username - same result.
running the addon and configuring that correctly is one thing.
But you have to see it as a separate source for your entities, and you still have to point HA to this broker for creating mqtt sensors ea.
for that you need a mqtt: setting in your configuration.yaml
it’s easier to understand when trying from another device. You can reach the broker on device 1, but have to point device 2 to the ip address where that broker is running.
you have to do that too, when on the same ip address…