Install Zigbee2MQTT, Setup in 10 Minutes
Вставка
- Опубліковано 8 лип 2024
- Welcome to our quick and easy guide on how to install Zigbee2MQTT on Home Assistant in just 10 minutes! This video will walk you through the process step-by-step, ensuring you can get your smart home up and running in no time.
In this video, we’ll be using the Sonoff 3.0 ZB Dongle Plus E and a Sonoff Human Presence Sensor to demonstrate the setup process. These devices are known for their reliability and versatility, making them great choices for your smart home.
We’ll also be comparing Zigbee Home Automation (ZHA) and Zigbee2MQTT. Both are powerful tools for integrating Zigbee devices with Home Assistant, but they each have their own strengths and weaknesses. We’ll help you understand these differences so you can choose the best option for your needs.
So, whether you’re a seasoned smart home enthusiast or just getting started, this video is for you. Let’s dive in and get your Home Assistant powered by Zigbee2MQTT!
Stay tuned, and let’s make our homes smarter together! 👍
🙏 If you would like to support me and this channel, you can JOIN and SUBSCRIBE 🙏
Join - urlday.cc/ty4oo
Subscribe - urlday.cc/njm5y
#sonoff #zigbee #usb
___ ☕ Buy Me A Coffee! ☕ __
PayPal Coffee - urlday.cc/0hrs0
Buy Me A Coffee - www.buymeacoffee.com/smarthom...
__ 🕒📩 Timestamp 🕒📩 __
00:00 - Introduction
02:17 - Installation
02:45 - Mosquitto Broker
03:14 - MQTT Installation
03:53 - Zigbee2MQTT Installation
05:10 - Zigbee Coordinator Installation
07:20 - Testing with Presence Sensor
08:24 - Installation onto a Dashboard
08:45 - Roundup
__ 👋 Handy Dandy Information 👋 __
ZHA Supported devices - urlday.cc/2iuxw
Zigbee 2 MQTT Supported devices - urlday.cc/zs8ot
MQTT Installation - urlday.cc/a8jor
Zigbee2MQTT Repository - github.com/zigbee2mqtt/hassio...
Zigbee2MQTT Fails to start - urlday.cc/w9gbz
Connecting a USB to your Virtual Machine - urlday.cc/95kti
Sonoff discount, *SMARTHOMEAUS*, has now been increased to 15% on ALL products!!
ZB Dongle-E - urlday.cc/jjb33
Zigbee Bridge Ultra - urlday.cc/zca9m
ZBMicro - urlday.cc/i5fmd
SNZB-01P - Zigbee Wireless Switch - urlday.cc/5o8k6
SNZB-02P - Zigbee Temp and Humidity Sensor - urlday.cc/ss33w
SNZB-02D - Zigbee Temp and Humidity Display - urlday.cc/qq1ez
SNZB-03P - PIR Motion Sensor - urlday.cc/86w5y
SNZB-04P - Door Contact Sensor - urlday.cc/j8ifs
SNZB-06P - Zigbee Human Presence Sensor - urlday.cc/4uy62
Bridges / Coordinators and Dongles
Sonoff iHOST Bridge - urlday.cc/0vdcq
Zigbee 3.0 USB Dongle P Plus - urlday.cc/3bcqj
NSPanel Pro - urlday.cc/fvf1b
__ MQTT Settings__
Broker - core-mosquitto
__ Zigbee2MQTT Configuration__
mqtt:
server: mqtt://core-mosquitto:1883
user: mqtt_user
password: mqtt_password
serial:
port: {INSERT YOUR ABSOLUTE ADDRESS IN HERE}
adapter: ezsp
Product Scripts are uploaded by the members area of Buy Me a Coffee if you'd like to review.
__ 🔗 Affiliate Links 🔗 __
NordVPN (Get 72% off NordVPN + a Saily eSIM data gift) - go.nordvpn.net/SH8jJ
Sonoff discount, *SMARTHOMEAUS*, has now been increased to 15% on ALL products!!
ZB Dongle-E - urlday.cc/jjb33
Zigbee Bridge Ultra - urlday.cc/zca9m
ZBMicro - urlday.cc/i5fmd
SNZB-01P - Zigbee Wireless Switch - urlday.cc/5o8k6
SNZB-02P - Zigbee Temp and Humidity Sensor - urlday.cc/ss33w
SNZB-02D - Zigbee Temp and Humidity Display - urlday.cc/qq1ez
SNZB-03P - PIR Motion Sensor - urlday.cc/86w5y
SNZB-04P - Door Contact Sensor - urlday.cc/j8ifs
SNZB-06P - Zigbee Human Presence Sensor - urlday.cc/4uy62
SwitchBot Lineup
International - urlday.cc/ssk8c (includes 30% OFF for all products for a limited time)
Home Assistant Server (HP EliteDesk 800 G4)
US - amzn.to/3DcEjG8
AU - amzn.to/44hsyZW
Raspberry Pi 4 B 8GB (Full kit: inc. Power Supply, case, Micro SD, heat sink etc.)
Ali-Express - s.click.aliexpress.com/e/_Dm3...
Meross Smart Garage Door Opener Remote
US - amzn.to/45tLPIQ
International - s.click.aliexpress.com/e/_DF9...
Aeotec Z-Stick Gen5 Plus Z-wave USB Hub
US- amzn.to/3ro41om
AU - amzn.to/3E5kQYj
Aqara FP1 Human Presence Sensor
US - amzn.to/3pIWRKZ
International - s.click.aliexpress.com/e/_DBx...
The site receives a small commission if you order from any of the links above. This does not cost you anything and is paid by the supplier. - Навчання та стиль
Your tutorial was the most concisous and precise that I found, thank for sharing, help me a lot.
You're welcome. I hope you got up and running super quick. BTW are you running the Sonoff ZBDongle or another manufacturer?
@smart_home_australia Yes, it's a Sonoff dongle. I just followed the configuration as you did and worked perfectly, I tested it with a Sonoff ZBmini extreme.
Your guides are so substantive that they are the only ones I need to watch in slow motion! Very good job!
hi @villarudera452 , Glad you like them! They do take abit of time to put together but I remember when I was starting out and how confusing Home Assistant seemed. In the videos I try and give you want you need to get a specific feature up and running, and without too much fluff, so that you get a specific outcome but also learn the concept so you can deploy elsewhere in your Smart Home.
@@smart_home_australia fluff level = 0 👌
@@smart_home_australiaUsing link shorteners in the description wasn't a great idea. Just a few months have passed and none of them work anymore.
This was so helpful! I was missing the adapter line and ran around it for a million years before finding this video. Thank you
Thanks @laviniaracovita3758, yes that pesky adapter line is so often missed in setups, so glad you managed to get everything up and running. Are you running just Z2MQTT or dual adaptors with ZHA?
Great video! Exactly what I was looking for! Thank you!!!
Glad it was of help. Check out the up and coming multi Z2MQTT video that allow you to run 6 discrete Z2MQTT networks.
Glad it was helpful!
You absolute legend!
Thanks @Eurisko__78, you are most welcome.
this video deserve way more views
Thanks. 🙏
I’m going to be updating this shortly to improve on the video and audio quality.
You are the top one, thank you so much!
Glad it helped!
thx you!🙂
You're welcome! I'm glad it helped.
Thx. As regards the use or both zha and z2m, i guess we should use different chanels ... Which ones and what is the best way to avoid interference between the two networks ?
Thanks @theattorney6072, thanks and what a great question. In my experience Zigbee is very good at differentiating between traffic and you should not have much of an issue. That said, never say never.
Check out shorturl.ac/7cesk, for how to change the channel on ZHA (introduced in 2023.06). To change the channel in Zigbee2MQTT, check out shorturl.ac/7cesl. An if you need to analyse the channels for congestion, check out shorturl.ac/7cesm.
Hopefully that should put your mind at rest.
Thanks for the video. Looking at running parallel, my understanding is you are required to flash new firmware for the Sonoff dongle?
When you say running in parallel, do you mean ZHA and Zigbee2MQTT? Is so then not as far as I’m aware. I run a deConz for ZHA and Sonoff for my Z2MQTT, no flashing required.
Yes that is correct. I'm using a ZigBee 3 Dongle P version for zha. The label has eeMQTT printed on the box so I may be good to go buying another one for Zigbee2MQTT. I run VB on a mini PC so that might be a challenge to punch through the USB to the dongle.
Hi @drumslapper, you should be fine. I run HA within a VM running on VB and have 3 dongles attached and patched to the VM. No issues. Good luck and let us know how you go.
Thank you for this - great tutorial.
Would have loved to see how you setup Zigbee2mqtt in parallel with ZHA. I am running ZHA, but i am afraid to mess up my existing network. So should you run Z2M on a separate channel, and if so, how do you force Z2M to go to channel 25 for instance, during the setup?
You shouldn’t have an issue. In Z2MQTT go to SETTINGS > ADVANCED and set your channel. Since ZHA defaults to channel 15 and Z2MQTT to channel 20 there should be no issue.
@@smart_home_australia Thank you for the grear video, I'm using SNZB-06P as well but it always shows Occupied even when I'm in another rooms for hours. Do I have to tweak some settings in Z2M?
@@fabiocopani8311 I run mine of low occupancy sensitivity as they are so sensitive they literally see through stud walls !! This is a standard control when installing through Z2MQTT. When set this this my occupancy does go to clear. If yours' still does not then make sure the firmware is up to date and reinstall through Z2MQTT. Outside of that its a tech support question with Sonoff.
Hi, great videos!
I'm wondering if someone could help me identifying the information for the serial port and adapter in the HA yellow as I'm not using a dongle but the built in zigbee that the yellow already has.
Tks in advance!
Sure. Check out the following link. community.home-assistant.io/t/how-to-configure-built-in-zigbee-radio-home-assitant-yellow/569029?ssp=1&darkschemeovr=1&setlang=en-AU&safesearch=moderate
Many thx and keep up the great work in your channel!
@@smart_home_australia
Thanks @vascovpt, for your support.
I have read that the dongle P would be more stable than dongle E for Z2M. Indeed, Dongle E is still considered as experimental on Z2M website. What do you think of the above ?
Hi again @theattorney6072, yes this specific dongle is classified as "experimental" but if you read on it also mentions that this is the future of Zigbee dongles. It's been around for some time now and I'm surprised its still got that its got that classification, that said I have NOT had any issues with this dongle, in fact it has stellar range and is quick. I use it for my Z2MQTT but if I was following a more cautious rounte then I should probably switch it to my ZHA (which is fully supported) and use my deconz for Z2MQTT.
But THANK YOU ofr raising this point.
I now use ZHA with mostly Aquara devices with no problems. But I’ve only been running for 3 months.
Should I switch now?
Hi @johnscott8271, my advice would be to stick with ZHA at least for the moment and explore the other facets of Home Assistant, work through my Home Assistant playlist and refine your setup. Them once you are comfortable with how Home Assistant works buy another adaptor, checkout the deals on the Zonoff ZB Dongle I put in the links with the discount codes) and try in parallel and see which you prefer. Zigbee2MQTT offers alot of advantages but also has some quirks that make it not as user friendly. I hope that helps.
Awesome and easy to follow video. Been using ZHA since I started HA a year ago and am now ready to add Z2M in parallel to get the best of both worlds. What pushed me over the edge is the limited support for the Philips Hue Tap dial in ZHA.
Have the same Sonoff coordinator and followed the tutorial to the tee (I hope) but it fails on a MQTT authorization error. No specifics. If I refresh Zigbee2MQTT is see a 502 Bad Gateway error. Have copied the user name and passwords between all three pieces - MQTT User, MQTT and Zigbee2MQTT but to no avail. Any permissions I might have missed or anything change of subsequent release? I'm currently on 2024.4.2
502 is an error that occurs a lot until you get everything setup correctly and there are a few different reasons that can cause this. Here are a few official reasons:
MQTT Broker Issues: The MQTT broker might not be running correctly. Ensure that the MQTT broker is properly installed and configured.
Zigbee Dongle Issues: The Zigbee dongle might not be correctly recognized by the system. Check if the dongle is properly connected and the correct port is specified in the Zigbee2MQTT configuration.
Configuration Issues: Incorrect settings in the Zigbee2MQTT configuration can also lead to this error. Make sure that the configuration.yaml file of Zigbee2MQTT is correctly set up.
However, one thing that alot of people forget is that you need to define the adapter (set in the configuration of the Add-on), cehck out the documentation, bit.ly/4aRVw6f, for instance I run a Sonoff adapter (amazing adapter, I'd highly recommend picking one up from the affiliate links) and you need to insert the addition line in the SERIAL section of the configuration for "adapter: ezsp", no quotes.
Hopefully that helps :)
Thank you for the excellent detailed instructions. i ran into a problem with the configuration. I get this message: Failed to save add-on configuration, Missing option 'mqtt' in root in Zigbee2MQTT (45df7312_zigbee2mqtt) Can you tell me how to fix this please?
Thanks for your kind words.
Your error relates to probably a mis-spelling or missing space in the MQTT section in the Zigbee2MQTT configuration.
1) SETTINGS
2) Add-Ons
3) Search for and Select Zigbee2MQTT
4) Configuration
5) MQTT section
6) Verify Configuration
Typical Configuration
server: mqtt://core-mosquitto:1883
user: mqtt_your_username
password: mqtt_your_password
Make sure you have spaces after the colons.
I hope that helps.
@@smart_home_australia Thank you for your prompt reply. Much appreciated.
I'm still getting the bad gateway message, and I tried to access the link you put in the description but none of them are working for me. Maybe it's because I'm on mobile... Thanks for the video though, I saw some very important steps I was missing
502 gateway? check out this thread community.home-assistant.io/t/zigbee2mqtt-502-bad-gateway-solved/447571/12
Although in my experience its hardware related. Recheck your Zigbee2MQTT config for SERIAL, I use the absolute reference and make sure the adaptor is referenced correctly:
port: >-
/dev/serial/by-id/usb-ITEAD_SONOFF_Zigbee_3.0_USB_Dongle_Plus_V2_XXXXX
adapter: ezsp
As opposed to the relative address of
/dev/ttyACM0
I hope that helps.
Thank you for the video, it is verry clear and easy to understand!
i followed all the steps but ceep running into to same error.
Zigbee2MQTT:error 2024-02-16 18:23:43: Error while starting zigbee-herdsman
Zigbee2MQTT:error 2024-02-16 18:23:43: Failed to start zigbee
I have changed the port and adapter, but no succes.
Could you (ore someone els) help me out on this one?
Make sure your coordinator is recognised in the hardware section. And that the path is correct in the yaml.
Check the z2mqtt to see if you need to specifically mention your type of coordinator. Ie. deconz need to be mentioned in the yaml.
Make sure your firmware on your usb dongle is up to date.
Check these and you should be fine.
@@smart_home_australia Thank you for the quick respons! i flashed my dongle and now it works. Thanks again i hope to see more of your videos in the futere.
I have core -2024.4.4 and there is no user option in people
Sorry looks like you are going to be out of luck. Check out www.home-assistant.io/installation/, you don't have supervisor, or add-ons. Which is a long way of saying you can't run Z2MQTT as you need Add-ons and integrations. sorry.
Zigbee2MQTT:error 2024-02-17 12:06:57: MQTT error: Connection refused: Not authorized
Zigbee2MQTT:error 2024-02-17 12:06:57: MQTT failed to connect, exiting...
A little light on details and context there :)
You could check:
1) Credentials: Ensure that the username and password provided in the MQTT connect method are correct.
2) Authorization: Check if the MQTT client has the necessary permissions to connect to the MQTT broker.
3) Configuration: If you’re using Mosquitto, you might need to edit the Mosquitto configuration file to allow anonymous connections.
I dont have any " Addons" ?
That means that you are not running an installation of Home Assistant that supports Add-Ons. Check www.home-assistant.io/installation/#advanced-installation-methods, this shows you the installations that do support Add-Ons. What platform are you running on?
@@smart_home_australia Thanks for your answer. Yeah, I spent some time looking around. I'm not the only one with this issue; some have asked for it to be added.
I'm not running the OS, and that's why it's missing. I'm running an MQTT broker and HA in Docker on Synology. It's a first step to test things with no commitment, as I'm able to roll back if something goes wrong. I have Fibaro HC2, HC2Light, and now HC3 that support Zigbee (to some extent) and opened my eyes to Zigbee as being able to meter my house. But with lots of hit and miss on the devices, some work only on HC3 (Zigbee) and not on HA, and some don't work at all. I'm able to move all my Fibaro HC3 using MQTT to HA, so I'm running both systems, and both systems work. So I'm able to turn on a light with any of them.
I will add Zigbee2MQTT in Docker and run it that way to see what it brings. For now, all Z-Wave and other things run just fine, and my HC3 handles it all. But I have taken the first step in the door to leave Fibaro, as their fans are toxic and close-minded. There are no real good power meters as Z-Wave and no real support, so why not enjoy Zigbee, which is more friendly and has better exchange of ideas?
I previously ran HA on Synology, and had a great experience, but as my needs expended I found that I needed more power so I moved over to a VM on my Lab Server. It sounds like you have the solution for your Zigbee issue with Docker, which should work perfectly.
As for Fibaro, I have no experience with that eco-system, but what you describe is typical for such environments. Regardless, WELCOME to the Home Assistant club :)
502: Bad Gateway ???
There are afew reasons you get this error message from outdated firmware, to USB path incorrect or if using VM then the dongle not mapped through to the Home Assistant instance.
Check this thread for other issues you should make sure you have confirmed are working shorturl.ac/7d3gu
Not work for me...............this is the error:
20:40:51] INFO: Preparing to start...
[20:40:52] INFO: Socat not enabled
[20:40:53] INFO: Starting Zigbee2MQTT...
[2024-05-14 20:40:59] info: z2m: Logging to console, file (filename: log.log)
[2024-05-14 20:40:59] info: z2m: Starting Zigbee2MQTT version 1.37.1 (commit #unknown)
[2024-05-14 20:40:59] info: z2m: Starting zigbee-herdsman (0.46.6)
[2024-05-14 20:40:59] info: zh:ember: ======== Ember Adapter Starting ========
[2024-05-14 20:40:59] info: zh:ember:ezsp: ======== EZSP starting ========
[2024-05-14 20:40:59] info: zh:ember:uart:ash: ======== ASH NCP reset ========
[2024-05-14 20:40:59] info: zh:ember:uart:ash: RTS/CTS config is off, enabling software flow control.
[2024-05-14 20:40:59] info: zh:ember:uart:ash: Serial port opened
[2024-05-14 20:40:59] info: zh:ember:uart:ash: ======== ASH starting ========
[2024-05-14 20:41:02] info: zh:ember:uart:ash: ======== ASH NCP reset ========
[2024-05-14 20:41:02] info: zh:ember:uart:ash: ======== ASH starting ========
[2024-05-14 20:41:04] info: zh:ember:uart:ash: ======== ASH NCP reset ========
[2024-05-14 20:41:04] info: zh:ember:uart:ash: ======== ASH starting ========
[2024-05-14 20:41:07] info: zh:ember:uart:ash: ======== ASH NCP reset ========
[2024-05-14 20:41:07] info: zh:ember:uart:ash: ======== ASH starting ========
[2024-05-14 20:41:09] info: zh:ember:uart:ash: ======== ASH NCP reset ========
[2024-05-14 20:41:09] info: zh:ember:uart:ash: ======== ASH starting ========
[2024-05-14 20:41:12] error: z2m: Error while starting zigbee-herdsman
[2024-05-14 20:41:12] error: z2m: Failed to start zigbee
[2024-05-14 20:41:12] error: z2m: Check www.zigbee2mqtt.io/guide/installation/20_zigbee2mqtt-fails-to-start.html for possible solutions
[2024-05-14 20:41:12] error: z2m: Exiting...
[2024-05-14 20:41:12] error: z2m: Error: Failed to start EZSP layer with status=HOST_FATAL_ERROR.
at EmberAdapter.initEzsp (/app/node_modules/zigbee-herdsman/src/adapter/ember/adapter/emberAdapter.ts:780:19)
at EmberAdapter.start (/app/node_modules/zigbee-herdsman/src/adapter/ember/adapter/emberAdapter.ts:2642:24)
at Controller.start (/app/node_modules/zigbee-herdsman/src/controller/controller.ts:124:29)
at Zigbee.start (/app/lib/zigbee.ts:62:27)
at Controller.start (/app/lib/controller.ts:109:27)
at start (/app/index.js:107:5)
What adapter are you using and what configuration? Can you copy the yaml here (minus password) so I can check it.
Sonoff Zigbee_3.0 USB Dongle Plus
@@smart_home_australia homeassistant: true
advanced:
network_key:
- 126
- 208
- 34
- 100
- 83
- 27
- 112
- 74
- 96
- 77
- 58
- 66
- 180
- 190
- 179
- 44
pan_id: 63322
ext_pan_id:
- 242
- 147
- 193
- 230
- 184
- 229
- 244
- 162
mqtt:
server: mqtt://core-mosquitto:1883
user: @@@@@
password: @@@@
serial:
port: >-
/dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_56894d91b719ec11a2dc7fe5f01c6278-if00-port0
adapter: ember
frontend:
port: 8099
homeassistant: true
advanced:
network_key:
- 126
- 208
- 34
- 100
- 83
- 27
- 112
- 74
- 96
- 77
- 58
- 66
- 180
- 190
- 179
- 44
pan_id: 63322
ext_pan_id:
- 242
- 147
- 193
- 230
- 184
- 229
- 244
- 162
mqtt:
server: mqtt://core-mosquitto:1883
user: @@@@@
password: @@@@
serial:
port: >-
/dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_56894d91b719ec11a2dc7fe5f01c6278-if00-port0
adapter: ember
frontend:
port: 8099
The error message "Failed to start EZSP layer with status=HOST_FATAL_ERROR" indicates a critical issue with the EZSP (EmberZNet Serial Protocol) layer, which is used for communication with Zigbee devices. This error can occur due to various reasons, such as firmware issues, hardware incompatibility, or configuration problems.
I found some further related topics at github.com/Koenkk/zigbee2mqtt/issues/22469
It suggests if you have trouble starting Z2M:
- make sure you are using the proper firmware, proper baudrate, and corresponding baudrate in Z2M configuration.
- unplug the adapter for 30+ seconds, then plug it back in and start Z2M again
- re-flash the same firmware
I hope that helps.