DIY Whole Home Power Monitoring with ESPHome & Home Assistant

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

I'm very lucky that our local utility provides detailed monitoring for $1/mo (It was free in beta but there is some law around here where they can't give services away or something so they charge $1 for it). I've got a Zigbee/Wifi bridge that sits in my basement's drop ceiling that talks to the meter and uploads the detailed stats to DTE (all provided by them, basically plug this in, use the smartphone app to join it to your wifi, it binds with the meter). We get down to the minute details and can view live usage anywhere. Plus it won't burn my house down.

I get the DIY aspect, but really just buy a Sense. Dealing with high current/voltage AC isn't for everyone.

👍︎︎ 11 👤︎︎ u/sryan2k1 📅︎︎ Jul 08 2019 🗫︎ replies

I don't see any voltage monitoring hookups, so I assume there is no power factor correction?

👍︎︎ 3 👤︎︎ u/TheFeshy 📅︎︎ Jul 08 2019 🗫︎ replies

If you are going to do this, you might as well put ct clamps on all the major circuits so you know what is on/off. Getting just the total home usage neat, but the applications are pretty slim.

👍︎︎ 1 👤︎︎ u/ewood350 📅︎︎ Jul 09 2019 🗫︎ replies
Captions
Jimmy wish you had an easy solution to monitor all the power usage in your home in various circuits in a real accurate method we're gonna show you how let's check it out so if you've seen in some of our other videos we did some various dryer notifications that we kick off voice notifications and many other types of notifications just to tell you say the washer and dryer is done well we bring this one step forward and we want to monitor the entire home and we also want to monitor various circuits in the home that may drive other automations or just want to know how much power of different devices are using not to mention you can get some real cool graphs and go fana that show all the timeline usage of all your power so how do we do it we're using a power monitoring board that's built by circuit setup us before we jump off into the board gonna let you know that we will be using this with ESP homes so it offers a very easy solution to get integrated into home assistance since you can use that with an API or mqtt etc and there's no coding of our dwee no sketches and everything is just gonna be using ESP home that many are familiar with so they do have a two channel board and a 6 channel board and the 6 channel board is also stackable where you can add another 6 channel board to get 12 channels and some folks if want to do in the u.s. just their whole home the to channel board would do great for you since typically in the residential home in the US there's a split phase or as some people do call it 2 phase but it's technically a split phase and you're only gonna need the 2 CT clamps and you can monitor your entire home now I've been using the to channel board my home for many months with a custom Arduino sketch but I recently did switch over to using esp home and it does work great now before the recording of this video also changed over to the 6 channel board that way I could monitor the to split phases coming in as well as monitor for circuits as well and one great one you could do is monitor your electric dryer for your notification instead of having to build a little board with the CT clamp on it you could just use this and monitor it at the breaker panel now some of you probably think hey Travis well look why don't you just build two of those and monitor your whole home with that same CT clamp you did for the dryer well I can tell you one thing and I'll just get to it straight the chip on these boards is downright amazing how you can hold a 1 amp or even half an amp load and measure it accurately with a 100 amp CT clamp and it holds it steady is quite simply amazing it's definitely a professional power monitor chip that you definitely won't find in any other little smart plugs and anything like that this just gets the job done at the core that board is the ATM 90 ether t 2 AAS it's a great chip there's a lot of information on it and we'll leave all the links to this if you want to read up on this chip it's truly an awesome chip to use for power monitoring in your home of course they own the two-channel board they don't have where the ESP chip can plug directly into that board but they do have an adapter style plate that can actually accommodate plugging in your ESP 32 directly to it or you just could do or you just could do it yourself with a couple of DuPont jumper wires from the ESP 32 over to the 2 channel power monitoring board but of course on the 6 channel board you can just plug in the ESP 32 straight to the board and it does get power from the power adapter and then alongside here in this picture is also the one that can be stacked on top of it to expand it to more channels now now that we talked about the cool stuff well let's go ahead and talk about the not so cool stuff you will be installing this in your breaker box and I cannot stress this enough the wiring and the breaker box will kill you immediately you can't just go in and turn off the top breaker for example in this breaker box here the top breaker once you turn that off those three wires coming in the top you can see the blue one here that's the neutral and then the two split phases those are still hot the only way to remove power from those would be to actually pull the meter from the home and typically you will need to call your electric company to do that so the easiest way if you want to put these clamps on you're wanting to put them on the whole home power monitoring where you're wanting to put them above your main breaker I would definitely consult an electrician and have your electrician come out pay them suck it out get it done let them do it safely and put those clamps on for you now on your secondary circuits if you do cut the main breaker at the top you are cutting the power down to the bottom of the breaker box but unless you're very comfortable installing stuff or changing breakers out and your breaker panel or rewiring stuff I also would have the electrician at that time also install the clamps on the circuits you want so you may want to before they show up to do that is map out some of your circuits I cutting some of the breakers off and figure out which ones you'd like to map after they're installed they don't have to be touched it's a one-time thing they can put them in and be done with it but I can't stress enough you will need to be safe on installing these things I don't want to hear anybody getting shocked or anything because of not turning breakers off or simply they can't turn breakers off ting the entire panel so please consult an electrician when you get these Ct clamps installed so that than that the CT clamp installation is fairly simple they just get clipped over the wire so though no wiring has to be removed it's very it's non-invasive it doesn't actually cut into the wire itself so you can see here I have mine installed on the side of the panel and it's just installed in a little 3d printed case next to the panel itself and it works great so one thing I did want to mention for all you solar people out there this is also a great solution if you can't easily with local control monitor you're in an output of your solar power I'll leave a link to the crowd supply information where he gives a lot more information on using this with solar and various other options is to definitely get a cool little video and a great little read you can check out on the crowd supply link and I'll leave that down below in the description of the video so one last little bit on safety with the CT clamps once you have a load of those CT clamps do not unplug them from the board especially the ones without an internal burden resistor that's the ones that's going to be an output with say 50 milliamp output and not the voltage output so open energy monitored has some very great documentation and safety tips concerning all the CT clamps I would highly recommend before you start digging around in things with the CT clamps definitely give that a read in the description of the video below concerning the safety of the CT clamps so if you don't read any of it definitely read this sentence we highlighted here if you unplug it this will produce a highly and potential dangerous voltage across the secondary meaning that tip could could become hot even though you've just simply unplugged it from the power monitoring board itself and you have all the power going through your home which is passing through that CT clamp so know it's pretty safe but just you need to know what you're dealing with when you're doing energy monitoring of the whole home so enough about all that let's go check out the board and we're going to show you how to put it in here SP home and get it calibrated so there are two versions of this board this is the six channel version they also have a two channel version at a time of the recording of this video I don't know if you can order a mixed type of board where this one has two three point five millimeters and then it has the Quick Connect screw terminals now what I mean by that is the split core transformers and though you've seen these before if you've watched my dryer videos where we built one to see the dryer if it's going to be on or off to do our voice notifications and home assistant this board actually uses six of these split core transformers of various sizes and types and you can mix them as you can change the calibrations in ESP home typically when you do order these they come with a 3.5 millimeter plug and you can simply plug these in and I would when you plug these in hold a little pressure that way you're not forcing all the pressure on the board you won't rip the plug off you simply plug a man and call it a day now if you've cut the plugs off in various projects such as I've done in one revision you only have your red and white wires and then you'll need to use the screw terminal type now as I mentioned you can use various different types of split cord transformers as you can see here I have 100 amp 50 milliamp a 50 amp 1 volt in a 30 amp 1 volt there's 6 traces for the split core transformers and you will need to sever the ones that are using a voltage output since that takes out the burden resistor that's built into the board now I have found this one the 100 amp version you can find them in great prices sometimes even cheaper than the the lesser models the 50 amps and the 30 amps they make several different sizes and also made by different manufacturers but due to the chip on this board being so accurate you can measure even a simple LED light bulb with the 100 and SCT without an issue so if I was doing this all over again I would just get these 100 amps and use these in all my various circuits now one thing to note the power input is not DC voltage do not power this with your standard power brick that is typically DC volts of 9 to 12 volts if you'll notice on the board it says 9 to 12 volts voltage AC only and this is what I'm using the power this board as a 9 volt AC 1500 milliamp power transformer and of course we will leave the links to all the various parts and pieces of this integration in the description of the video and do always check the description of the video if there's ever any updates we will update the description of the video with any changes as needed so for the board you will need an e SP 32 and do make sure the e SP 32 has browned and then 3.3 volts at the top near the antenna like this one there are some models of the e SP 32 breakout boards that do not have this same pin out and you'll put the pins all the way to the top leaving the bottom pins not used and there in my model there is a little feeler down here to prevent you from putting the ESP 32 too far down and just simply push it down and that's it and the board is pretty much built and you connect your split core transformers now one thing to note when you are doing the initial programming of this with ESP home you'll want to split the board from the chip program the chip via USB before you put it on the board that initial programming will be done through the USB cable and then once you're done at once we can actually program everything using OTA in ESP home using the GUI so we're not going to go too in depth on the two-channel board but this showing next to these on-off basic which I guess that's good for something in this video is showing a size relation to the actual to channel monitoring board it's super small as you can see even by we most d1 mini it's pretty comparative in size it's super small and you can just connect the little jumper pins over to a DSP 32 using some DuPont jumper wires of course since it is just a the two channel power monitoring board you're gonna get the spots for the 2 ct clamps and it only has the one power monitoring chip on it pretty simple board very reliable I have used this exact board for months and I only took it out to replace it with these six channel board so if you only need two circuits you don't need all six definitely check this board out it's a pretty cool solution so currently as a recording of this video it should change fairly soon is the sensor required for ESP home is currently only available in the development version of ESP home so you will need to install the development version of ESP home then once that is tested enough it will make it into the next revision of ESP home for the standard version so we'll go ahead and install the development version if you are using something else like on raid or roll your own type docker setups you will need to change your docker tag instead of being with the : latest it'll be : instead they've already familiar with ESP home you can probably skip through some of this as I'll lead the link to the entire llamo file that I use in a github link including some of the calibrations I did for my SCT s but we'll go ahead and do a initial node and the name of the node we'll do it digi energy and remember these have to be lowercase and must not contain any spaces and we'll call it underscore 6c for 6-channel they continue it is an EE SP 32 so we need to select a SP 32 and we'll just use the note MCU 32 hit continue Wi-Fi SSID you'll go ahead and put that in we will utilize our secret Jia mo file in the one we do post at github it won't be putting an access password hit continue you can if you want and we'll hit submit at this point if you do have it connected directly to your PI or server what not you can go ahead and flash it straight using the USB port now I don't have to connect it to my server so I'm gonna go ahead and do a compile and download it and then flash it over USB using the ESP home flasher and also since I do use static IP Eve's my various VLANs I'm gonna go ahead and edit the file and put it in my information but you may not have to do that for your specific network so paste it on my Wi-Fi information I'm not gonna be using the captive portal I don't need that on this particular device since it is an easy to flash device using USB I'll leave the logger in if you are using the API you can go ahead leave the API M I'm using mqtt with this one just in that leave the Otan will also throw in our webserver and that's it it should give us a booting kind of a rolling chassis per se of the ESP 32 that way we can put that on the board and then go ahead and power it with the six channel or the to channel board and then we can flash all of our different sensor updates and calibrations straight from the board without having to use USB if you are using through USB right now you could hit the upload and just go ahead and flash it we'll need to go ahead in my case and do a compile and then we'll download the binary once the compile is finished with download binary next I'm going to grab the ESP home flasher - ESP home flash again we will leave the links to all this for you can quickly just jump to instead of having to dig through any documentation releases and we'll download the one for Windows while that's download and we'll go ahead and connect our USB cable to the node MCU and plug it into the USB port on your computer your flashing from so weird and open up the ESP home flasher and select the comport of your node MCU and then browse to the bin file you just downloaded from the compiled there's our digi energy six channel bin file and then we'll hit flash ESP let it go ahead and flash and then it will actually open up the serial port and show it connecting to your Wi-Fi so we can see it flash it actually rebooted and it is connecting to my Wi-Fi along with connecting the MQTT or the API etc now we don't have the power monitoring board sensor setup but we just wanted to get this little initial one going that way we can put it on the board itself you also notice in the dashboard you should get the green online light and as well as being able to view any various logs there's nothing going on currently right now as it's not moving or changing sensors you may not see anything in the lulls so go ahead and disconnect the no D MCU and we will place it on the power monitoring board just make sure and take note of the correct orientation on the power monitoring board before you do so they place the ESP 32 on the power monitoring board we'll go ahead and power it up you'll notice the green light turns on and depending on your ESP 32 you may get a on board led that will blink with the different statuses of ESP home you'll also notice we did go back online that way we can just go ahead and make all of our edits straight in the GUI and send straight over using OTA next we need to copy in some sensor information and you can get that from mice github file which I'll leave in the description you'll need a copy in the SPI because it's uses SPI to communicate with the two chips or the single chip as well for the two channel the pin number should be the same based on your ESP 32 should match up with the pins along the side which is marked on the board and also I'll use some substitutions up top so we don't have to keep typing the same name over and over just call this one digi 6e and we'll use an update time of 10 seconds now in this example this will be for these six channel boards so if you do have the two channel board you can use the same example that we have in the github it will be set up just for two channels and it's just a simplified version since it just has one power monitoring chip on the boards that are the two like this board has so once we paste that information in you'll notice I do have a Wi-Fi signal that updates every 60 seconds that's optional if you don't want to put that in yours you can see the CS pin which is part of SPI bus is on pin 5 for the first chip you'll notice if you scroll down you're gonna get CS pin 4 which is gonna be for the second chip in the other start of the platform it's a TM 9 0 III 2 that is the chip that does the power monitoring you can come in here and tweak this and I'm sure there'll be many other people that have found various other ways to change the sensors if you do do that please do share it back with us and that way we can update the github or and the description of the video to make it better for others in the future so for the gain voltage this is set for the 9 volt power supply if you are using a different power supplies such as a 12 volt AC power supply you will need to change the gain voltage and also to tweak it based on the voltage in your area now the gain CT is gonna be specific for each CT clamp you may find between different manufacturers CT clamps or even the same manufacturer just due to differences in the way they made it or whatnot you may have to some of these numbers to get him exactly right now how do you know what is right if you have a calibrated power monitoring plug such as a sawn-off s31 a sawn-off pal etc you could use that and say use it with a 60 watt old-school light bulb or something else some type of load that is a constant drawl that you can just turn it on and it's not gonna be something sega soldering iron it turns on and off you'll drive yourself crazy trying to calibrate this with a soldering iron or something else that's cycling on and off or if you want to make it really easy you can go to your local hardware store or you can order them online it's a clamp meter that you can just connect over the wire is simple you just push the little button clamp it over the wire and clip it down and it will show the amperage output on the LCD screen they're very simple to use it's very safe to use many of them also include volt meters and many other testing and just check with your local hardware store and see if you can get one of these or on Amazon or something like that so I've already calibrated these but I wanted to show you the process for calibrating these and how simple it is so instead of getting rid of this value we'll go ahead and copy and paste it and we'll comment it out we'll go ahead and start this value at ten thousand the way and hit save we can hit close just to make sure since we did paste in a lot of different things will go and hit validate it is valid we can go ahead and upload it on to the power monitoring board again since we're using OTA dr. connect it back up don't the disconnected because you don't want to connect usb to the power monitoring board at the same time that it is powered from the board itself so once it flashes and reboots you should notice now that you start to get the polling every 10 seconds of the to power monitoring chips you'll see the voltage you'll see the amps the frequency etc and now we'll go ahead and we'll want to tweak the amperage for the one clamp we put on there and you'll repeat this process for any type of clamps you do on these six channels of this board so at this point you could go in and do the integration part if you're using the API or just go ahead with MQTT in the unused entities and find your sensors that are now posted from this chip there we have it you can see inside of our unused entities we do have the six Ct amps along with the frequency for each side each chip along with the voltage so now we need to do a calibration to get our clamp on par now with CT clamps you can't just place the entire clamp over say an extension cord like this you won't get a valid reading or you may not even get a reading at all what you need to do is just be over one leg you can't be over the neutral and the load of the wire so this particular extension cord it does have three conductors and you can split them so whatever you can come up with to where you can just get over one leg of your cord for your calibration and you could just put the clamp over one leg of the extension cord like I've done here so you can see it's just over one leg of the extension cord and the ground and the neutrals on the other side now do note if you are using the internal wattage of the power monitoring board the orientation of forward or backwards will be based on the phase that you're connected to for the direction now if you do end up with some negative wattage you can't actually just go in and put a filter and multiply that by a negative one in ESP home to flip that wattage back around the other way now in the sixth channel we are going to be using just the voltage in the amperage to calculate our wattage now for this initial test we will be using just a standard sixty watt light bulb which of course in the u.s. given around one hundred and twenty volts sixty Watts that's going to do about half an amp of current draw as you can see on the amp meter we are pulling 0.49 amps which is pretty close to half and as it does jump around a little bit here and there we're gonna try to get this at half an amp with the calibration of the clamp now you can see on ESP home behind it it is showing point three two amps so we need to change that calibration to get that in line to being half an amp so really simple we'll go back to ESP home will edit the sketch and we'll go down to the first clamp in the gain is set at ten thousand again so we'll go ahead and see where we're at let's go ahead and do it to 13,000 and we'll hit save and we'll hit upload compile time should be much shorter because it doesn't have to compile all the libraries just to change that one calibration if you don't want to go straight into home assistant to look for your values you can since we did include the web server on the ESP 32 you should get a blue little square link that will jump you straight to the web server and show you the different states of sensors so we got 0.42 it's pretty close as you can see you just keep playing with this number and get it close to what you think is a good value for your clamp now of course the bigger load you put on it the more accurate is gonna be so for instance if you have say a 50 amp clamp if there's a way where you can put say a 10 or a 15 amp load on it a constant load you could get a much more precise calibration so we'll change this to 14,500 and we'll go ahead and upload it so see now that puts this 0.47 pretty close now I did calibrate some of these clamps using a about a 10 to 11 amp load and it got me a little more precision like I spoke of even with the light bulb so we're going to set this one to that 15,000 420 and we'll save it and we'll do an upload and once we did put that number in there you can see that puts us right at our 0.5 0 amp for this light bulb so pretty simple to do the calibrations it just takes some jumping around some guessing on some numbers and just how fine-tune do you want that for your particular device you're trying to monitor we did speak about before we are using some calculations to calculate the watts on the six channel board so what we can do is we just copy and paste in a template sensor which will take the CT 1 amps and multiply it by the volts with we don't need any decimal places now you can if you want decimal places on your wattage you can add them in there as well as changing the icon the name etc but if you want just copy it in like I did here and also if you're wanting to add two sensors together say for instance one example which I'm gonna do is say CT clamp 1 and 2 will be your mains power because I use a split phase here in the US and I want to see at a moment's glance just what the total amperage I'm using in the home but then I don't want to see CT clamp 3 4 5 and 6 in that same total because those will be sub circuits that I have that'll be already in that total so I'll what I'll do is just do another template sensor and add the amperage of CT 1 and CT 2 together which an ESP home makes it really flexible to do exactly what you want in the gamma file so upload that little change and we should get that new template sensor with the wattage based off of the voltage and the amperage now refresh the web server you can see it has the CT 1 Watts of 61 watts based off of that template sensor so pretty simple stuff now in an example we will show also a kilowatt-hour sensor and you can just copy and paste that in it will calculate your kilowatt hours for the date which is pretty cool so that's it for calibrating the power monitoring board if you got any questions definitely check out the video description and you can hit the link on the discord server and you can jump in and someone can help you if you get stuck on trying to calibrate something and I'm always in there as well so there you have it you can monitor your entire power home usage your solar usage various circuits etc really whatever you want to come up with and you can have some very power monitoring in your home we use it to monitor various circuits in the home and feed our graphs of the fauna which give us a lot of information about it our fingertips of all the various circuits I have one lighting circuit that's holding point to 9 amps and steadied if I go ahead and turn this dimmer on and you'll notice the percentage I'm turning the dimmer on is not that much and it's just three simple LED bulbs over the table now you'll notice we went up one tenth of an amp on that lighting circuit will jump to halfway and we jump up to 0.36 what a full brightness and we jump up to point 44 and you'll notice it's holding steady as well it's not jumping around there's no noise and we're back down to almost our original level of 0.2 9 which is where we started at what other power monitoring can you do with that with a 100 amp clamp measuring that power circuit that's simply amazing to me what that chip does with those CT clamps so don't be scared to check out this project I know we had to talk about a little safety issue but we just don't want anybody getting hurt definitely a very cool project check out all the various links in the description of the video it's a lot to take in at first but it's actually a very simple and very powerful project you can do in your home and it also does with ESP home which integrates directly into home assistant so I appreciate you watching this one definitely check out anything we have in the description of the video we will put any updates in there as things progress if you got any questions definitely give us a comment down below we'll get it answered give us a thumbs up if you like this video and also check us out on discord chat if you got anything else further you'd like to talk about thanks and y'all take care
Info
Channel: digiblurDIY
Views: 152,038
Rating: 4.9286799 out of 5
Keywords: esphome power monitoring, esphome SCT, esphome CT clamp, esphome circuitsetup, ATM90E32, home assistant whole home power, diy power monitoring, how to monitor home power usage, smarthome power monitor, kwh whole home, digiblurdiy, digiblur, esp32 power monitor, openenergy, opencms home assistant, hassio power, hassos power, solar monitoring, smart solar monitor, circuitsetup, shelly em, shellyem alternative
Id: BOgy6QbfeZk
Channel Id: undefined
Length: 30min 39sec (1839 seconds)
Published: Mon Jul 08 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.