Flashing Sonoff Zigbee 3.0 USB dongle plus and Home Assistant guide

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
around the end of last year i received something from a sonoff and this is this device here it's a sonoff zigbee 3.0 usb dongle plus and i've been testing it since so let's look at some of my results recommendations and use cases [Music] let me start first by thanking all those wonderful people that have become my youtube channel members thank you all for all of your support and also thanks to everybody who watched liked or subscribed to my channel if you too want to support the channel you can do so by clicking the join button down below and now let's look at this zigbee dongle from sonoff thanks to sonoff for sending me this usb dongle also thanks them for sending me a couple of other devices that i will be recording videos on soon but let's talk about this zigbee 3.0 coordinator for the home assistant network because yes i will be talking on how to use it inside home assistant or with home assistant i've been using it now for more than a month i wouldn't call that extensive use but still i did use it and for the first time i even used it with the zha so no zigbee to mqtt but zha which was the first for me and the installation was what installation i plugged it in my synology 415 plus which i use for testing and recording i added the stick to the synology virtual machine and that's it the stick itself just popped up in the machine i selected it but no i will later on guide you on how you can do that with synology either if you are using docker version or the virtual machine and it should work both with the 6.2 version of dsm and the version 7. so first let's talk about characteristics of this device out of box this device comes with the standard firmware which is recognized by both zha and zigbee to mqtt meaning that out of the box you can plug it into whatever device you are running your home assistant on beat raspberry pi 3 for home assistant blue even yellow if you are able to find it somewhere but i don't think that you can find it unless you are loose and just add the device the problem with the firmware that comes out of the factory is the limit of number of devices if we check this web page from the manufacturer down at the bottom you will find this line the limits of zigbee dongle plus are 21 direct children and up to 40 children so if you know how zigbee network works it means that it can have only 21 direct connections to end devices and devices can be either other routers or and devices such as door sensor and it can only handle up to 40 overall devices on the zigbee network which is very limiting for my recording setup no because i only have two three devices there but if i would use this in my home assistant setup it wouldn't work so the first thing that i recommend you to do is to download the latest firmware and how do you update the firmware there are a couple of ways in this video i hope to cover both the linux version and the windows version windows version can be a little bit harder but not in terms of the hard process it just requires you to install some software which you normally already have on your linux machines that's the biggest difference since there is a newer version of the updater you do not need to open up device like you had to do previously you can do everything through the script so let's get started first we need to hook up this to a raspberry pi stone of documentation offers you two methods we will be using method one but if you don't feel comfortable with that you can follow the steps in the method too so first thing let's click on this code right click on download zip and let's copy this link address you now have to establish the ssh connection to your linux machine as i mentioned we will be doing linux first and here we will first download the zip file wget use the link that we copied previously and press enter master is here unzip master dot zip okay now we should have folder cc2538 dash bsl dash master and inside that we have this script and this is the script that you'll be using so let's go inside this folder next thing is we need to download the appropriate firmware for this device and you can find the link to coordinator down in the description of the video in this folder here you will find sd stack coordinator firmware and we have to download one that will work and not corrupt our sonoff device if we scroll to the bottom of the page here you will see the reference that this sonoff zigbee 3.0 usb dongle that is cc2652p device has to use this zip file here and that's the first one but if you would now click here and try to download this from this link no you will get a text file or something that looks like text file instead what we will do we will right click on download copy link address and use this link to download it inside of terminal to make it easier to work with this file later on let's type following command wget to download the file minus big o letter o we will give the name of the file cc2652p dot zip and let's paste here the url we copied previously difference between the first if you would press a copy link and the second one is that second one has raw first one is html let's press enter hopefully everything is downloaded and let's type unzip cc2652p dot zip as we use this to rename the zip file we now have hex file here we have this hex file which is the firmware we have the script that we will need to run and next thing is to test if we can run this script or not first let's type python version python version should be higher than 3.4 and our python version is 2.7.16 so we have to update everything and download the newer version the command for doing that will be in the description of the video next let's download dependencies pip3 install pi serial and intel hex pi serial was already downloaded and before we start uploading the firmware to the device let's check first if device is visible or not type ls2list devices dev you can either use tty with asterix here to show all tty devices and probably this tty usb 0 is the one we are looking but it's recommended that you use a different path or a different url so type in instead ls dev serial by id and press enter and it will show you the complete path by serial id to this device this port 0 should match the usb 0 here now we are ready to flash the firmware in my text editor i have prepared the full path and it looks like this python 3 because we want to run the python 3 version of the python this is the python script we are using port and i am using device serial by id and here is the full path or the full name from that folder then we are using command erase verify and write the only thing that you have to be careful here and add is this dash bootloader dash sonoff usb with the name of the firmware this ensures that we do not need to press and hold the boot button on the board itself instead we will be doing it via software let's press enter and keep our fingers crossed the board itself is now flashed if we now insert the stick inside the device that is running home assistant and go to the notifications you should probably see something like this sonoff zigbee 3.0 usb download let's go to integrations at the bottom of the list is zigbee home automation we can see in the list that it has discovered device tty usb 0 which is sonoff zigbee 3.0 usb dongle plus with the serial number let's click on submit and that's it we now have zha with the sonoff zigbee 3.0 device installed so how do you add device with that press on configure add device take any zigbee device for example this motion sensor and put it in a pairing mode here it is our first device has been added how do you add it to your synology machine first let's add it to the synology via the virtual machine manager to add it to the synology dsm 7 or dsm 6.2 if you are using virtual machine manager it's pretty easy go to virtual machine manager virtual machine find the virtual machine that is running home assistant actions edit in others under the usb device select silicon labs cp210x uart bridge and press ok this should map the usb device with the virtual machine and then in home assistant go to configuration integrations plus select zigbee home automation find here the device this is tty usb 0 sonoff zigbee 3.0 usb dongle plus with the serial number blah blah blah click on submit and the coordinator is now integrated inside home assistant via zha once again if you want to add device press on configure add device for example we'll take this motion sensor put it in a pairing mode and that's it we now have son of zigbee dangle with two devices one is this motion sensor and the other one is the coordinator itself so what about adding it to zigbee to mqtt it's also easy in order for us to add the stick to zigbee to mqtt you first of course have to add it if you do not have it installed already press on add-on store and install the zigbee to mqtt if you are feeling living on the edge you can install the edge version but i wouldn't recommend for the production environment only for test one in the zigbee to mqtt in the configuration panel the only thing that you have to add here is the path if you remembered our path is a little bit different this one is for the slash stick just use the same path that you also used when you flash the firmware so it should be device serial by id and this long long long long string at the bottom of the file press save and restart add-on our zigbee to mqtt should now be running with the zone of zigbee stick configured for it let's go to zigbee to mqtt and once again we can add the device once again i will be using this motion sensor from xiaomi click on permit join here and put the motion sensor in the pairing mode and here it is our device has been added in order to get the sonoff zigbee 3.0 usb dongle stick working with the synology 6.2 or 7 you may need to install additional drivers if you are using dsm version 6.0 it's much easier you have to click here select the synology model you are using for example one of my synologies is ds415 plus download the spk file and then go to the package center in synology and just install it but installing usb drivers for synology 7.0 version of dsm is a little bit different click on dsm 7.0 usb drivers either here or here select the type of the cpu that your synology is using and if you do not know the type of the processor of your synology you can go to synology website and look there on this web page press ctrl f to search for the model type in the model that you are using my ds415 plus is having intel atom c2538 quad core four threads processor type is avatar and here we have to go to avatar folder and download those files in the synology i will elevate my privileges by doing sudo minus i and now i will download all three files that i need to download these are the two dot ko files and one dot sh for script now we have to copy those ko or driver files to appropriate folder i will use move command cp210x dot ko lib modules same thing i will do with ch341.co script we will move to different folder move start usb drivers dot sh to folder user local atc rc dot d start usb drivers dot sh now this file start usb drivers sh will be run each time the system restarts the script itself has been set up for the cp210x and this chip is used by the sonoff device so you don't have to change it if for example you are using some other device that is using ch341 in this script that is now located in this folder just add it and replace the cp210x with ch341.ko we now have to run additional commands since we are already in the privileged or elevated mode we do not have to type in sudo but just to ensure that you don't forget it i will do it once again here sudo ins mode lib modules usb serial dot ko for me i receive error or warning because this one is already installed and yes it's installed because i installed previously but you should get the success and the next module that we need to install is cp210x dot ko press enter once again i'll receive warning or error because it should already be installed but there is still one additional step that i forgot and that is to change the user rights in order for system to run this file we have to type in the following command change mode plus x and run it against the script that we previously copied press enter and that's it now that you have installed both of those files the question is how do you add them to the docker well it all depends i will not be covering compose file i will show you how to install it or add it to home assistant if you're running it in docker in a plain command prompt mode let's see if we have ety usb active or not yes we have tty usb0 so this is probably our sonoff stick let me create folder for home assistant and let's start typing the command that will download and install home assistant if you already have installed home assisted in synology and you've set it up correctly you can remove the container and type it once again to pull the path of the com port let me first show you here how you can do that docker run minus d name of the container will be home assistant restart will equal unless stopped this means that it will be restarted each time the container fails if it for example fails but it will not restart if we manually stop it minus e for environment variable tz for time zone equals you have to find your own time zone for me this is europe zagreb v for volume mapping we have to here input the path where our configuration files will be located and we will be keeping them in the volume 1 docker home assistant folder volume 1 docker home assistant and we will map it to internal folder called config because this is where home assistant is keeping configuration files for the network we will be using host network the other option is to not use the host network but bridge network and then you can also specify then change the ports in the host network mode we have to use the port 8123 and now comes the last part and the last part is mapping of our sonoff usb stick or any other zigbee stick or zip stick you have if it is of course available unseen by the system device dev tty usb 0 will be mapped with the internal device dty usb0 path and of course the last part is to specify where and what version of home assistant we want to get we'll be using g h c r dot i o home assistant home assistant stable and this will now pull and install home assistant and will also map our tty usb 0 port to the internal tty usb report that way we will be able to access this device from home assistant by the way the same method can be used for docker installation of zigbee to mqtt just instead of installing home assistant you would install zigbee to mqtt and add device the same way you did it here and in the configuration file of course then you would need to specify slash dev tty usb0 same that you did here let's open docker container and it looks like home assistant is running or at least starting up let me quickly configure what i have to configure and you can see that this device has already been registered do we want to set up let's click on submit and here is our fresh home assistant installation configuration integrations we have one device here and if you want to add additional device press on add device via this device acara motion sensor put it in a pairing mode and here it is the new sensor has been added and now that we have finished all the possible types of setups including the virtual machine manager direct raspberry pi and docker installation on some more demanding systems such as synology version dsm-7 let's look on how to install the latest firmware via the windows machine first step in updating the firmware for the windows machine is to download the python if you have already done so you can skip this step if not click on the download python and the link will be in the description of the video and run the file after it has been downloaded in order to make things easier we will tick this box add python 3.10 to path and click on install now if you are presented with the option to disable the path length limit click on it and close next we need to install some prerequisites one of them is pi serial and intel hex the command for that will be in the description of the video for this we will be using powershell in the search field of the windows just start typing power s for powershell and click and open the powershell here we will type in the command pip install pi serial and intel hex you may already have those installed so if you do have that's no problem if you receive warning there is a newer version you can install the newer version python m pip install upgrade pip and it should install the latest available version of course we also need to download both firmware and the python script firmware can be found on the same link that is in the description of the video and we need this first version launchpad coordinator the latest version at the time of the recording is 2021 1217. click on it and press download and of course we need to download the script to program the firmware and this can be done by clicking on the code and download zip direct link to the zip file is also in the description of this video unzip both files and put the hex file which is the firmware in the same folder where the script is let me change to a folder where all the files are and let's see what we have here here we have the firmware and the script we need to run but before we run it there is one additional step we have to check first and that is to verify on what port device is connected there are two ways on how you can do that while you are still running the powershell you can use this command and it will tell you that it's on the com5 or you can use device manager look at com ports and see that we have silicon labs cp 210x on the com5 port the next step is once again to run the command and this is the same command as we would run it on linux but with the different port python name of the python script and port i will delete this part here this is the linux port and instead we'll type here com5 we will be using erase verify and write flags and once again bootloader dash sonoff usb the last part of the command is the firmware that we have downloaded previously let's press enter and this is it the new version of the firmware is now flashed on the windows if you're having issues with this command don't forget to run this command as administrator as you can see here this is administrator windows powershell i really do hope that you will find this video useful i've shown you couple of ways on how to update the firmware to the latest version if you are using windows or if you are using a linux machine i've also shown you how to connect it to home assistant if you run raspberry pi or if you're running it synology in the virtual machine manager and also docker and also i've shown you how you can add it to both zha and the zigbee to mqtt inside home assistant running on virtual machine so what is my opinion about this stick i've been using zigbee stick for more than a year now or maybe even two years and i'm really happy with it but the big difference between the stick that i'm currently using and this one from sonoff is that sonof1 is much much much more cheaper in terms of performance i think that both devices with the latest version of firmware can support 100 direct connections or up to 200 total devices on the zigbee network which is more than enough and probably i will never ever have that many devices unless sonoff or akara send me some free stuff so would i recommend it yeah sure device is great but one thing i would recommend to anyone who is using any zigbee stick please get the female to male extension cable why the the reason is simple you want to move away the zigbee stick as much as you can either from your wifi network or your wifi router or from the raspberry pi or any other device that is running that stick yes this can really impact and influence the coverage of the network so if you are having network issues first try to move the stick far away from your device one great thing about this device is because of the price you can also use it as a router on the network in order to do that you would just need to replace the coordinator firmware with the router firmware and by plugging it in some mobile phone usb charger you will be able to extend the network without need to buy additional always on powered devices such as bulbs power outlets or things like that so yeah if you're interested in this and want to check it out you can find some of the links to the sonoff devices down in the description of the video and this is it for this home assistant how-to with bearded thinker if you have any kind of a comment or question you can always leave comment down in the comment section below but i would definitely recommend that you go to discord server and leave comment there i will probably see and answer your question there much faster plus there are some other people that are also active in the discord server and they may help you too if you still haven't subscribed please subscribe and hit the bell button so you get notified on the future video updates and streams of course and i'll be seeing you next time until then bye bye and have fun
Info
Channel: BeardedTinker
Views: 40,019
Rating: undefined out of 5
Keywords: sonoff zigbee usb dongle, sonoff zigbee 3.0 usb dongle plus home assistant, sonoff zigbee 3.0 usb dongle plus, home assistant zha, zigbee2mqtt setup, sonoff zigbee 3.0 usb dongle plus firmware update, sonoff zigbee 3.0 usb dongle plus firmware, sonoff zigbee 3.0 usb dongle plus zigbee2mqtt, sonoff zigbee 3.0 usb dongle plug home assistant, sonoff zigbee 3.0 usb dongle plus homeassistant, sonoff zigbee 3.0 usb dongle plus zha, sonoff zigbee 3.0 usb dongle plus router
Id: iCE5Z43EKpk
Channel Id: undefined
Length: 27min 26sec (1646 seconds)
Published: Wed Feb 09 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.