Everything is working but I got this error constantly repeating:
pi@hassbian:~ $ mosquitto_sub -d -u xxxx -P xxxx -t "#"
Client mosqsub/896-hassbian sending CONNECT
Client mosqsub/896-hassbian received CONNACK
Connection Refused: bad user name or password.
Client mosqsub/896-hassbian sending CONNECT
Client mosqsub/896-hassbian received CONNACK
Connection Refused: bad user name or password.
Client mosqsub/896-hassbian sending CONNECT
Client mosqsub/896-hassbian received CONNACK
Connection Refused: bad user name or password.
Client mosqsub/896-hassbian sending CONNECT
Client mosqsub/896-hassbian received CONNACK
Connection Refused: bad user name or password.
Again, everything else is working so I know the broker is running and HASS can publish and read from the broker. Only this error.
Does anybody knows what password or user is not correct?
The mosquitto_sub command is trying to connect. Whatever you are typing in place of xxxx in this command does not match the username or password configured for mosquitto.
Edit:
Solved: If you are running a Mosquitto instance on the same server as Home Assistant then you must ensure that the Mosquitto service starts before Home Assistant. For a Linux instance running Systemd (Raspberry Pi, Debian, Ubuntu and others) then you should edit the file /etc/systemd/system/[email protected] as root (e.g., sudo nano /etc/systemd/system/[email protected]) and add the Mosquitto service: [Unit] Description=Home Assistant After=network.target mosquitto.service