In this article, I will be comparing two of the most popular open-source Zigbee gateways: Zigbee2MQTT and ZHA (Zigbee Home Automation). Just like Home Assistant, ZHA uses an open-source Python library, while Zigbee2MQTT is written in JavaScript/TypeScript. Both applications are used for the same purpose, but their setup and integration with Home Assistant differ greatly.

Various large brands and manufacturers are now making and/or selling Zigbee devices like light bulbs, switches and sensors. For example: IKEA Tradfri, Philips Hue, Xiaomi / Agara, Trust, Heiman, OSRAM, LEDVANCE, Lutron, Legrand Netatmo, SALUS/Computime, Sengled, Schneider Wiser, Tuya, etc..

Zigbee2MQTT

Allows you to use your Zigbee devices without the vendor's bridge or gateway.

It bridges events and allows you to control your Zigbee devices via MQTT. In this way you can integrate your Zigbee devices with whatever smart home infrastructure you are using.

 

Zigbee2MQTT Architecture

z2m-architecture-1.png

Installing Home Assistant  on Raspberry Pi(debian 11 os)

Installing MQTT on Raspberry Pi(debian 11 os)

Installing Zigbee2MQTT  on Zigbee adapter ( SONOFF Zigbee 3.0 USB Dongle Plus)

MQTT broker-1.png

MQTT broker: MQTT is another smart home protocol that pretty much all tools in this space understand.

Zigbee2MQTT Zigbee adapter : This (also open source) software connects your Zigbee network on the one hand (via the Zigbee USB stick) to your MQTT broker;

on the other hand thus bridging the divide between Zigbee and LAN/Wifi.

 

Zigbee2MQTT  on Zigbee adapter ( SONOFF Zigbee 3.0 USB Dongle Plus) need a so called MQTT broker that will store and forward messages from devices. 

 

 

Home Assistant will subscribe to this broker to receive updates from the devices and send messages to them via the broker.

 

 

source:https://github.com/koenkk/zigbee2mqtt

解释一下MQTT在Home Assistant中的作用。小米空气监测器监测各项空气指标,将数据传输到米家的一个”云平台”之中,手机客户端app连接到这个”云平台”,去读取小米空气监测器上传的数据。

在Home Assistant的前端页面上看到温湿度数值。那么,也需要这么一个”云平台”,肩负起局域网中在温湿度测量仪和Home Assistant间传输数据的职责。而这个局域网中的”云平台”,就是我们基于MQTT协议搭建的MQTT服务。

 

MQTT协议对我们是透明的,用户并不需要知道其内部机理。我们所需要做的,只是按照固定的格式发布或订阅消息即可。

(Note:当然,放到以前的话,温湿度测量仪也可以直接通过Home Assistant的API与之交互。但是这种实现方式耦合性太强,已经被官方遗弃。)

在Linux系统中安装MQTT服务很简单,只需要按照以下步骤即可。

 

Mosquitto是基于MQTT协议实现的一个Broker,也是最常用的Broker。Broker在MQTT中就相当于一个服务端,负责客户端消息的订阅和发布。Mosquitto的安装执行以下命令即可

sudo apt-get install mosquitto mosquitto-clients

 

 

https://zigbee.blakadder.com/iobroker.html

 

hardware - Zigbee adapter

 

Run Zigbee2MQTT on a adapter which with have a chip starting with CC2652 or CC1352

 

One or more Zigbee Devices which will be paired with Zigbee2MQTT.

 

 

SONOFF Zigbee Gateway

http://localhost:4999/boards/topic/5300/real-worlddiy-sonoff-zigbee-gateway

 

 

Look for a USB or ethernet device to prevent issues. Zigbee mesh will not require a central location for your Controller

SONOFF Zigbee 3.0 USB Dongle Plus Gateway

SONOFF Zigbee 3.0 USB Dongle Plus Gateway-1.jpg

Base on TI CC2652P + CP2102N

200 children

 

where to buy?

https://www.amazon.com/SONOFF-Gateway-Universal-Assistant-Wireless/dp/B09KXTCMSC/ref=psdc_172504_t1_B01GJ826F8

Price:$35.99

 

ZBDongle-P-Vs-ZBDongle-E.jpg

source:https://itead.cc/product/sonoff-zigbee-3-0-usb-dongle-plus/ref/3/

 

zigbee Devices by Gateways

Zigbee Home Automation
Tasmota
Zigbee2MQTT
deCONZ
Zigbee for Domoticz
ioBroker.zigbee

 

 

https://zhuanlan.zhihu.com/p/625961502?

https://github.com/koenkk/zigbee2mqtt

Comments


Comments are closed