Need Basic MQTT Setup Help

I installed the Mosquitto broker and the MQTT integration. I think the installs went okay, other than needing to restart HA after each step.

I’m sure this is an overly basic step but I’m not sure what the next step is. I have a switch I was able to add through ZHA. I can’t find anything on pairing devices through MQTT integration like ZHA has.

Depending on the MQTT device type, you point it at the broker and one of two discovery protocols work instantly. If the device doesn’t support auto-discovery, then you need to read up on JSON payload transformation.

It’s a Lutron Aurora switch.

With ZHA I’m used to just adding a device, putting it in pairing mode, and then it’s in the devices list. I don’t see any options in MQTT.

Does that mean the dimmer switch does not have auto discovery?

Thanks for the help, this is something not too clear on the instructions. They are written as if one is already deeply versed in the protocol. I’m just trying to get my foot in the door.

A couple comments based what you have written about your steps:

  1. Zigbee devices by themselves only have a ‘discovery’ function that works within the Zigbee world you are running it in, either Zigbee2MQTT or ZHA. This ‘discovery’ is very different to the Home Assistant’s device ‘discovery’ function.

  2. The Home Assistant discovery function is dependent on the Zigbee system that you are running, Zigbee2MQTT or ZHA to turn the ‘zigbee discovered’ information about the device into a Home Assistant ‘discovery’ set of information about the device that you can used to create an entity in Home Assistant. So, it is kind of a ‘double discovery’ set of steps.

  3. From my experience with both ZHA and Zigbee2MQTT, the Lutron Aurora switch, if it is the one I am using (the little knob that attached on top of an ‘old school’ wall switch), is supported by both Zigbee systems. And it’s functions should be fully transferred to Home Assistant, if you have the Home Assistant ‘discovery’ feature turned on in your Zigbee system.

  4. As far as I understand, ZHA does not send information from Zigbee devices out to a MQTT broker. Maybe this is a new feature since I quit using ZHA. That said, ZHA translates Zigbee message to and from Zigbee devices with the Home Assistant API and Events channels within Home Assistant, not via MQTT. This is different than Zigbee2MQTT, which uses MQTT and an intermediary system between the Zigbee devices it controls and Home Assistant.

Good hunting!

That sounds like you’re using Zigbee to connect a device to HASS, rather than something like Tasmota firmware and MQTT directly.

So the important protocol is Zigbee:
Aurora --- *Zigbee* --- ZHA --- HASS

Not MQTT:
Tasmota --- *MQTT* --- HASS

ZHA connects directly to HASS (no MQTT), although the alternative Zigbee integration Zigbee2MQTT (Z2M) does use MQTT, it is invisible to the user:
Aurora --- *Zigbee* --- Z2M --- (MQTT) --- HASS

Look at Zigbee pairing, not MQTT.

Sounds like the same one!

I have the Mosquitto broker from the Add-on store and the MQTT integration. Is Zigbee2MQTT a 3rd component? I see it referenced but it doesn’t seem to show anywhere.

MQTT seems to have configured to the broker and automatic discovery seems to be on. But the mqtt page doesn’t seem to have an entities list like other integrations have.

I have a mix of Samsung/Samjin and Hue switches/sensors I’m moving over to HA. I’m keeping the Hue lights on the Hue bridge. I’m wanting to go MQTT as the Lutron dimmer feels crude on ZHA. I’ve been reading MQTT is better.

Last entries from my log:

2024-01-15 14:04:32: Saving in-memory database to /data//mosquitto.db.
2024-01-15 14:04:57: New connection from 172.30.32.2:45576 on port 1883.
2024-01-15 14:04:57: Client <unknown> closed its connection.
2024-01-15 14:06:57: New connection from 172.30.32.2:43462 on port 1883.
2024-01-15 14:06:57: Client <unknown> closed its connection.
2024-01-15 14:08:57: New connection from 172.30.32.2:51776 on port 1883.
2024-01-15 14:08:57: Client <unknown> closed its connection.
2024-01-15 14:10:57: New connection from 172.30.32.2:59172 on port 1883.
2024-01-15 14:10:57: Client <unknown> closed its connection.
2024-01-15 14:12:57: New connection from 172.30.32.2:45402 on port 1883.
2024-01-15 14:12:57: Client <unknown> closed its connection.
2024-01-15 14:14:57: New connection from 172.30.32.2:44650 on port 1883.
2024-01-15 14:14:57: Client <unknown> closed its connection.
2024-01-15 14:15:27: New connection from 172.30.32.1:58065 on port 1883.
2024-01-15 14:15:27: New client connected from 172.30.32.1:58065 as 7IMzlKMDrrYuHza2cILXFW (p2, c1, k60, u'homeassistant').
2024-01-15 14:15:27: Client 7IMzlKMDrrYuHza2cILXFW disconnected.
2024-01-15 14:16:57: New connection from 172.30.32.2:36892 on port 1883.
2024-01-15 14:16:57: Client <unknown> closed its connection.
2024-01-15 14:18:57: New connection from 172.30.32.2:49734 on port 1883.
2024-01-15 14:18:57: Client <unknown> closed its connection.
2024-01-15 14:20:57: New connection from 172.30.32.2:40728 on port 1883.
2024-01-15 14:20:57: Client <unknown> closed its connection.
2024-01-15 14:22:57: New connection from 172.30.32.2:45654 on port 1883.
2024-01-15 14:22:57: Client <unknown> closed its connection.
2024-01-15 14:24:57: New connection from 172.30.32.2:57930 on port 1883.
2024-01-15 14:24:57: Client <unknown> closed its connection.
2024-01-15 14:25:12: New connection from 172.30.32.1:55105 on port 1883.
2024-01-15 14:25:12: New client connected from 172.30.32.1:55105 as 2148Mq0TkgMXgcpTZcGWjy (p2, c1, k60, u'homeassistant').
2024-01-15 14:25:13: Client 2148Mq0TkgMXgcpTZcGWjy disconnected.
2024-01-15 14:26:16: New connection from 172.30.32.1:55827 on port 1883.
2024-01-15 14:26:16: New client connected from 172.30.32.1:55827 as 31L3PoYk8f62y4F62A2wVd (p2, c1, k60, u'homeassistant').
2024-01-15 14:26:57: New connection from 172.30.32.2:43874 on port 1883.
2024-01-15 14:26:57: Client <unknown> closed its connection.

