MQTT Broker - Add user for Frigate?

I’ve been using MQTT for a while but I don’t actually know how it works. I wanted to start using Frigate NVR with one of my ReoLink cameras, but I can’t get Frigate to properly communicate with MQTT. MQTT’s Config tab has this as the default:

logins: []
anonymous: false
customize:
  active: false
  folder: mosquitto
certfile: fullchain.pem
keyfile: privkey.pem
require_certificate: false

When I modify the above and try to add a new user, it doesn’t say anything about invalid YAML, but clicking the save button doesn’t save.

Is this the right place to add a user? Do I need to add a user for Frigate NVR to communicate with MQTT?

No you dont need to add a new user. Since you havent specified any username and password, your home assistant user name and password becomes your default which you can also use with frigate. Just go to frigate.yml in config folder and add the following.

mqtt:
  host: 192.168.0.1
  port: 1883
  user: <ur_ha_username>
  password: <ur_ha_passoword>
  topic_prefix: frigate

You have to replace the host, <ur_ha_username>, <ur_ha_passoword> with yours and you should be all set with frigate mqtt.

Then it just spams me with infinite:

1618457225: New client connected from <ip> as frigate (p2, c1, k60, u'<username>').
1618457305: Socket error on client frigate, disconnecting.

Are you seeing your username here or is it this only?

Anywhere using carrot brackets is something I’ve censored. Same for ip address.

Are there any issues with other mqtt devices connected to this broker?

My ESPs have no issues and stay connected just fine.

Socket error means the username or password is not correct. Double check those. if this persists please try adding a different user to mqtt addon configuration like this and use it with frigate.

logins:
  - username: user
    password: passwd

Ah that did it! Apparently my YAML was wrong and thus it (MQTT’s config window) wasn’t accepting it, so copying yours worked.

Crap, I spoke too soon.

1618522004: Socket error on client frigate, disconnecting.

Socket error is back. Though I just noticed, it looks like Frigate is rebooting on its own, and that lines up with when the socket error pops up in MQTT’s logs.

Since you’ve answered my initial question regarding adding a user properly, I’ll mark your last comment as the solution and create a new thread to figure out the Frigate rebooting problem. Thanks!