Ad Widget

Collapse

Cannot Authenticate to MQTT Broker in Home Assistant

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pgatty
    Junior Member
    • Feb 2022
    • 14

    #1

    Cannot Authenticate to MQTT Broker in Home Assistant

    I have an instance of Home Assistant running on Home Assistant OS that runs the MQTT plugin along with the Mosquitto broker add-on. I'm publishing the state of multiple HA sensors to the broker using MQTT Statestream. Everything is working well and I can see the published data using MQTT Explorer. I've also installed the Zabbix Agent 2 addon which is pulling all the relevant Linux data into Zabbix (version 7.4). I would like to start pulling into Zabbix sensor data from the MQTT Broker, but am running into issues with getting the Zabbix Agent 2 to authenticate to the MQTT Broker. The the Mosquitto broker add-on can use both Home Assistant users as well as local users configured within the broker itself. Both of these methods work and I can use the created users to access the broker with MQTT Explorer. I've followed the configuration instructions for the Zabbix MQTT Plugin, but I cannot get the Zabbix Agent to authenticate to the MQTT Broker. Here's an example of of the item key that's failing.

    Code:
    mqtt.get[10.255.255.144:1883,homeassistant,mqttread,passwd/sensor/chezgatty_temperature/state]
    In the Mosquitto broker log I see the following authentication failure
    Code:
    2025-09-08 10:12:42: New connection from 10.255.255.144:48556 on port 1883.
    2025-09-08 10:12:42: Client ZabbixAgent23qiaqwPG disconnected, not authorised.
    The interesting part is I can use the same user ID and password from the item key to successfully connect to the broker with MQTT explorer. Clearly the user ID and password are valid, but for some reason the Zabbix Agent 2 can't use them to authenticate.

    One more bit of information. I've checked the Zabbix Server logs and Zabbix agent logs and they don't give any more information other than the call is not authorized. I also tried turning up the Mosquitto broker logs to debug and that didn't yield anything useful.

    Does anyone have any ideas on what's going on?
    Last edited by pgatty; 08-09-2025, 21:27.
Working...