How to Install Tasmota & ESPHome | SONOFF ESP8266 w/ Home Assistant

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
so with that second little Prime day they had on Amazon people might wonder well what did you buy Digi this is the best day of my life this is great went back old school what the hell is even that may be saying well what the hell is even this it's a so an offs 31 these have been around for quite a while but that's a reason they've been around for a while and they still sell them they're good uh they're esp8266 plugs with power monitoring and the cool part is you can pop them open unscrew them and without any soldering flash tasmota ESP home bring them local into home assistant without the cloud yes make it your Hardware since you paid for it so in this video we're going to go back to some fundamentals for you using this with home assistant doing some power monitoring I'mma break it up because I know there's some new people out there that haven't seen how to do this and things just you know change and get easier like I said we're doing no soldering just going to use some little Clips going to show one chapter we're going to show through tasmota and we're going to bring it into home assistant and then I'll show another chapter how we do it with ESP H so you know you can take and pick what chapter you want that way can make the decision whether you want to use Tas Moto or ESP home with this plug so let's get to it oh before you click off well say you don't live in the US and you don't have a cool S31 probably can hang around and learn something as well because this is going to apply to several other different it sonoff products as well so of course what do you need to flash the S31 well you need the S31 itself and do keep in in mind all the procedures and everything that can be used for other devices so if you don't have this specific one you could use like a Shelly or something else that can be serial flashed if you're not really sure well let's figure out what serial flash exactly is so next of course you need the little red guy now there have a bunch of different ones of this these are referred to your as a USB TTL and get a little closer well get closer soon so this just takes the USB connection from your computer and basically turns it into these wires so it can put your firmware and get rid of the cloud crap on these so there are a few other pieces you don't need them all but it does make it easy to do your device if you don't want to do this well find the link down below you can go check out Cloud free shop there's a couple other places atham Etc I think cloud free even does the S31 pre-lash for you atham and stuff have some pre-lash plugs as well but this is a good thing to learn you can recover your devices and do your own thing now there is another one I use it's a little more pricey but it's a little more versatile as well it's the volt log the volt link USB TTL adapter I really love this one it's high powerered has lots of pins and D all the things but I understand yes this one's kind of hard to get out but I'll leave the link down for 10d for this one we're going to use this one for the sake of everybody can get this off of Amazon or AliExpress or whatever I do like to use a USB cable with a switch and do make sure that this is a data passing one and the reason why I like this is you can turn off this USB TTL adapter without having to unplug and plug it from the computer cuz sometimes you will have to power cycle things and check things and everything it makes it so easy I went with years of flashing devices and when the first time I did this I'm like damn I was doing this wrong the whole time now we won't be using any type of jig I know they have some other 3D printed Parts I've made these jigs for people in the past these was for some other ESP chips but they do have some clips that can help out with this but you really don't need that because of where the pins are at and where we're going to lead to is the clippy boys now I don't have the specific ones that have the DuPont jumpers on them and what is that exactly is basically we're going to take this little clip you can see that there let's zoom in a little bit so we can get a better look at things is you'll see the little copper clip comes out and that's actually going to clip on to the pads on the S31 now I do take these and clip them right to the pin they're usually okay for the most part but it can be a pain they do make a model of these clippy boys that actually have a clip on them and then they have the DuPont jumpers on the end they'll have the female here so then you can just plug them right in now to hold everything I like this little guy it's a one of those helping hand things this just a bunch of little Eclipse these are pretty awesome um don't ask me to pronounce the name Omni fixo or something like that um I found these online and it's they were kind of pricey but hell they're freaking worth it with all the different features it does now they do have the readily available ones the little Helping Hands and these are just no it's not something awful for a Marvel movie but you just move them around and you can clip things to them and you can hold things especially as great for soldering but we won't be doing any soldering here now opening this guy is you do need a spudger and the great thing about this S31 plug is the beauty right here is the ability to open this without any tearing it up or glue or anything like that it's really you do is just take and pop this part off right here yep sometimes it flies and then you'll see these little pieces here they just slide right out to expose something you don't normally see on a plug yep fil up screws there are three of them that you need to take out don't lose the screws and then once you get the screws out all you do is grab the prongs and it should just slide SL right on out you don't need this there's the S31 plug the relay the prongs everything there and this is what we're going to focus on right here you'll notice they conveniently have the pads at the very edge of the board here now we're going to be using ground we're going to skip these two we're going to use TX RX and VCC don't be scared that's basically transmit receive VCC is like the positive that's going to feed that 3.3 volts from the USB TTL now how do you do that just take the clip and it can be somewhat difficult if you're just holding this in your hand like it is that's why one of those little Helping Hands helps out tremendously because once you just take and clip that on there like so it's going to stay on there and so now you have VCC going to it and we'll attach that to the USB TTL adapter lotson acronyms here so I'm going to go ahead and put this in the little Helping Hands and then we're going to clip to VCC RX TX and ground so remember to skip those two in the middle and we're just going to use the four the fifth we need to to put it into boot mode kind of like on the BIOS on a computer when you want to get in to go change stuff we have to keep hitting delete at the beginning or F12 basically it's kind of like what this is you're going to hold this down when we apply power that's where that USB switch comes into play because you can just click as you're holding it down hold it down for a couple seconds and then you'll be in boot mode and it's that easy to put ESP home or Taz motor right on this device and take it out the cloud I do make sure that when you're putting the clips on that you actually do get the clips actually touching the metal PAD as shown there it may have to move things around if you don't get it right but no big deal basically you just don't want to have this VCC one touching some ground but there's nothing really ground around there so pretty safe there now next thing you'll see on this little guy you see we got 3v3 at the top you got txd rxd then ground I bent my 5vt pin on purpose that's just more to protect me from myself cuz we rarely need to use 5 volts in the ESP world so I bent it out the way that way I couldn't screw up and send 5 volts to something I didn't need to so now what we want to do is if you look at your colors on your actual S31 do remember that the blue and the yellow I use as RX and TX so my blue goes to RX on the S31 and so you need to switch those because you want to receive to be on the transmit and transmit to be on receive you do both of those backwards kind of like how your use your ear to listen to someone talking and then the vice versa and I'm just going to clip mine to here and click my red to there now if you had the DuPont ones you would just slide them right on a lot easier with those and then my black goes to the ground so now we have everything connected up and done I know it looks kind of like a little mess but you can see how easily this is not having to solder anything and just plug it straight up and now we're going to plug it up to the actual USB cable like so and then we'll plug this into the computer load up any drivers we need to in case you haven't done this before for check your Windows settings or update settings if it's saying there's any optional drivers for the actual USB TTL once you do turn it on you do need those so this is the same for ESP home tasmota Etc you pick the firmware you want there's pros and cons to both try them out both because you never know which one you like or dislike so you'll find the chapters down at the bottom you can jump to Tas Moto or ESP home and go from there so if you do get stuck on anything you need the setup or you need some more of the links whatever it may be I've covered this S31 stuff before but things change and things definitely get easier with loading the firmware all these different devices got all that on my website you can find it under devices and then under plugs you'll see sonof S31 you have all the tasmota stuff then you even have the ESP home yaml picture the whole nine there so we're going to go into for the tasmota one on this one if you are looking for ESP home installation skip ahead to the next chapter so I do recommend using the web installer of course I'll leave that link down below you can find it on their GitHub Etc but the really easy part about this there's no downloads for it is remember the USB switch do remember remember that the button on the front and just try to be careful not to you know touch a whole lot of things or knock your Clips off you want to do is press that button and then turn the power on to that USB TTL adapter at the same time and all you have to do is hold the button down for like maybe a second or two and then you can let up I'm just going to go ahead and pick the default one Tas mod to English and hit connect and it should show your TTL we're going to hit that like I say if not you're not seeing your TTL adapter do go check your connections make sure the USB is coming online and then if you're using Windows do make sure go look in your device manager the driver may not be loaded a lot of times you can just go to Windows update and it will autod detect it might be in the optional ones and you'll just load that driver but worse comes to worse you need to go get the cp2102 as if you using this little red guy and get the silabs driver and install it manually so we'll hit connect and then we'll hit install Taz Mota if you don't have the connections right this is where you're going to find out I'm going to say erase device and hit next and say install and it's going to prepare installation and it should start flashing to the device you've got to the erasing part you know you have it right if you didn't get it gives you an error well then you can try to hold that button down and redo the power off and then turn it back on with the button held down try that check your Clips make sure you do have RX and TX transposed Etc and it should just start doing the install once you do it the first time it's really simple on doing additional ones so once it's completed there is a cool feature of tasmota but we cannot use it on this S31 plug because the power monitoring chip is talking over the console and it really starts to screw stuff up and you won't be able to talk to it and say hey I need to put in the Wi-Fi information sometimes it works let's see if we can get it I don't know if it is see if we can just go ahead and power cycle it so I did power cycle it and try to hit connect again and it does give me the option it does show it's installed so maybe this might just work let's do change Wi-Fi and it actually does work pretty awesome like I say things are always changing and so I'm going to go and pick my Wi-Fi and put my password in now of course if you didn't want to do this method you could just power cycle it and you could just use the access point mode and you could use like your phone or whatever and go tie into it put your Wi-Fi password in that way but since we have serial let's just type it in we ain't got to mess with all that stuff you continue and let's say visit device that's pretty cool it already has the IP address I don't have to go dig off for that device that's pretty damn awesome definitely have made things a lot easier so now you're probably going well I'm used to Tas Moda I'm going to go grab a template and go on the website what you don't need a template it's the S31 watch configuration configure module and right here in the list sonof S31 don't change anything right here just hit save and boom power monitoring is there now if you do want to get it really really close I did leave the feature here is you can go into the tasmota calibration procedure and it goes through and you can go through and set your like with a 60 wat bulb it's great for being able to get it exactly where you need to be but for the most part I did find the s31sst the box so at this point we have Tas Moto on it's on our Wi-Fi I do want to test the relay and I want to make sure this works so I'm going to pull the pins and stuff off of this and then we can put it on we can CU never connect the S31 to Main's power and using your little TTL USB adapter at the same time I guarantee you'll have have a bad experience really bad with smoking something so don't do it once you have tasmota on your plug you're on Main's power I do have a lamp connected to it with a 60 W incandescent bulb yeah it's hard to find those sometimes but they're perfect for doing and checking calibrations on these things so if you want to check it out we can just you know of course we're in the gooey of it on the web browser Chrome whatever it may be and you hit toggle and give it a second it will pop in the voltage the wattage and everything there now the way this is designed the voltage doesn't show all the time but there are some set options you can turn stuff on like that and well we need to go bring this into home assistant now I'm going turn the lamp off we don't need it burning so the first thing really what I like to do is go to configuration and go to configure other and give it a decent name just don't leave it Tas Moda and so I'm going go call it just like plug Taz S31 and I'm going go ahead and copy this same name here I may get some double entities it's been a while since I've brought this in the home assistant but we'll see here what happens so we'll hit save there it is the top then we need to configure mqtt yeah if you haven't done anything mqtt like zigg or whatever it may be don't get you know really scared of it you really just need to install mqtt I know a lot of people are using hos out there go to your add-ons and go pick mqtt hit install you can leave it all the defaults and just make sure it's running on your machine now if you're doing the docker compos Docker container thing you need to manually install mqtt mosquito whatever it may be Eclipse whatever different ones you want do make sure that you do have persistence turned on enabled and it's writing actually to the file it's a whole different deal if you don't know what you're doing with that part and you want to check persistance probably more the scope of this video just come jump into Discord using the link down in the video description will help you make sure that your persistence is working why is that so important that's where your config is actually going to be stored anytime you rebooted home assistant it would drop all that stuff you have to reboot all your plugs it's a true pain in the ass make sure your persistence works so go to configuration go to mqtt this is where you're going to put in your host that's the host of where mqtt is running I use a DNS name but if you want to use the IP address that's fine leave the port there leave the client there the user now it's very important if you're using hos any user that's pretty much in your system I like to just if you're using that just go make a user that you're going to like mqtt user something like that and it'll automatically you know build into mqtt and you can use that user and password there so the topic I like to give it something more than just hasb uncore than the last bit of the Mac ID I'm just going to give it the same thing here and copy and paste and leave the full topic and hit save did it connect to mqtt I don't know I'll show you how to check we can go to console and if you look here does it say mqtt or mqt connected if in fact it does you know you have it right and it's ready to go now one thing I do like to turn on is the power Delta and that's basically going to make it report and I'm going to show you what it does without the power Delta how do we put it in home assistant well it's already in there probably I have mine in a little sidebar here but if you cuz I lose it all the time Integrations go to mqtt well not mqtt I'm getting myself confused under tasmota you should be able to find it you have a big ass list like me well how about we you search there's our plug there and you can see we have all the things there there's the controls and there's the wattage let's go ahead and turn this thing on you can see it lit up my desk there now you'll notice we could actually just see here and we're not I'm sure I could talk a lot and there's no wattage being shown you say well is it broke is that a problem yeah it is a problem what if you need to know if it turned the power on right right away well there are a couple things and why does this happen is I'll show you right here in the guey of tasmota now that's the one thing different about tasmota everything is sa in the plug is not compiled so if you go to look configuration configure logging I think yeah here it is telemetry period it's set to 300 seconds so only every 300 seconds is it's going to report out the new energy settings well that sucks I want it to change when there's a percentage or hey what is a number of Watts power Delta and you can see I've typed it many times before and we'll do power Delta say five and that's going to be like a 5% change there is if you do more than 100 it's going to be like the number of watt chain so you could do like power Delta 110 would be when there's a 10 watt change depends on what your load is and now when we go over into home assistant and we turn it off and then we go and turn it on you'll see it's going to jump up the wattage a little bit quicker there's the 60 watts there's where half an amp we have all the things so we can do like a automations based on that power wattage and everything and we turn it off you should see it drop fairly quickly which it does so that's the power of the power Delta so if you decided to go with ESP home on the S31 or whatever other device it is it's a little bit harder to kind of start up because the modules aren't really built in but you know there are a couple websites think there's ESP home devices I have several configs on my website it's all the little yaml already coded for you but sometimes you have to do that yourself if no one else has done it before you if you haven't done with ESP home before you can just come in here to ESP home.io and they even you go in and put the ad on it's really simple to go through but this whole video really isn't going to be for like getting started with ESP home maybe I'll do something in the future I know there's a lot of new people to ESP home and there's several different ways to do things so with that if you go into the ESP home dashboard you need to create a new device so we're going to do this say New Device and I'm going to say continue want to read the big page of stuff plug- S31 test sounds good so we'll hit next and this is where it gets confusing I wish they had a blank option on here but we'll just go ahead and pick you can pick anything out of here it doesn't matter you're going to overwrite everything anyway see it's kind of stupid so yeah I don't use the encryption Keys that's more I say for using this on a public network but do be careful if you use those encryption keys and the OTA keys because you can lock yourself out of a device and you got to do the serial thing all over again so I'm going to say skip for now and go find this device plug S31 test and hit edit so here we are the little out of the box thing you can see it's got all the keys and stuff like that but I'm just going to go jump on over here to the config that I have so under devices and plugs scrolling down I should have the ESP home yaml you can just hit the the little copy button here yep you know the drill crl a select that select all hit delete it's gone and we're going to paste in everything so you can see that little thing was stupid at the beginning so I'm need to change the names I don't want it to be the same exact name I had I just have this test and test you can change the names do the friendly names Etc um when it comes down to some of this other stuff now there are a couple things you may want to change in here like the SSID and password you'll notice those aren't really set to mind it's a secret file if you're not familiar with the secrets I'll show you up in the secret in the main screen I have an additional one I use on the AP password that would be if you lose WiFi reboot your you know router or access points they're going to fall into that access point mode and then they'll have a password on so no one can just like jump on and do whatever they want with them you know it's depends on who your neighbors are but that AP password needs to be in your secrets file you won't really need to change any of this unless you really want to get nitty-gritty down here like the number of decimals and all that good stuff there you going to leave it all like it is so we'll hit save and so the secrets you see the secrets up here no I'm not going to click and show you my secrets on the video maybe we'll scroll down so that's pretty much all it is right here is the secrets file you'll have like say Wi-Fi my SSID my pass and then you'll use that secret key in all the Yama files that way it's a One-Stop shop just for that setting so if you're putting the same setting on something a lot the secrets is perfect for that even though if it's not really a secret so once you're do in here you can hit the install I like to go make sure I wish they had a validate up there um I wish they had a whole lot of things here like folders and you could hide stuff and maybe had a list and say stupid squares but that's a whole big wish list so let's just go over here and hit the three dots and let's hit validate that's going to just check your code and it doesn't necessarily means it's going to compile it means it looks good to compile sometimes it fails to compile there's multiple ways to install this thing I use my way you're going to find some else does another way but I like to see the actual compile go through instead of just sitting here staring at a little spinning thing so I go ahead and hit install and I like to hit manual download now you can plug it into this computer I don't know let's just for the sake of the video nothing scripted let's H plug into this computer and let's see what it does they may have changed something but I doubt it this is what I was talking about about it preparing download and then you don't know if it's compiling or not is there an error is it did you mess up on something that is is something with the libraries down that's not your problem you don't know because it's just a spinning thing I'll go back and do the other way so let's do it the tried and true way is just go ahead and hit install and hit manual download it's going to go through it's going to download all the little libraries and everything thing it's going to start compiling and doing all the cool things like it should be depending on your computer or whatever you may be using it may take a while to compile especially if it's your very first device because it has to pull all those little libraries down and it doesn't have everything cached so once it's done downloading is going to download that bin file to your computer if you don't see it automatically download you can just mesh download again it'll just probably add like another number to the end of the file do pay attention on which one when you do flash if youve been changing a lot of stuff in it so how do we flash this thing well there's a bunch of Old Co tools you can use I don't recommend them this way you can use and do everything even ESP 32 like you should so learn this method if you go to web. home.io of course I'll leave that link if you don't remember it I also have it on my website under ironic Ally the ESP 32 installation procedures but it's pretty close for the esp8266 before we hit connect we do need to make sure and power up our adapter up there and we need to put it into bootloader mode that's just holding down the button so two hands that puts it into bootloader mode we'll hit connect so it's going to ask us if you have more than one like I just had um do make sure you don't have multiple of these you may Flash the wrong device that's a friend told me of that one time so click this hit connect don't do the prepare for first use that leads down a whole different rabbit hole and then we're not getting out of that one install is what I want we're going to say choose file now the file just downloaded to your computer that's that plug S31 test you can see it's got the number one after it and then hit install it can go through doing the erasing if you don't get this part on here you probably messed up on some of your pins up there you didn't transpose RX and TX you try to swap them around and just kind of follow your wires look for something that fell off maybe your you know your big hands meshed it with the button when you're trying to hold it and turn it on just check everything and reposition and start over and don't forget cut power hold the button and turn power on while you're holding the button count to two and then let off the button and that's configuration is installed a lot of times you do need need to actually go in there and power cycle it because it's still potentially in bootloader mode so if I come back to the ESP home dashboard I'm probably not seeing it online yet so I'm going to go ahead and turn it off using that little switch you can see where that little switch for the USB comes in handy turn it back on we're wait a few seconds and see if plug S31 test goes to online now a lot of times if you have some mdns issues you may need to go to your configuration and turn on PING especially if you have multiple vlans you don't have an mdns repeater you have some DHCP issues it's going to have a whole deal the Ping usually works pretty decent if you go in the configuration for your add-on or the docker container but you can see mine came up I can hit logs clearly we have the device on ESP home at this point so really at this point once you see it up you can pull the pins from it and you can go ahead and go in there and we're going to put it on Main's power and then we're going to add it into home assistant and get it online so now that once you do have the plug on Main's power you can see we got it back on the network I do have it connected to a lamp with a 60 watt incandescent bulb it's a great little thing for testing yeah if you can really find them anymore right to get it in home assistant it's not that difficult so open up home assistant if you have autodiscovery which is defaulted to be on a lot of times you will have that plug waiting for to be configured if it is not showing you may need to hit add integration and hit type in ESP home and then look at already showing this discovered say no I want to set up a different one but yours will probably just say Hey look it's going to ask for the host the host is going to be the IP or the name of the plug so if you don't know that maybe your names aren't resolving you will need to put the IP address of it in there ours is resolving working with autodiscovery we're just going to hit configure and it's going to ask us here hit submit hit success area I don't care about the area I'm hitting finish boom it's done it's in it's that difficult sarcasm a little bit so once we come in here at devices we have our plug S31 test now don't mind you know it may say that there's nothing there you're just being too quick hit refresh give it a second it's going to pop in there's the relay and here's the amps showing there's even the button the daily energy the voltage the Watts Etc you can add all this to the dashboard whatever you want to do with it now I'm just going to go ahead and turn it on of course we get that nice warm white color from the bulbs can't believe we use these things and give it a second it will auto update and this is a 60 watt bulb I think it probably just needs to climb a little bit further yeah there's the 60 watts there and so we're getting half an amp normal for 120 volts and rock and roll and that's it everything's in there the daily energy you can do everything you want it's in home assistant ready to go local control and if you really want to dig into it you can also come back in here and hit visit you can go to the web gooey of the plug itself so hopefully you did learn something about how to take a regular ESP based device manually flash it nothing scary throw ESP home or Tas Moda you maybe saw the difference between tazmo or ESB home you haven't tried either or well this might be a good opportunity to see which one works best for you I use both because sometimes I want to use it one project sometimes I want to use it in the other project it just depends which one is easier to deploy for the project and but pick the one that works for you the one that you like so of course you know you'll find all the product links to everything down below I do appreciate that does help support the channel there's no additional cost for you because most of those are affiliate links but like I said there's no additional cost to you for using those and and well that's going to about do it for this one if you got any other questions comments or other things you'd like to see us do definitely shoot me down a comment down below come join our Discord it's free do whatever and yeah I do appreciate all the patreon subscribers YouTube members we definitely couldn't do it without you and yep y'all know all the drills press all them buttons down there and y'all take care
Info
Channel: digiblurDIY
Views: 10,602
Rating: undefined out of 5
Keywords: digiblur, digiblurDIY, home automation, hass.io, hassos, tasmota, esp32, esp8266, arduino, esphome, diy, smart home, electronics, cameras, zigbee, wifi, sonoff s31, sonoff plug, home assistant, no solder smart plug
Id: BDwR_Hb6ads
Channel Id: undefined
Length: 35min 56sec (2156 seconds)
Published: Fri Nov 10 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.