What does Mosquitto MQTT bring to the Zigbee2MQQT Party?

OK, so I’ve got it working - yay! That is installing a Sonoff Zigbee USB 3 plus dongle. Some things I learnt, and one question:

What I learnt , which hopefully will come up in searches for others stuck.

  • DS220+ “saw” my Sonoff as did HA, and ZHA would auto install and detect it, but it would not configure, untill I took it off a passive hub and plugged it in direct. That caused some head scratching till I figured it out! Config of ZHA just failed to “error”
  • Installed Zigbee2MQTT and could nto get it to launch until two key things happened - 1) I realised the gui config has three sections and I was putting /dev/ttyUSB0 in the “MQTT” Box. Moved it to the “Serial” box and bingo - but then it said it could not find /dev/ttyusb0 and realised its case sensitive!
  • I work day to day with MPPT solar controllers so keep bloody typing MQQT instead of MQTT which causes no end of trouble!

Anyhow - got it all working. I have Mosquitto mqqt broker running as I installed it for another reason (to get remove PC-shutdown working) so already have an mqtt user and password, so, followed the youtube vid I was watching and pumped the output of Zigbee2mqtt through to Mosquitto mqtt and it works fine.

So now I have zigbee2mqtt running, and I can create cards for all the sensors etc.
I also have mosquitto mqqt running and I can again create cards from it, albeing neater and easier to do.

Are they both mqtt brokers? if so, why am I pumping zigbeemqtt into mosquitto - seems like duplication? Or is zigbee2mqtt just a zigbee manager that needs a seperate broker to talk to? but if that’s the case, why can I create cards direct from zigbee2mqtt? it makes mosquitto feel like an extra unnecessary layer in this instance?

I think I’m missing oms obviouse understanding here.

ZigBee2mqtt can’t talk directly to HA. It can only talk to MQTT. HA can talk to MQTT too. This completes the chain of communication.

I’m not sure why you appear to see devices in two ways.

ZigBee2mqtt is the coordinator only, so it needs a seperate MQTT broker…so there is no duplication, you could run Zigbee2mqtt on a completely different server/hardware and it would still speak via MQTT to Home Assistant.

I have no idea what this means.

It seems that you are saying that you have two sets of sensors/switches etc in HA for each device?

MQTT doesn’t (shouldn’t…) provide any sensors etc directly for the device.

The MQTT integration just provides a way for HA to talk to the MQTT broker. It makes HA client in the MQTT network.

Zigbee2mqtt just provides a way for your devices to talk to the MQTT broker. it make zigbee2mqtt to be a client in the MQTT network. it coordinates the device communications to the MQTT broker.

the MQTT broker is just the go between/link that allows all of the various MQTT based data to be transmitted between the various MQTT clients (HA, zigbee2mqtt, etc) via publish and subscribe configurations.

Mosquitto (aka the MQTT broker) is THE essential piece of software that allows everything to work together. If you remove it no MQTT stuff will work at all.

Thank you all. Makes sense now.

I think I got overwhelmed last night after following tutorial after tutorial and got my head in a mix.