MQTT Problems with 0.101 release

Actually i run mosquitto in the same machine where it lies home assistant and my configs are:

In configuration.yaml i have

mqtt:
  broker: !secret mqtt_broker
  username: !secret mqtt_username
  password: !secret mqtt_password
  discovery: true
  discovery_prefix: homeassistant

And about lights i have:

  - platform: mqtt
    name: "Faretti Ingresso"
    command_topic: "cmnd/sonoff-01/power"
    state_topic: "stat/sonoff-01/POWER"
    qos: 1
    payload_on: "ON"
    payload_off: "OFF"
    payload_available: "Online"
    payload_not_available: "Offline"
    retain: true

So it means i have a wrong configuration as the secret broker is the IP address of my raspberry?

The problem here is that you are asking the same/similar question in many different places and as a result you are getting many different disparate answers because no one knows about the other conversations going on in 4 different threads.

I really think you need to just stick to using one thread to try to help you figure stuff out and things will be far less confusing for others who are trying to help you and especially for you trying to follow suggestions from 4 different threads at the same time.

You are right… Sorry… I’ll continue, eventually, only the thread about 0.101 release hoping all my problems will be solved.

Is the log in this post from the working .100 or the non working .101 setup MQTT Problems with 0.101 release

Non working .101 setup

@maurizio53
I was reading another thread related to MQTT and I noticed this detail

If you look at https://www.home-assistant.io/addons/mosquitto/ then it says

This add-on is attached to the Home Assistant user system, so mqtt clients can make use of these credentials. Local users may also still be set independently within the configuration options for the add-on. For the internal Hass.io ecosystem we register ‘homeassistant’ and ‘addons’ , so these may not be used as user names.

I can see in your logs that indeed you have chosen the username “homeassistant”

Maybe that creates your trouble. I do not know if this constraint was added recently. I am not a dev. I just noted this and remember that you used that user name in your logs

The link provided relates to using the Mosquitto Addon and not Mosquitto on bare metal. I just wonder if the integration code with external could have similar issue. It is worth a try.

To change user name use the mosquitto_passwd application. You cannot just hack the user name in the password file

can you show me an example about how to change username into mosquitto?

I already had this in previous post

Note this is related to running Mosquitto on bare metal. The Addon is doing it for you via a UI

The command is

sudo mosquitto_passwd -b passwordfile user password

You have to be in the same directory as the existing password file. See my earlier posts.

The command adds a new user and leaves the existing homeassistant user

You can remove the old by just deleting the line from the file.

And remember that all your MQTT devices need to be setup to use the new username if you delete the homeassistant user

You have to restart Mosquitto to activate the new user

sudo systemctl restart mosquitto

Kenneth

He’s not using an add-on. He is running HA in a venv, not Hassio.

I wrote: “ The link provided relates to using the Mosquitto Addon and not Mosquitto on bare metal. I just wonder if the integration code with external could have similar issue. It is worth a try.”

Just trying to help

Yeah, I get that but the OP is already confused enough and he’s posted this same problem to 3 or 4 threads and getting advice from many sources none of which necessarily knows about all of the others which is definitely making things worse.

I just wanted to be sure to point out to him that the problem that you posted is related to hassio not necessarily HA in a venv so there may be no need to be concerned about it yet.

What the OP needs to do is follow your advice and upgrade on a fresh, default configuration.yaml, and then reintroduce his personal config chunk by chunk.

I say your advice, because you posted it in one of the threads. I posted almost identical advice in one of the others.

The MQTT error is a big red herring at the moment, and trying to fix it is probably breaking more things.

Unfortunately, if the OP isn’t going to do this, everyone is wasting their time and we may as well merge and lock the threads.

1 Like

unfortunately I think you’re right.

EDIT: tho I do remember seeing on another one of the threads that he did manage to upgrade to v101 using our advice.

And there was some discussion about finding that MQTT was the last issue. So, at least there is progress.

Must’ve missed that thread in the haze of the others :laughing:

If that is the case, I retract my frustrated post.

1 Like