Set up Zigbee in Home Assistant - Using ZHA to ditch your 3rd party hubs

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
today's video i'm going to show you how to replace this a proprietary zigbee dongle that sends your data all the way into the cloud where some other company can access it with this a usb zigbee dongle that keeps all your data locally within your own home assistant setup let's take a look hey home automation guy start the show when you use a third-party home automation ecosystem like philips hue that means that every time you turn the lights on or off or when you trigger a motion sensor it will send that information up to the philips hue cloud meaning they have access to all this information about what rooms you're in and when that may not sound that scary but do they really need that information by connecting your zigbee devices directly to home assistant using a usb dongle or some other zigbee dongle and you're able to keep that information within your own network no one else will be able to access it this will increase your privacy as well as your security another benefit to doing this is that you can control a hue hub with a sonoff motion sensor or an acara door sensor all of these different devices will connect together and you'll be able to use them in automations where one vendor's device will be able to control another ones and send data between them you also don't have to buy any of the third-party hubs or any of those types of devices because any zigbee device that you buy is likely to be able to connect directly to home assistant without any of the add-on pieces that you normally need to buy when you use one of these ecosystems so let's take a look at how you set it up in home assistant i have home assistant running on a raspberry pi and you may have seen me set this up in previous videos if you don't have home assistant running yet check out the videos linked in the description and you'll be able to get up and running to this point very very quickly but yes before you get started you will need some sort of device running home assistant and you'll need a compatible usb dongle then you simply need to plug it into a usb port and we get started by setting up the software the software that i'm talking about in this case is called zigbee home automation or zha this is what we're going to be using to control our zigbee devices within home assistant there are a few other ways you can do this which involve different types of software including zigbee to mqtt and other things you may have heard of but today we're going to focus on the easiest way that i've found zha the most important thing you'll need is a compatible usb dongle if you go to the home assistant website and go to the zha integration page you'll see a whole list of different usb dongles that work with or are compatible with the zha integration if you buy any one of these you're likely to be able to connect it directly out of the box into your home assistant setup you can even find a whole bunch of these on amazon ranging between five pounds to 100 pounds depending on which one you go with no matter which one you do pick please make sure that you pick one that's listed on the website and is compatible otherwise it may not work properly with our usb dongle plugged in we go to the configuration area of home assistant to integrations and we'll add a new integration the one we're searching for is zigbee home automation or zha click on the name of it and it'll start installing it once it's finished you'll need to find the usb dongle and where it's located there's usually only one in the list so just click on that and then click the submit button to finish up the installation you've now got the zigbee home automation integration installed and we can start adding new zigbee devices but first i'll take you for a bit of a tour around the integration itself the network tab gives you shortcuts to the devices that have been attached through zigbee and allows you to change some basic configuration options if you want to configure some more advanced things you'll need to use the configuration.yaml file and there's plenty of documentation on the home assistant website about how to set this up for any different kind of use case that you may have you can group similar zigbee devices together using the groups page but i've never really found any use for that and i'll show you the visualization tab later in this video but first let's connect some zigbee devices so we can start getting use out of this to add a device go to the configuration area integrations and then click on the devices area of the zha integration from there you can click the blue add device button and i'm going to add a philips hue light bulb now i already had my hue light bulbs connected to my hue bridge which means i first need to disconnect them from the hue ecosystem before i can use them with my zigbee home automation setup to do this i need to open the hue app on my mobile phone find the light bulb that i want to remove from hue and connect directly to home assistant and then click the delete button this will delete it from the hue hub and force it to go into pairing mode so it'll start looking for new zigbee hub in order to communicate with when we drop back into zha you'll see that it will pick up that device almost immediately and start connecting with it it may take a couple of minutes to set up the device but when it's done you'll be able to give the device a name and you can also specify what area that device lives in i recommend you always assign an area to a device because then you can control an entire area for devices such as all of the lights in the living room from a single automation without having to specify them one by one so this device is now available in our home assistant devices area and it behaves in almost exactly the same way as if it were connected through the hue hub itself you can turn it on or off you can change the color temperature you can also change the color itself if the device supports that you can add cards to your home assistant dashboards that control these lights exactly the same as when they were connected through the hue hub you haven't actually lost any functionality by removing the philips hue hub from your network and connecting this directly to zha now that we have our hue light bulb connected directly to home assistant let's add some more sensors and see if we can control this hue light bulb with some non-hue zigbee devices we'll follow the same process as before to go to the integrations area the zha devices and we'll add a new device this time we'll be adding this sonoff motion sensor it triggers when it detects a person moving in its area in order to pair this device with zha we need to press a pairing button in this case with a sim pick or a pin push the button in and hold it for a few seconds until you see the light flash it will then begin pairing with zha give it a name and let home assistant know what area it's in the motion sensor is now ready to use in the normal devices section of home assistant this sensor will trigger whenever motion is detected so if you wave your hand in front of it you'll see the motion trigger activated in home assistant itself you may notice though that after motion is stopped in front of the sensor it takes a while for home assistant to know about it this is because of something known as the cooldown period you'll need to be mindful of this cool down period when you're thinking about your automations if you want a light that turns on automatically when someone walks into a room and then turns off again when someone leaves that room you'll need to be aware that in this case with this sensor it's not going to turn that light off for at least one minute because of the cool down period if the cooldown period is two minutes that light won't turn off for at least two minutes even if someone's already walked out of that room that's because the sensor isn't going to detect or look for motion until that cool down period is reached it's usually not a problem but just something to be aware of in your automations let's add one more device go back to the configuration area into the integrations to the zha devices and we'll click that add device button one more time we're going to connect an akara contact sensor which detects whether or not a door or window is open or closed we again need to click the pairing button at the bottom of the device this one doesn't need a pin or a sim pick you can simply hold it with your finger until the light flashes which will start the pairing process with zha we'll give it a sensible name and let home assistant know what area this device is in this sensor uses a magnet to understand whether or not the two pieces are next to each other so you can use it to detect whether a door a window a cabinet is open or closed when you move the two pieces next to each other they're detected as closed and when they're apart they're open so let's take a look at what you can do with these automations now that you have all these devices connected to your zigbee dongle the first automation we're going to create will turn on the living room lights when it detects motion through that new motion sensor we've added so we'll create a standard automation give it a name and then we'll select motion detected as the trigger from that sensor and in the action section we'll tell it to turn on the living room lamp at a hundred percent brightness we'll now create a second automation that turns the lights off when motion is no longer detected or when someone has left the room just like before we'll give the automation a name and will select a newly created motion device from the device list we'll use the pre-defined stopped detecting motion trigger for this automation and set the duration to 5 minutes because we don't want the lights to turn out unless someone has left the room for at least five minutes we then select the living room lamp and we tell it to turn off let's save the automation and give it a test you can see that when i wave my hand in front of the motion sensor it will now turn the living room lamp on and you can see this reflected in home assistant as well let's create one more automation that uses a door sensor to turn the living room lamp on we're going to create a normal automation again give it a name and select the door contact sensor as the trigger device we'll use the predefined door opened trigger and again turn the living room lamp on to 100 brightness we'll create a second automation that will turn off that light when the door is closed we do the same thing again except this time we choose the door closed action we'll hit the save button we'll take it for a spin and you can see that the light turns off every time you close the door and turns on when you open the door with the same thing being reflected in home assistant itself now that we have a bunch of zigbee devices connected to our network we can use zha to take a look at how this network is put together using the visualization tab here you can see all of the zigbee devices on your network and how they're communicating with each other over the zigbee mesh network if you zoom in on one of these devices you can get a lot more information about it including whether or not it is acting as a zigbee router if you don't really understand what this mesh network is take a look at my what is zigbee video which i've linked in the description it explains exactly how zigbee works or how this mesh network is useful in your home the coolest thing about connecting zigbee devices directly to home assistant is that you can control one manufacturer one company's device with another company's this means that you can create any number of automations and scripts and integrations that use all the devices that you have around the house regardless of who made them as long as they're zigbee compatible if you found this video useful click the subscribe button because i'm going to be releasing a ton more videos about how you can use zigbee directly connected to home assistant to automate your house and together we can make your home [Music] smarter you
Info
Channel: Home Automation Guy
Views: 50,866
Rating: undefined out of 5
Keywords: zigbee, ziggbee, home assistant, hue, sonoff, aqara
Id: ZUWrUBJQRpA
Channel Id: undefined
Length: 12min 26sec (746 seconds)
Published: Tue Jun 08 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.