Zigbee2MQTT is another zigbee system. ZHA, Hue, Deconz, Ikea, there are a number of them. Link to Zigbee2MQTT is below. ZHA is a Zigbee system that is specific to Home Assistant, really not used anywhere else extensively that I know of.

Be careful to not mix your terms, if I read your post correctly. Zigbee2MQTT and MQTT are different systems. Zigbee2MQTT does rely on MQTT. But may other systems also use MQTT as a messaging system.

In theory, the fact that ZHA is ‘built in’ to Home Assistant, should make it better. From my experience from using both and many other Zigbee systems, unfortunately ZHA does not have the depth of developer support to make it a 1st class system. Zigbee2MQTT is IHMO the benchmark for open Zigbee systems, Hue is the benchmark for ‘closed’ systems. Both are good systems.

ZHA is ‘easier’ to get going in. And Zigbee2MQTT will require some more work to learn, that is unfortunately the cost of the vastly more extensive Zigbee2MQTT system.

I’m not really groking what you are trying to do with a MQTT broker, again from my experience with ZHA, you do not need MQTT installed in or around your Home Assistant server. For Zigbee2MQTT, yes you will need a MQTT broker somewhere on your local network.

I just happened upon some installation instructions. End goal is nothing more than trying to run the Lutron Aurora on the Z2MQTT blueprint.

I found the correct repo this time and got Zigbee2MQTT installed. I think I’ll be good from here. The above conversations have helped.

1 Like

I think I understand the setup better, but I’ve run into a new issue not being able to start Zigbee2MQTT.

The yaml config for startup seems to be in line with the documentation. The adapter is a SkyConnect and ezsp was listed as the adapter value to use.

Config:

data_path: /config/zigbee2mqtt
socat:
  enabled: false
  master: pty,raw,echo=0,link=/tmp/ttyZ2M,mode=777
  slave: tcp-listen:8485,keepalive,nodelay,reuseaddr,keepidle=1,keepintvl=1,keepcnt=5
  options: "-d -d"
  log: false
mqtt:
  url: mqtt://192.168.1.215:1883
serial:
  adapter: ezsp
  port: /dev/ttyUSB0

Log file:

[22:01:19] INFO: Preparing to start...
[22:01:20] INFO: Socat not enabled
[22:01:25] INFO: Starting Zigbee2MQTT...
Zigbee2MQTT:info  2024-01-15 22:01:34: Logging to console and directory: '/config/zigbee2mqtt/log/2024-01-15.22-01-34' filename: log.txt
Zigbee2MQTT:info  2024-01-15 22:01:35: Starting Zigbee2MQTT version 1.35.1 (commit #unknown)
Zigbee2MQTT:info  2024-01-15 22:01:35: Starting zigbee-herdsman (0.30.0)
Error: Reset error: Error: {"sequence":-1} after 10000ms
    at /app/node_modules/zigbee-herdsman/src/adapter/ezsp/driver/uart.ts:299:23
    at Queue.executeNext (/app/node_modules/zigbee-herdsman/src/utils/queue.ts:32:32)

Are you aware that SkyConnect is currently not a recommended adapter for use with Zigbee2MQTT?

From Zigbee2MQTT’s documentation:

I did see not recommended. Although they do list the settings.

Seems like people spend weeks trying get Zigbee2MQTT to start (or not crash) with the Sonoff adapters before giving up.

I’d probably be better off ditching the Lutron Aurora dimmers for now. They are terrible on Home Assistant with ZHA. I just love how simple their form factor is and that they block the switch.

Other option may be trying to write my own Lutron Aurora script, but I see people struggling getting it working going back some years.

Some of the other dimmers I ported over work great.

FWIW, that’s not been my experience.

I’m using a Sonoff Dongle Plus P (that the original one with the TI chip not the Silicon Labs chip) and Zigbee2MQTT detected it immediately. I upgraded its firmware (because it ships with an outdated version) then paired several devices to it. This was just a few weeks ago and everything has been running fine since then. The only extra thing I did was relocate the adapter to a more central location using a long (16 feet) USB cable. That helped to improve signal strength (between the adapter and the devices that connect directly to it).

It’s the Sonoff Dongle Plus E (uses the same chip as your SkyConnect adapter) that’s currently suggested only for experimental use with Zigbee2MQTT.

It’s looking like I should wait a while for better support. I haven’t noticed if anyone is successfully running Zigbee2MQTT on HA Green with the SkyConnect dongle.

My setup is rather simple enough that I should be okay with ZHA. I’ll just replace the Lutron Aurora switches.