How to Add Zigbee Devices in Home Assistant

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
by the end of this video you'll have a better understanding of what zigbee is you'll know which home assistant zigbee integration is for you and maybe most importantly you'll be able to add your zigbee devices to home assistant so stick around because we're about to automate some boring stuff what's up everyone my name is jeff and this is slacker labs where we look for ways to automate the boring stuff using home assistant and smart home deck once you get home assistant up and running the next step is adding devices and as you already know zigbee is what we're talking about this week but what you might not know is that this video is going to be a little bit longer than my past videos because we have a lot to talk about so grab a beverage and let's get started so what is zigbee chances are if you're here you've already bought some zigbee devices and you're past that point of caring about product intro stuff but i figured why not make this video longer zigbee is a wireless protocol part of the 802 standards governing local area networks the standard was intended to be low power and low latency making it perfect for iot devices the low power means that it was intended to be in line of sight and that can cause some problems but there are zigbee devices that can act as routers to extend that line of sight which brings us to the three zigbee device types the first is the zigbee coordinator which in most cases will be your zigbee interface in the context of this video the coordinator is going to be the device that is directly connected to home assistant then there are devices that are called zigbee routers these are typically devices that have constant power like bulbs or plugs although some of these devices like the singlet led bulbs are not routers and that brings us to the last device type which is end devices these are typically battery powered sensors and they spend a lot of their time sleeping zigbee devices are relatively cheap and there's quite a few options bulbs plugs and sensors oh the zigbee so how do we get these devices in the home assistant well the first requirement is that you need home assistant up and running of course so if for some reason you got to this video and you don't have home assistant up and running you have a couple of options the first order home assistant blue when it arrives plug it into power in the network and turn it on it really is as simple as that i did a video on getting started with home assistant blue that covered migrating to that platform from an existing home assistant platform but that video does cover how to get started just take off once you get to the point of restoring from a backup your second option is to click the amazon affiliate link in the description and order a raspberry pi 4 bundle when it arrives check out my video on trying home assistant while running smartthings while that video was meant to show how easy it is to migrate from smartthings to home assistant a good chunk of that video is just installing home assistant on a raspberry pi 4. follow the steps in that video and once you get logged into home assistant you can bounce and come back here and your third option is there are a ton of guides of getting started with home assistant on all kinds of hardware here on youtube just pick whatever option is right for you and as soon as you get home assistant up and running and you're ready to start adding zigbee devices come back here okay back to integrating zigbee devices with home assistant as i see it you have three integration options if you're currently using a smartthings hub you can just install the smartthings integration in home assistant and be done but in this video we're going to talk about getting our zigbee devices integrated locally and for that we've got two options zigbee to mqtt and zha or zigbee home automation and we're going to cover how to get started with both so let's break them down zigbee to mqtt is the path for anyone who loves zigbee and mqtt and it's definitely more of a diy flavored path but it does have the advantage of separating your zigbee network from home assistant this means when you restart home assistant your zigbee network doesn't go down so as soon as the home assistant ui is back up your zigbee devices are ready to be used one downside to this path though is that you're going to have to flash some hardware and depending on which zigbee coordinator or radio you decide to go with you may have to purchase additional hardware to do that there are some adapters that you can get off the shelf like this sonoff 2531 that i got off of amazon but it does come with an older version of the firmware so you're probably going to want to flash this one anyway another downside is that it requires mqtt which is just another service that you would have to run and maintain and of course there's the development path which might be a concern to you the zigbee to mqtt add-on is not part of home assistant core and the foundation that zigbee to mqtt is built on is not specific to home assistant and while i don't expect it to go anywhere anytime soon i do see how that could be a concern to some the other option is the zigbee home automation or zha that's already built into home assistant this path is ideal for anyone wanting a simpler or less involved getting started process the pro list here is there are no add-ons to install and more support for off-the-shelf usb zigbee radios like this nortec one that has both z-wave and zigbee radios in it the con list is that it takes a moment or two for your devices to become available every time home assistant restarts i'm also not a fan of how it names devices during the ad process which requires me to do a lot more work to get things set up the way i like them but this integration is part of home assistant core and it doesn't require mqtt i don't think those last two give it any special advantage over zigbee to mqtt unless you're someone who just wants to use built-in integrations and limit the amount of services you have running on your home assistant instance in any case i'm going to do a walkthrough of how to get started with both including how to install the integrations all the way to adding devices then at the end we can do a better comparison so let's get started with zigbee to mqtt as i mentioned in the rundown of these options zigbee to mqtt requires mqtt so if you're not already using mqtt in your home assistant instance you'll want to get that up and running before you proceed any further with this section check out my lab notes video on installing mqtt it's less than five minutes and walks you through everything you need to know to get mqtt up and running once you've got that requirement taken care of you're ready to start considering what zigbee coordinator or adapter to get the zigbee to mqtt documentation lists quite a few options here and which one you choose will depend a lot on what type of devices you want to use and the range that you're going to need to cover with your radio the general rule of thumb here is an external antenna is better than none and almost all of these options are going to require some flashing so be prepared to buy additional hardware if needed i've only ever used the 2531 adapter with zigbee to mqtt i got my first one off of aliexpress for i think around five dollars and the cc debugger which is required to flash it i think was another 15 with the required cables it needed recently i bought the sonoff one off of amazon for 16 to see if it would be easier but since it comes with the older firmware it really wasn't all that much easier and since it still ships from china the shipping time was about the same as it was coming from aliexpress i'll toss some links in the description to those pieces of hardware in case you want to pick them up to give you an idea of range that i'm trying to cover here my home is 2600 square feet and my home assistant hub is on the second story probably about in the middle of the house the furthest device is probably 40 feet through multiple walls and if i'm being honest without some zigbee routers in between the radio and some of those in devices at that 40 feet range some of those devices seem to have some connectivity issues from time to time but since i have the 2531 adapter that's what i'm going to use for this guide so let's get to flashing zigbee to mqtt.io has a guide on their site that walks you through this entire step link to it in the description to flash the 2531 you're going to need the cc debugger and a downloader cable purchased at any fine purveyor of techie stuff like amazon or aliexpress if you're someone that enjoys windows then there are some steps here for you i'm a mac guy so i'll just head down here to help compile this flashing software you'll need some programs on your mac i use homebrew which if you're not using homebrew and you have a mac you should be to install homebrew just follow this link then to install the libraries you need to compile this software just copy this brew install line to your command line and run it [Music] once that's done we will grab the actual software used to do the flashy thing copy this git clone line paste it on your command line and hit enter what this does is download the cc tool source code when that's done we'll change the directory to the cctool folder then you'll want to run bootstrap then configure then make when that is done we're ready to get the actual firmware click this link here to download a zip file then we'll extract the contents of the zip file i put both of these files in the same cctool directory just to make things easier now it's time to plug in our hardware make sure you have your 2531 usb stick cc debugger and the downloader cable ready connect the downloader cable to the cc debugger plug the debugger into your usb port on your computer the light will be red at this stage and that's fine then plug the downloader cable into the usb stick once you have a green light on the usb stick press the reset button on the debugger the light should turn green good now plug the usb stick into your computer as well i'm using a usb extension cable here just to make things easier now back on your computer copy this pseudo line and paste it on your command line press enter if all is good the light on your 2531 will go off and your computer will start pushing the software to the device when it's all done the light on the 2531 will turn back on and that's it we've now flashed our 2531 and it's ready for zigbee to mqtt anytime you want to update the firmware on your device just repeat those steps now that we have our coordinator ready we're ready to install the add-on like i said in the beginning the zigbee to mqtt add-on is not part of home assistant core so we're going to have to add a repo to our add-on store to do that we'll need the link to the repo from the installation guide of the add-on i put a link to that guide in the description in that documentation you'll want to grab the url then we're going to go to supervisor then the add-on store click on the three dots in the upper right click repositories paste in the url to the zigbee to mqtt add-on that you copied from the documentation and click add now you should see both the zigbee to mqtt and zigbee to mqtt edge add-ons in most cases you'll want to just use the zigbee to mqtt one if you want to use the beta version use edge but you have a higher likelihood of things not working as expected once you click on the version you want click install once installation is done we're going to need the path of the usb radio go ahead and plug in that usb 2531 into your home assistant instance okay we're going to go back to supervisor this time we click system and we scroll down to the bottom here you can see where i removed and re-added my 2531. grab the address either of these will work this one is probably the better of the two just because it won't change if you move usb devices around and the other might change copy the device address [Music] then back to supervisor click zigbee to mqtt then head over to configuration first let's get our hardware taken care of paste that device address into port i leave permit join as false here and manually turn it on as required if you set up an access control list for mqtt you're going to need to add your credentials to the mqtt setting if i'm adding credentials i always add the server mqtt colon slash ip colon 1883 or 8883 if you're using ssl user and then password but if you're not using an access control list skip that part the default channel is 11. some people find this channel has too much interference from the wi-fi network which also lives in the 802 standards i've used 15 in my house with good results but i suggest leaving this at the default and only changing it if you find later that it might be a problem you can get more details about all of these options on the documentation tab if that is something you're into but we should be good here click save head over to info and click start i would jump into the log just to make sure everything starts [Music] looks good and once that looks good head back to info and flip the show in sidebar which will show this in the um sidebar okay head over to zigbee.mqtt in this sidebar this is where i add my devices to kick that off click this little button at the top to permit joining then put the device you want to pair into pairing mode i'll put this pre-connected bulb into pairing mode using the intuitive turn it on for one second off for two seconds on for one second off for two seconds and after the fourth on off cycle the bulb should flash indicating it's in pairing mode and there it is and as you can see zigbee to mqtt sees the device and has added it on this screen we get address manufacturer model lqi or network strength this can take a moment or two to show up and power will be either illustrated with a plug icon or an icon indicating battery level if you click this device you will get some more options and information most of this you will not need in normal use in fact i usually only come here if i have a device saying it's unavailable but after each device is added i always come to this first screen head to the edit button down here and in the pop-up change the name of the device and click this to update the home assistant entity this will rename the device and entity id and home assistant so now if we jump over to the devices in home assistant and go to that creepole you'll see that the name and entity id have been updated to what we set in the zigbee to mqtt add-on this is the best way to update the name but it's not the only way for example if you add a device as soon as you see it in the zigbee to mqtt page you can jump over to devices and find it there but the device name will be whatever the address was you can click on that device and go to the gear in the upper right and for name enter well the name for area i put which room it's in if you haven't set up areas i would ignore that part then click update now the biggest issue i have with doing it from here is that it doesn't always update the entity id and while if you do everything from the ui that won't be an issue as long as the friendly name is descriptive i still do quite a bit in the yaml though and this lite.0xc i'm not going to remember this needs to get renamed so automator's choice on the path here now just continue adding all of your zigbee devices until you get everything you want paired but what if you want to use the zigbee home automation integration instead [Music] if you want to go with the built-in zigbee integration things are a bit simpler like zigbee to mqtt you're going to need a zigbee coordinator and the ones that work with zigbee to mqtt may not work with zha this north tech one works pretty well and it was only 49 on amazon which is a pretty good value if you consider that this has both zigbee and z-wave radios in it if you think range or line of sight is going to be an issue you can always go with something like this sonoff zigbee wireless bridge which communicates over wi-fi so it doesn't have to be connected directly to your home assistant instance i got mine for about 30 off of amazon this sonar one is going to require flashing though and i don't plan on covering it in this video i mean this video is already going to be long enough as it is but if you want to go the sonoff wireless bridge route lewis over at everything smart home has a great tutorial on how to get this flashed and connected to home assistant in any case if you want any of those devices or the tutorial links description you know the drill for this tutorial though i'm going to use this nortec usb coordinator go ahead and plug the nortec stick into your home assistant instance again i like to use an extension cable if possible because this is a radio and it allows me to move it around a lesson potential interference then we're going to head over to configuration next integrations and click add integration here we're going to search for zha once found click it here we need to choose the radio this north tech stick will give you two radios usb 0 is the z-wave radio so we want usb 1. select it and click submit if all works well you'll get a easy sp and a coordinator click finish and now we can start adding devices click on the two devices link then click add device to put the coordinator into pairing mode then put your devices into pairing mode as they show up i change the name and the area rinse and repeat until all your devices are done the problems i have with this integration all come after adding the device let's flip over to devices so i can show you what i mean i renamed this singlet bulb to front door lamp after pairing in zha but if we click on the entity you can see it still retains the name it got when i paired it now you can go up and click the cog and enter the new name and area there but this doesn't always update the entity name the only way i found to rename this entity for sure is by coming into each entity and updating it i'm not sure why this doesn't respect the name change and it could be something i am doing but it is one of the things i don't like about the built-in integration after a while the zigbee coordinator will drop out of pairing mode and you'll have to click this search again to get it going again this can be kind of a pain if you have a lot of devices so it's better just to be walking around with your laptop or on your phone as you're adding your devices [Music] now that we've covered how to get started with the integrations let's talk about which one is for you i have 20 or so zigbee devices in my home most of them are led bulbs and aqua sensors i put amazon affiliate links to all of those zigbee devices in the description in case you want to see which devices i have and get an idea of which devices work with these integrations and of course if you use those links it helps out this channel at no additional cost to you which of course i appreciate okay enough plugging my links for both of these getting started is relatively simple but i think zha has the edge here because it's fewer steps and less moving pieces to worry about and of course more options if you want to avoid flashing in normal automation of devices and interacting with these lights and sensors i saw absolutely no difference between the two integrations in my home although the nortec radio is clearly stronger than the 2531 both integrations are fast and responsive this may change as your network grows so if you've used both of these integrations and noticed something different that i didn't cover let us know in the comments both appear to support a lot of devices with more being added both of these integrations auto-create the devices and entities so no manual steps in having to add a device zha has the better adding device workflow especially in appearance and you can add your devices to areas at the time that you create them but the fact that the renaming doesn't always work causing you to have to do more work after the devices are added and the constantly having to put the coordinator back into pairing mode caused me some heartburn the zigbee to mqtt adding process is not as pretty as zha but you can update the name and the entity id without ever having to leave the add-on plus pairing mode is on until you turn it off but if you want to put your devices in areas then you're going to have to add a step after your devices are added and do that from the device panel both of these integrations supported all of the devices i currently use which is not extensive but i think i do have a good mix of manufacturers and types zigbee to mqtt gets a leg up because its network doesn't go down every time home assistant restarts and i think that the zigbee to mqtt is a bit more stable at least it has been in my experience i've run zha using both the nortec stick and the sonoff wireless bridge that i flashed with test moda and while the range of those coordinators is better simply because they have stronger radios i did find that i had a lot of stability issues using both of them whether that was interference or something else i had a lot of devices that would go unavailable and require me to repair them and the sonoff bridge just got unresponsive all together at times which caused my automations to be delayed so for me i prefer zigbee to mqtt but the reality here is that both work i think your experience will be based largely on what types of devices you have and how big your network needs to be for example i've read that the aqua devices don't play well with others and in fact that hatred is so bad at times that they won't even work if some of those devices they don't like are just on the network i haven't had that experience with my aqua devices but just be aware and of course i'll put links to some of the discussions that talk about that in the description in case you want to get more information i think the biggest potential issue with these options is that it's not easy to move between them although moving from zha to zigbee to mqtt is much easier in fact the times that i have done that and yes times here is plural i'm a glutton for punishment i did most of the repairing without touching a device removing a device in zha puts the device in pairing mode especially for those that are with constant power which makes it super easy to add them into another integration moving from zigbee to mqtt to zha required me to delete all the devices and then go around and put all of those devices into pairing mode which for some of those bulbs is a pain okay we've covered a lot hopefully this gave you enough information so that you could get started with your zigbee journey in home assistant if you made it this far let me know which path you chose in the comments and thanks for sticking with me until the end before you go if you're looking for ideas on how to make your home smarter using home assistant check out some of my other videos and whether you're a repeat viewer or here for the first time thanks for taking time out of your home automation projects to watch mine until next time go automate the boring [Music] stuff you
Info
Channel: SlackerLabs
Views: 13,530
Rating: 4.9290781 out of 5
Keywords: home assistant, smart home, home automation, raspberry pi, lovelace, hassio, yaml, mqtt, scripts, home assistant basics, home assistant for beginners, home assistant guide, home automation ideas, home assistant tutorial, home assistant beginner's guide, smart home ideas, beginner's guide, home assistant scripts, zigbee, zha, zigbee home automation, zigbee2mqtt, flash cc2531, nortek security and control, zigbee devices, zigbee smart home hub, home assistant setup
Id: 54dBklrZEJk
Channel Id: undefined
Length: 25min 2sec (1502 seconds)
Published: Wed Mar 03 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.