Build your own CT Clamp Power and Energy Monitor with ESPHome

Sdílet
Vložit
  • čas přidán 26. 08. 2022
  • DIY Wi-Fi connected CT Clamp power monitor. Uses ESPHome and Home Assistant. Full article here: www.speaktothegeek.co.uk/2022...
    Buy me a coffee:
    www.buymeacoffee.com/speaktot...
    paypal.me/speaktothegeek
    D1 Mini: amzn.to/3bkrnTY
    Mains Current Sensor Module: ebay.us/J6cOPx (Affiliate Link)
    CT Clamp: www.amazon.co.uk/gp/search?ie...
    Mottram Labs: www.mottramlabs.com
    Online 3D Printing: craftcloud3d.com
    T-shirt from Qwertee: www.qwertee.com/r/b00ed24d1b
    As an Amazon Associate and member of the eBay Partner Network I earn from qualifying purchases. Most links above are affiliate links and I may earn a small commission from any purchases you make if you use them.
  • Věda a technologie

Komentáře • 176

  • @robrs210
    @robrs210 Před rokem +3

    Just spotted your how to. Already had the parts to put together, so thanks for your explanation

  • @hw5533
    @hw5533 Před rokem +3

    I have just ordered my parts and am eager to get this put together for use with my solar panels and home assistant.

  • @simonminnican
    @simonminnican Před 6 měsíci

    This is great, it's so simple and it works. All I have to do now is figure out how to convert the Home Assistant power graph into useable data to show me kWh/day, kWh/month etc.

    • @SpeakToTheGeekTech
      @SpeakToTheGeekTech  Před 6 měsíci +2

      Create a helper of the type 'Integration - Reimann Sum Integral' and use your power sensor as the source. That will give you a cumulative energy sensor. Once that starts to build up with data, you can then create more helpers of the type 'Utility Meter' using the new energy sensor as the source, and they can be on a daily/weekly/monthly cycle as required. I use a daily cycled utility meter sensor in my energy dashboard which gives you loads of graphs!

  • @haochen4252
    @haochen4252 Před rokem

    exactly what i want!!! thank you very much

  • @juliancouch8633
    @juliancouch8633 Před rokem +1

    Very educating!

  • @eclecticlife
    @eclecticlife Před rokem +1

    Brilliant!

  • @Hwrrobotics
    @Hwrrobotics Před rokem +2

    Great video! If you ever wanted to get into 3d printing an ender 3 is like 150 American pesos.

  • @atfiqdr
    @atfiqdr Před rokem

    Brilliant video - And subscribed :)

  • @markvk42
    @markvk42 Před rokem

    Thanks very much for the video, ive bought 5 4 gang boards from mottram and 20 CT clamps, now all i need to do is figure out the programming for it! HINT HINT ;)

    • @SpeakToTheGeekTech
      @SpeakToTheGeekTech  Před rokem

      Don’t forget that these clamps can only detect uni-directional current. They don’t know if you’re importing or exporting. As for configuring the multi socket modules, there was already a great article on the web showing you how to use the multiplexed signals (ryanteck.uk) but that site is down right now :( You need to configure an ADS1115 sensor instead of an ADC sensor, and then each clamp is a separate multiplex on the ADS1115 bus.

    • @olahe97
      @olahe97 Před měsícem

      Did you figure it out? I am also doing a 20 CT clamp project.

    • @markvk42
      @markvk42 Před měsícem

      @@olahe97 i got it sort of working but ran out of time and so i bought an emporia. I managed to get it linked up to HA but could only get one Chanel to work properly. All 4 channels read the same as channel 1. im going to re visit it next week to try and get it working, ill let you know how i get on.

  • @nikhilps5234
    @nikhilps5234 Před rokem +1

    Thankyou

  • @salicosta5582
    @salicosta5582 Před 7 měsíci

    Very nice video, very good ideas. I need one. Put at this export costs from the UK, Impossible, If they had a cheaper way, this products would be a self runner

    • @SpeakToTheGeekTech
      @SpeakToTheGeekTech  Před 7 měsíci

      The blueprint is on the seller's web site (www.mottramlabs.com) so there's nothing to stop you buying the components and making up your own on a breadboard. It won't be as polished and requires a bit of soldering, but it's not impossible.

  • @sisbandung3798
    @sisbandung3798 Před rokem

    Great Video...Top

  • @georgec2932
    @georgec2932 Před rokem

    Just to follow up on my previous post, I got all this working last night. Few things I ran into but found solutions for. Was having wifi connection issues until I set a static IP address by adding the following code in the wifi section:
    # Optional manual IP
    manual_ip:
    static_ip: 192.168.50.123
    gateway: 192.168.50.1
    subnet: 255.255.255.0
    In order to get the sensor to track daily usage and show up in the HA Energy Dashboard I had to also add the following:
    # Example configuration entry for energy tracking
    - platform: total_daily_energy
    name: "Total Daily Power"
    power_id: power_sensor_live_power
    # Enable time component to reset energy at midnight
    time:
    - platform: sntp
    id: my_time
    I've calibrated using multiple methods and my calibration values aren't too different to yours. Thanks again for your help. I've subscribed :)

  • @AndrewEbling
    @AndrewEbling Před rokem +3

    Nice video - thanks! Could you even make your own CT clamp by manually wrapping a few meters of wire around the cable in question and soldering on the jack?
    BTW I have a 3D printer and will happily print anything you need for future videos - just my way of saying thanks and giving something back for all the great videos.

    • @SpeakToTheGeekTech
      @SpeakToTheGeekTech  Před rokem

      Thank you, that's very kind of you! I'll let you know if any interesting projects require 3D printing :) There are none planned right now but I'm sure I'll think of something.

  • @Omobilo
    @Omobilo Před rokem +2

    Nice. Wondering if we wanted to many more than one only clamped (just before the fuse breakers ~ 16 of them), what kit maybe best to consider if such exists if you maybe know?
    Above will get the per section of house readings, so wanted to get a bunch of smart-plugs to zoom in to each appliance also. Any suggestions how to build these smart plug kits at low cost since I need quite a number?

    • @SpeakToTheGeekTech
      @SpeakToTheGeekTech  Před rokem +3

      The same company (Mottram Labs) which supplies the Mains Power Sensor board also sell a 4-channel Mains Power Sensor board. Same principle as in my video, only there's four 3.5mm jacks for CT clamps. This could be a good option. If you'd prefer something more off-the-shelf then you might want to look at the Shelly 3EM which can monitor three live cables simultaneously. As for creating your own smart plugs, I can't advise on doing that for safety reasons. I personally prefer to use either Z-wave or Zigbee power-monitoring smart plugs (such as these zigbee ones: amzn.to/3VqSeQE), or you can go for one of the many WiFi smart plugs that offer power monitoring too from Amazon for under £10 each. I think you'd struggle to make them yourself for that small amount anyway!

  • @odeds358
    @odeds358 Před 6 měsíci

    Thanks,
    Could you do video that explain how to connect to HA module with RS485 , like CT clamp?

  • @CreaturaN
    @CreaturaN Před rokem

    Hey there, i have CT clap 100A/1V and even after calibrate i still have different value.

  • @georgec2932
    @georgec2932 Před rokem +4

    Hi, great video. I’ve ordered the parts (used your links), just waiting for the Mottram PCB to arrive now. Do you have a link to the steps followed and code used to program the device? I’m new to HA but understand you’ve used the ESP Home integration in HA? If you could explain the steps it would be much appreciated.

    • @SpeakToTheGeekTech
      @SpeakToTheGeekTech  Před rokem +3

      Hi - the link to the code I used is on my web site (www.speaktothegeek.co.uk/2022/08/esphome-ct-clamp-power-and-energy-monitor/). I assume you already have ESPHome installed in Home Assistant? If not, that's your first step. Depending on how you are running Home Assistant, you either install it as an add-on in the add-on store (easiest way if you are using the 'supervised' version of Home Assistant), or you'll need to manually spin up a container somewhere to run it. To program the device, you create a new device in ESPHome (any settings will do to start with), then edit the configuration manually and paste mine over. You'll need to have set up some secrets (see the items prefixed with !) in the Secrets page of ESPHome for things like Wifi passwords / other passwords. You can then plug your microcontroller into your laptop using a microUSB cable. Use Chrome (or you may get issues), and you should be able to use the 'install' option in ESPHome to connect directly to the locally connected microcontroller. How to use ESPHome is probably worthy of a video in itself and there are plenty of starter guides out there. I might do one myself soon...

    • @georgec2932
      @georgec2932 Před rokem +2

      @@SpeakToTheGeekTech thanks so much for the detailed response. Doh, I’ve scrolled through so many pages of documentation over the past few days, I totally missed the code, sorry! The 3 x D1 minis I ordered via the amazon link came today, they don’t have the headers soldered on but I’ve got a soldering iron and it adds a bit of fun to the project. In terms of calibration, I have an idea to use a hand held current clamp meter. I know some use things like a kettle, but my logic is measuring the mains feed I actually want to monitor should give me a more accurate calibration? Thanks again, I’ll let you know how I get on!

  • @hw5533
    @hw5533 Před rokem

    After hours of configuration hell I thought I'd share my experience.
    I have the docker version of Home Assistant (as will a lot of people trying this) and it is 'unsupervised'. This means I am unable to install the esphome add-on, or any add-ons at all.
    You will only need this add-on when you are configuring the esp module so I decided to spin up full version of Home Assistant (supervised) on a VirtualBox VM. From there I was able to properly configure the device to connect to wifi and function correctly. I treated it as a temporary development server just to get the config correct.
    The next stage for me is calibrating the electricity usage to work with the output of my solar panel inverter.
    You could also configure the esp module through the command line (as suggested on the esphome website) but I could not get the wifi connection working using this method.

    • @hw5533
      @hw5533 Před rokem

      Calibration didn't work for me. The amps just didn't show up. I've ordered a more up to date Mottram board off ebay to see if I can get it going.

    • @SpeakToTheGeekTech
      @SpeakToTheGeekTech  Před rokem +2

      Do you have the CT clamp around just a single core (live) cable, or around a flex (triple core) cable? If there's a live and neutral running through the same cable that you have the clamp around then no current will be shown (the neutral cancels out the live).

    • @hw5533
      @hw5533 Před rokem

      @@SpeakToTheGeekTech I'll look into this. Thanks so much.

    • @hw5533
      @hw5533 Před rokem +1

      @@SpeakToTheGeekTech I am learning a lot while I do this... I have been frustrated that my CT sensor hasn't been reading anything when it should! It turns out that my 50ma current sensor (like yours) was actually the other model that works on voltage and had been labelled incorrectly from the manufacturer!

  • @oliverwaits8174
    @oliverwaits8174 Před 9 měsíci

    Great video to help get started with this. My stumbling block though with this has been how do you power it. I dont have power in my meter cupboard and I guess most people dont. I had thought I could use batteries but aparently these drain very quickly. Does anyone have thoughts on this. ESPHome seems perfect but there is very little on how you power the devices.

    • @SpeakToTheGeekTech
      @SpeakToTheGeekTech  Před 9 měsíci

      If you are using this on your grid feed and there's a chance you could be exporting then you may want to look at a different product. This solution can't tell which direction the current is travelling. As for battery powering, the code was written on the assumption it would be powered by a mains supply. In order to save battery power then it would need tweaking to measure less often and sleep in between. You could probably reduce its overall power consumption to 25% as a rough guess by optimising it that way.

  • @johnlatham6056
    @johnlatham6056 Před 8 měsíci

    I've been wondering about the issue with measuring the current for standard triple core cabled devices. Would it make sense/work to have a short (1m) extension cable with a short section with 3 coated wires exposed and the CT clamp around the live. Then have the D1 powered from a USB adapter on the extension. I know you are then measuring the devices current at the same time but would it be negligable enough to ignore (or calculate out)? Or am I talking nonsense?

    • @SpeakToTheGeekTech
      @SpeakToTheGeekTech  Před 8 měsíci

      Exposing the cores individually and putting the CT around one of them is the only way to monitor it. Of course that’s not particularly safe in some circumstances so I’d suggest doing that inside a protective casing or wiring box.

  • @ChristopherGaul
    @ChristopherGaul Před rokem +6

    Nice video. Well explained.
    One caveat. It's been my experience that the ADC on the ESP8266 is complete crap. I'd either use an external I2C ADC or use the ESP32 instead.

    • @SpeakToTheGeekTech
      @SpeakToTheGeekTech  Před rokem +2

      You're probably right. There is no ESP32-friendly version of this add-on board though so it would make the project trickier and less neat for beginners certainly. There is a 4-channel version of the ESP8266 board with an external ADC (ebay.us/wE7aJZ) which would be more accurate, and looking at the Mottramlabs web site there's a 4-channel ESP32 board 'coming soon' now too!

    • @icarossavvides2641
      @icarossavvides2641 Před rokem +3

      You REALLY need to explain why you feel the ESP32 ADC is 'crap', as you so quaintly put it, and in what context. Is it noise, resolution, LSB uncertainty, drift? It doesn't help anyone just saying it's 'crap', some shortcomings, after all, are irrelevant depending on context?

    • @ChristopherGaul
      @ChristopherGaul Před rokem +1

      @icarossavvides2641 Well, the ADC on the ESP8266 is about as good as your reading and comprehension skills.

  • @michaeltodd17
    @michaeltodd17 Před rokem

    Is the calibration for the device or the set up (I.e. wire thickness / position)? My smets1 device has gone back to being dumb & bulb seem useless at doing anything so thinking maybe clamp to monitor energy, but as I can't tell total house usage atm I'd only be able to calibrate it to an individual item (kettle, electric fan heater, etc.) Connected to a smart socket & then move it to be connected around main cable into my house

    • @SpeakToTheGeekTech
      @SpeakToTheGeekTech  Před rokem

      It calibrates the sensor and device rather than the item it’s connected to. Keep in mind it only senses import current and is only ballpark accurate. Useful for knowing if there’s nothing / little bit / loads of power for the average curious Home automationist, just don’t rely on it to compare against your bills.

  • @letmelooktv
    @letmelooktv Před rokem

    can I have two of these, one measuring current and one measuring voltage to get the needed readings to do accurate monitoring?

    • @SpeakToTheGeekTech
      @SpeakToTheGeekTech  Před rokem +1

      These only measure current. You need a different type of sensor to measure voltage.

  • @stevejudyrobinson1771

    @Speak to the Geek Great video as are all of yours I have watched. This project took my fancy as I am having my Solar Edge system fitted next week. All went great (ordering, soldering etc.) then when I pressed the button to upload I got the error; "Failed to initialize. Try resetting your device or holding the BOOT button while selecting your serial port until it starts preparing the installation". I have searched the web, downloaded the e-book from AZ-Delivery about the D1 mini but cannot find a way out of it. First problem was needing an HTTPS connection but solved that by installing a Cloudflare tunnel. Any suggestions or am I just being thick! I even ordered some more D1-mini's just in case I had blown the first one up with my soldering. But get the same error with those. Really frustrating as I want to build my HA power dashboard. HELP please.

    • @SpeakToTheGeekTech
      @SpeakToTheGeekTech  Před rokem +1

      Hi, there could be several reasons for that message but the most common ones I've come across are either a dodgy micro-USB cable, a missing serial driver on your computer, or an incompatible web browser. On a Mac, you used to have to install a serial driver but it's now included, I don't use Windows but there is a serial driver available for it on their web site (www.wemos.cc/en/latest/d1/d1_mini.html). Use Chrome (not Safari or Firefox) as that makes a difference too. You could also try compiling the file locally on your Home Assistant installation, downloading it, then using the ESPHome Web Tool to push it to your D1 mini (web.esphome.io). Hopefully at least one of those suggestions will help you out.

    • @stevejudyrobinson1771
      @stevejudyrobinson1771 Před rokem

      @@SpeakToTheGeekTech Thanks very much for the reply, but the problem was me being an idiot! I was connecting the D1 to the laptop I was connecting to HA with, rather than connecting it to the Thin Client PC that has HA installed on it (doh). It wouldn't compile at first but when I connected the two boards together it went through successfully with your yaml script.
      So, once again thanks for all the videos and please keep us informed about anything you learn about controlling Solar Edge kit. The reason I went for the expensive SE option was that I thought I could control everything with HA but it appears not. We will see....

  • @chriscodes1
    @chriscodes1 Před 11 měsíci

    Hi! I recently purchased the 4 port esp32 version of the mottramlabs board along with a esp32 version of the d1 mini. Soldered pins, plugged it in, got it into HA through esphome and all connected up... however I can't seem to get ct clamp readings. I had to write up my own yaml file for it and my question is, did you have to do the same or did your d1 mini recognise the mottram esp8266 board automatically and create the yaml file with that in that is on your website? I'm hoping this might point me in the direction as to whether it's actually recognising the mottram board!

    • @SpeakToTheGeekTech
      @SpeakToTheGeekTech  Před 11 měsíci

      There's no auto-detection, you have to specifically configure it in the yaml file. The yaml file on my web site is one I created myself. However some of the 4-channel versions actually use an external ADS1115 multiplexer, so you configure them to talk to the CTs using a multiplexed channel on the ADS1115 (esphome.io/components/sensor/ads1115.html). The ESP32 version of the 4-channel board actually looks like it's using the ESP32's built in A/D with each one connected to its own pin. The schematic here shows which pins are on which channel. www.mottramlabs.com/pdf/SCH201191.pdf

    • @chriscodes1
      @chriscodes1 Před 11 měsíci

      @@SpeakToTheGeekTech Ahh that makes much more sense, I’ll crack on with giving it a good go! Thank you so much for the pointers!

    • @chriscodes1
      @chriscodes1 Před 11 měsíci

      @@SpeakToTheGeekTechUpdate: got it all up and running! Although readings are unbelievably erratic so definitely some more issues to solve.

  • @miguelbaca8086
    @miguelbaca8086 Před 11 měsíci

    Are these clamps able to measure direction of the current as well? Like if you’re exporting solar power would it measure a negative current?

    • @SpeakToTheGeekTech
      @SpeakToTheGeekTech  Před 11 měsíci +1

      No, sorry, they're no good for that, just uni-directional flows.

  • @wattokins
    @wattokins Před rokem

    I'm new to HA and ESP home, just trying to get some electrical usage data. I've been trying to get the single CT working but having some yaml errors. I have imported your code but its saying there's an error with the entity_id on the sensor, any thoughts?
    Also I saw you had your solar edge inverter on HA and a myenergi input, is this through a CTor have you managed to get the api working from them, id love to get both of mine on HA too
    thanks in advance

    • @SpeakToTheGeekTech
      @SpeakToTheGeekTech  Před rokem

      The ESPHome config requires you to either pass it an entity from Home Assistant with your home’s voltage in (line 5) or hard code a value of say 240 on line 59 instead of where it says “id(grid_voltage).state”. If you are hard coding a value, also delete lines 42-47.
      My SolarEdge inverter is connected to Home Assistant using the SolarEdge Modbus integration. I use the voltage sensor from this integration in my ESPHome CT Clamp configuration. Have a look at this article to see how I’ve done that: www.speaktothegeek.co.uk/2022/05/solaredge-hd-wave-se3680h-and-home-assistant-local-integration/
      To get that working, you’ll need HACS installed in Home Assistant and I have a video on how to do that here:
      czcams.com/video/jzpm89956Pw/video.html
      MyEnergi is via the integration also available in HACS, and I have an article all about the Eddi. If you have another MyEnergi product, it’s the same process - just scroll down to the section about Home Assistant: www.speaktothegeek.co.uk/2022/10/myenergi-eddi-and-home-assistant/

  • @typxxilps
    @typxxilps Před rokem

    Thanks brexit, mathlabs are not shipping to germany.
    So I have to search for another source somewhere around the globe and I guess there will be other competitors delivering to germany.
    But great video, very well thought through and put together. Thanks

    • @SpeakToTheGeekTech
      @SpeakToTheGeekTech  Před rokem

      That's a shame. Mottramlabs publish the schematic so if you wanted to get one made using that then you could. A lot of effort though.

    • @weeeeehhhhh
      @weeeeehhhhh Před 6 měsíci

      @@SpeakToTheGeekTech I'm working on it now

  • @taosjay
    @taosjay Před 5 měsíci

    I wan't to monitor the DC output from my Outback FM60 charge controllers. Can this work with DC? Maybe with a different ct clamp?

    • @SpeakToTheGeekTech
      @SpeakToTheGeekTech  Před 5 měsíci

      To my knowledge this only works with AC but you’d be best off contacting the seller to find out details like that

  • @andrewburgess456
    @andrewburgess456 Před rokem +1

    Hi and thanks for this video.
    Can you please explain how to add this to the energy dashboard.

    • @SpeakToTheGeekTech
      @SpeakToTheGeekTech  Před rokem +1

      Sure - you need to create an 'integration' helper from the power sensor. Settings > Devices & Services > Helpers. Click the create helper button, "Integration - Riemann sum integral", choose the CT clamp power entity as the input sensor. You can then use that sensor in the energy dashboard, but I suggest you then create another helper of type "Utility Meter" and use the new Integration sensor as the source entity. You can then set the Meter Reset Cycle to one day, and use that utility meter in your energy dashboard.

    • @andrewburgess456
      @andrewburgess456 Před rokem

      @@SpeakToTheGeekTech OK I'll give that a try. Thanks so much for the reply

  • @chriswoolvin7284
    @chriswoolvin7284 Před rokem +1

    Might you have a more scalable suggestion? I'd like to do each circuit in my circuit breaker box.

    • @SpeakToTheGeekTech
      @SpeakToTheGeekTech  Před rokem

      Mottram Labs also sell a 4 channel version of the current sensor module, but if I were looking to monitor a larger number of circuits then I'd probably go for a Shelly EM (or 3EM) instead. I would suggest that this build-your-own method is for 'casual' monitoring.

    • @chrishorn1032
      @chrishorn1032 Před rokem

      @@SpeakToTheGeekTech Thanks, just to follow on from this, the Shelly EM only does 2 circuits (there's a 4 but overkill and limited total amps). Mottram Labs does 2 versions, one which uses the ESP8266's own A/D for measurement, the other has an onboard ADS1115 A/D converter is provided for the measurement (15 bit), any preference (like which would/might be easier)? A 4 circuit version could work if you're only looking to track the biggies- say heat pump, solar, car harger- and (time)-manage the loads, I personally wouldn't be looking to track every light bulb.

    • @SpeakToTheGeekTech
      @SpeakToTheGeekTech  Před rokem

      I've not actually tried the one with a onboard A/D converter yet. When I get chance I will order one and give it a go. I'm interested to see the difference, but it's just one of those things I've not got around to yet.

    • @chriswoolvin7284
      @chriswoolvin7284 Před rokem +1

      @@chrishorn1032 I would like to monitor every single appliance but will likely settle for each breaker. thanks for the feedback

  • @awdhootkanawade
    @awdhootkanawade Před 3 měsíci

    3d printers are cheap nowadays for like 5-6 prints from that site you can buy your own printer

    • @SpeakToTheGeekTech
      @SpeakToTheGeekTech  Před 3 měsíci +1

      Yeah maybe, but they take up space and power and for the three time perhaps that I could have made use of one so far I think it would have been a waste. Still maybe I’ll change my mind!

  • @darknessblades
    @darknessblades Před 2 měsíci

    I would suggest a small upgrade to the PCB design, see if you can get more PCB's inside a 10x10cm panel. with snapp-off lines.
    this way you can get more PCB's for the same price.

  • @scoobyru84
    @scoobyru84 Před rokem

    Thank you for the video is there a way to set it up so it can tell u what ur using hrly and daily money wise ? tyia

    • @SpeakToTheGeekTech
      @SpeakToTheGeekTech  Před rokem +2

      There certainly is. You need to turn the power sensor into an energy sensor first by going to Settings > Devices & Services > Helpers, clicking the Create Helper button, choose Integration - Riemann sum integral, and choose the CT clamp power sensor as the input. Then you need to create a Utility Meter helper sensor (similar way to the Integration sensor), using the new Integration Energy sensor as the input. You can configure the meter reset cycle to be daily, monthly, yearly, etc... You can also then use a daily utility meter sensor in the Energy Dashboard if you like, and the Energy Dashboard can calculate the cost for you too.

    • @scoobyru84
      @scoobyru84 Před rokem

      @@SpeakToTheGeekTech excellent thanks so much!

  • @awesomedee5421
    @awesomedee5421 Před rokem

    You didn't mention why it is soo important to use the SCT-013-000 clamp. Can I not use a more accurate clamp that has a 3.5" stereo jack on it?

    • @SpeakToTheGeekTech
      @SpeakToTheGeekTech  Před rokem

      It's because that's specifically the CT clamp that the board was designed for. To find out if other CT clamps would work you would need to contact the designer/seller of the board. I couldn't tell you the electronic reasons behind that though sorry.

  • @awesomedee5421
    @awesomedee5421 Před rokem +1

    How are you reading the voltage . or more specifically, how are you having Home Assistant read the voltage. I thought you only had the CT clamp on there over 1 of the legs. so is there a PT over the two legs? In the USA, we use split phase, so our 240V can have different currents on each leg. which means we really need 2 CT clamps -- one for each of the hot legs. But I don't see any mention of anything else measuring the voltage. and that would make it pretty crowded in there having 2 CT clamps, and 2 PT clamps.

    • @SpeakToTheGeekTech
      @SpeakToTheGeekTech  Před rokem +1

      I'm sure I mention in the video that you can either hard code a value for the average expected voltage, or provide the configuration with a Home Assistant entity that is tracking the voltage for you. I use a 'grid voltage' entity provided by my solar inverter. The energy monitor project is only intended to be roughly accurate and isn't a high accuracy component. For that you would need something hard wired inline to do this properly. For hobbyists who just want to know if there's roughly nothing, 100w, or 2.5kW going through the wire, it's ideal and cheap to make.

    • @awesomedee5421
      @awesomedee5421 Před rokem +1

      @@SpeakToTheGeekTech thanks for the quick reply. You did mention it in the video that you can get it from that variable or hard code a value in there. I just didn't understand how that variable voltage info was getting populated. I guess for me, I can make another ESP8266 device and plug it into a 240V outlet with PT clamps, and send the voltage info that way.

    • @SpeakToTheGeekTech
      @SpeakToTheGeekTech  Před rokem +1

      Yes that is a possible option, but you’re starting to move into the realms of this become more expensive to the point where you may be better off buying a calibrated commercial product rather than these self build ones. Unless you’re doing it for that build!

    • @awesomedee5421
      @awesomedee5421 Před rokem +1

      @@SpeakToTheGeekTech I'm doing it because I don't know of any calibrated commercial wireless products.

    • @SpeakToTheGeekTech
      @SpeakToTheGeekTech  Před rokem

      Have you seen the Shelly EM products? They are hard-wired to the mains to get the voltage, use a CT clamp for monitoring current, and connect over WiFi.

  • @jamesabbott9606
    @jamesabbott9606 Před 6 měsíci +1

    Brilliant video! How would I change the measurement into kw instead of watts?

    • @SpeakToTheGeekTech
      @SpeakToTheGeekTech  Před 6 měsíci +1

      The easiest way is to just edit the sensor in Home Assistant and change the units there, but you could do it in ESPHome instead and divide the output sensor value by 1000 before sending

    • @jamesabbott9606
      @jamesabbott9606 Před 6 měsíci

      Im trying the work out how much its costing me to run my heat pump, is there away I can show this data in kWh?@@SpeakToTheGeekTech

    • @SpeakToTheGeekTech
      @SpeakToTheGeekTech  Před 6 měsíci +1

      @@jamesabbott9606 Yes, create a new helper of type 'Integration - Riemann sum integral' and use the power sensor as the source.

    • @jamesabbott9606
      @jamesabbott9606 Před 6 měsíci

      That's brilliant! thanks, Ive used your other video on off peak tariffs, so I can work out my heat pump cost either off peak or peak! Ive also ordered the glow CAD, so im watching your video on how to set that up@@SpeakToTheGeekTech

  • @seanreidy3401
    @seanreidy3401 Před rokem

    What's is the best power it?, If I place this in my consumer unit or meter box.
    Dose the power comes from the CT clamp, like on the hi end model?
    Thanks in advance

    • @SpeakToTheGeekTech
      @SpeakToTheGeekTech  Před rokem +1

      This is powered by a 5v microUSB cable. With some adjustments to the code to reduce how often readings are taken and to put the device to sleep in between readings, it would be possible to run from a battery pack instead. I don't know how we'd go about harvesting energy from the CT clamp, that's a bit beyond my electronics know-how at the moment!

    • @seanreidy3401
      @seanreidy3401 Před rokem

      @@SpeakToTheGeekTech thanks for the info.

  • @Heneyspanicker
    @Heneyspanicker Před 10 měsíci

    Can CT Clamp use to find direction of current such as solar export?

  • @laurenceblair2824
    @laurenceblair2824 Před rokem

    Fascinating video! I’m hoping to do a similar project but send the data to a cloud based application. Do you know how to connect via an MQTT broker via Wi-Fi router instead of ESPhome or gateway?

    • @SpeakToTheGeekTech
      @SpeakToTheGeekTech  Před rokem +1

      The short answer is no! But I have dabbled with ESP devices before ESPHome came along and the long route is to use the Arduino IDE, import the external libraries you might need (which will be lots!), and program the board manually using C++. I like ESPHome because it removes the need for most of that and you can just get on with configuring the board with exactly what you want to achieve rather than having to work out which libraries need importing. You can use ESPHome to to what you require too. You enable the MQTT client option (esphome.io/components/mqtt.html) and disable the Home Assistant API. However, I'd argue if you're using ESPHome to do that, you already have Home Assistant, so why not just run your own MQTT server locally on that. I guess it's all down to your own preferences but using native Arduino IDE has a much steeper learning curve.

    • @laurenceblair2824
      @laurenceblair2824 Před rokem

      @@SpeakToTheGeekTech thank you for responding so quickly. I didn’t realise I could use Home Assistant to host an MQTT server, so long as my computer doesn’t need to stay on 24/7, that would be perfect for my needs. Already used your links and bought 5 sets of everything in case I make a mess of the first couple attempts.

  • @tonybond8344
    @tonybond8344 Před rokem

    Thanks for the great video, I was wondering what will be displayed in home assistant if you a contributing to the grid. i.e. your solar panels are producing more than you consume ?

    • @SpeakToTheGeekTech
      @SpeakToTheGeekTech  Před rokem +1

      This particular implementation will only ever show a positive power value so you wouldn't be able to tell whether you are importing or exporting using it. When I get chance I'll take another look at the raw data and see if there's any way of updating the configuration to output that properly.

    • @vaughanthompson3717
      @vaughanthompson3717 Před rokem

      @@SpeakToTheGeekTech A great video and just what I was looking for to monitor my solar power export to the grid to help size a home battery. But that will need me to be able to record both positive and negative currents. Have there been any developments since your reply to Tony, and would it be possible to work around by having two sensors on the same cable: one to measure import and one to measure export? Many thanks.

    • @SpeakToTheGeekTech
      @SpeakToTheGeekTech  Před rokem +1

      I've done a bit of reading on the subject and from what I now understand in order to work out the direction of the current you need to monitor the AC phase, and that would have to be done in realtime by another physical sensor attached to the microcontroller... which doesn't exist on this particular break-out board. By this logic, that must mean that only mains connected power monitors are able to detect direction. Honestly, I'm still not entirely sure what sort of component is required in order to do this, but I haven't given up yet. If I ever figure it out though you can guarantee it'll appear in a video!

    • @vaughanthompson3717
      @vaughanthompson3717 Před rokem

      @@SpeakToTheGeekTech Many thanks for that helpful reply. I now understand that the CT clamp will only give the magnitude of the current and will not distiguish between directions. However my solar panels have a SMC invertor which gives me regular power readings via bluetooth (average power over 10 minute intervals) to a monitor. I can download the data to my PC. So if I combine this with CT readings, I can split the latter into export and import parts (if(solar>CT, CT = export; if solar

    • @SpeakToTheGeekTech
      @SpeakToTheGeekTech  Před rokem +1

      That’s some brilliant logic to get that result. I guess it’s very specific to your setup though but could be adapted for other setups. I have mine monitoring my battery EPS output which can only ever be in one direction due to this limitation, but with some careful thinking like you’ve done I might be able to put it on another feed that’s bidirectional

  • @aufbau-seitsechzehnnullzwo8045

    Does it get the current direction right?
    If so has anyone got an idea how it does?

  • @karlroberts9046
    @karlroberts9046 Před rokem

    Hi, do you have a link to the 3d printer file for the case? I can't find it on the mottram site

    • @SpeakToTheGeekTech
      @SpeakToTheGeekTech  Před rokem

      If you look on the ESP8266/32 page (www.mottramlabs.com/esp_products.html) the second device down (Wemos D1 Mini ESP8266 Mains Power Sensor), there is a button named '3D Files': www.mottramlabs.com/files/Wemos_Case_201083.zip or third item down for the none-SMD version: www.thingiverse.com/thing:3169243

    • @karlroberts9046
      @karlroberts9046 Před rokem

      @@SpeakToTheGeekTech thank you very much

  • @Reudiga
    @Reudiga Před rokem

    Did you know where to buy Mottram Labs in EU (Germany)? Saw that is only available in UK :/

    • @SpeakToTheGeekTech
      @SpeakToTheGeekTech  Před rokem

      I'm sorry, there is only one maker and seller of this item and for some reason they have chosen to exclude Germany from their shipping destinations. I'm not sure why as they ship to other EU countries.

    • @Reudiga
      @Reudiga Před rokem

      @@SpeakToTheGeekTech Shit :( Did they have an email? So probably i can write them or did you have another company for that?

    • @Reudiga
      @Reudiga Před rokem

      @@SpeakToTheGeekTech Is it probably possible that you buy me some and send it to me? :)

  • @MrSilvann
    @MrSilvann Před rokem

    My readings do not match what portable smart meter display is showing. With low load difference is higher and with higher load difference is going to be lower.

  • @fgregerfeaxcwfeffece
    @fgregerfeaxcwfeffece Před 6 měsíci +1

    "Won't be quite so accurate"
    yeah, about that. If you really wanna hardcode it I would go for ~235 or even slightly lower. Because in my experience it's usually closer to 220 then it is to 240. And especially during high load times it goes more towards the low end.
    Or take a separate average over a week from that phase. Smartplugs can do that.

  • @MaxGoddur
    @MaxGoddur Před rokem

    I see a "buy you a coffee" in your future. My attempts to get a stepper motor working via ESPhome within Home Assistant working have failed. Now to be honest and admit how dumb I will sound I did have it working. What happened well my server crashed and I did not back up the YAML files and the addition to the configuration. YAML. So have you ever tried to get the following to work in ESPhome:
    5V 28BYJ-48 stepper motor
    ULN2003 stepper motor driver
    As mentioned I did have it working and was able to pan my camera mounted out front of my home left and right. (3D printed the gear box that the camera was mounted on). Since then have tried to get it working but can't remember how I did it.
    Any help you might care to toss my way is welcomed.
    Enjoyed your video love the one on the clamp-on power setup I had one for my washer.

    • @SpeakToTheGeekTech
      @SpeakToTheGeekTech  Před rokem

      Hi- I haven’t used any stepper motors at all yet, sorry. I do want to try that out but I need to think of a use-case for it first! ESPHome’s web site has a specific section just for the ULN2003 (esphome.io/components/stepper). It looks straightforward to me, but then again these things never go to plan! The control of it by Home Assistant looks very similar to the way you control a servo like the one I used in my WiFi Water Pistol video.

    • @MaxGoddur
      @MaxGoddur Před rokem

      @@SpeakToTheGeekTech will order one from ALiexpress and have it mailed to you so you can try to get it working. Just looking to share the pain I guess. BTW that link you posted is broken and FYI.

  • @XcOM9871
    @XcOM9871 Před 8 měsíci

    How are you putting the ESP in to bootloader mode, I bought the AZ Delivery one you recommended, I looked at the docs and it says to pull D3 low for bootloader mode, I have shorted D3 to GND, but it refuses to let me flash it, I've also installed the drivers from their website.

    • @SpeakToTheGeekTech
      @SpeakToTheGeekTech  Před 8 měsíci +1

      I didn’t do anything special at all. I plugged it into my Home Assistant server (Raspberry Pi) using microusb and used the ESPHome interface to flash it. No shorting of pins was required.

    • @XcOM9871
      @XcOM9871 Před 8 měsíci

      @@SpeakToTheGeekTech - It's fine thanks, managed to flash it in the end, something on the machine I was using didn't like it, but in other news, I can't get the clamp to read anything, constantly showing as 0w

    • @XcOM9871
      @XcOM9871 Před 8 měsíci

      All I keep getting is this:
      [15:22:59][D][homeassistant.sensor:024]: 'sensor.shellyplus1pm_441793a76958_switch_0_voltage': Got state 241.70
      [15:22:59][D][sensor:093]: 'Grid Voltage Entity from Home Assistant': Sending state 241.70000 with 1 decimals of accuracy
      [15:23:01][D][ct_clamp:040]: 'Power Sensor Live Power' - Raw AC Value: 0.000A after 188 different samples (940 SPS)
      [15:23:01][D][sensor:093]: 'Power Sensor Live Power': Sending state 0.00000 W with 0 decimals of accuracy

    • @SpeakToTheGeekTech
      @SpeakToTheGeekTech  Před 8 měsíci

      Do you have the clamp around just a single live core or have you clipped it around a three core wire with neutral in too? Did you get the exact same model number CT clamp in this video?

    • @XcOM9871
      @XcOM9871 Před 7 měsíci

      @@SpeakToTheGeekTech It's clamped around a 3 core cable, I've bought 2, both the same model (SCT-013-000 - 100A/50mA), does it need to be around live only?

  • @uselessproductions2364
    @uselessproductions2364 Před 10 měsíci

    I don't understand how you were able to use a sensor that outputs current by measuring voltage and then with your calculation.

    • @weeeeehhhhh
      @weeeeehhhhh Před 6 měsíci

      The PCB has a specific resistor. The sensor output is a current source and puts a current through the resistor that is proportional to the current measured in the cable.
      The micro ADC measures the voltage drop across the resistor and uses ohms law to calculate the output current.

  • @abdullahX001
    @abdullahX001 Před rokem

    Any idea how to monitor gas energy usage?

    • @SpeakToTheGeekTech
      @SpeakToTheGeekTech  Před rokem

      If you're in the UK and have a smart meter, you can get that information by using Glow. You might be able to get gas energy data for free using their API or from their Glow IHD which is what I use czcams.com/video/6MiZ2EMajnA/video.html

    • @jelenpiaggio3749
      @jelenpiaggio3749 Před 10 měsíci

      There was a project based on esp32 and ai to read hardware digi

  • @bazcurtis178
    @bazcurtis178 Před rokem

    Do you know where you can get a D1 pre soldered?

    • @SpeakToTheGeekTech
      @SpeakToTheGeekTech  Před rokem

      There used to be a few sellers on eBay and Amazon that soldered the headers and re-sold at a profit but a quick look at both sites isn't turning up any results at the moment. Even Banggood doesn't seem to be selling them at the moment sorry.

    • @bazcurtis178
      @bazcurtis178 Před rokem

      @@SpeakToTheGeekTech I haven’t soldered for years, decades 😀. How easy is it to solder? I am worried about joining the pins together.

    • @SpeakToTheGeekTech
      @SpeakToTheGeekTech  Před rokem +1

      I'm not very experienced with soldering either - pretty much just what you see in my videos! I have a fine-tipped soldering iron which is important, and it's quite easy to solder the headers. I use blue-tack to stick the module to a surface and hold the pins in place face-down, then just melt the solder into the gaps between the pins and the board and it usually just sucks the solder straight up into a neat little bump. I'm not saying it always works, and I've melted a few boards and blue-tack in my attempts, but it's not a difficult task really as DIY jobs go!

    • @bazcurtis178
      @bazcurtis178 Před rokem

      @@SpeakToTheGeekTech I overlooked one thing. I was going to put this outside in my meter cabinet, but I have no power to plug it in. That is annoying

  • @Reudiga
    @Reudiga Před rokem

    Great Job!
    I tried it, i got 0.00042 A on my sensor, when the real is 2.0A.
    So i tried calibrate_linear but i got than 0.0000A instead of 2.0A correction... any idea?
    I have that
    0.00000 > 0
    0.00042 > 2.0
    as correction :/

    • @SpeakToTheGeekTech
      @SpeakToTheGeekTech  Před rokem

      That’s odd, are you certain you put the values for calibration the right way around?

    • @Reudiga
      @Reudiga Před rokem

      @@SpeakToTheGeekTech What did you mean? I putted in like i showed... i dont know :/

    • @Reudiga
      @Reudiga Před rokem

      filters:
      - calibrate_linear:
      - 0.00000 -> 0.0
      - 0.00042 -> 2.0
      Thats what i typed in. In My logs i have exact these 0.00042 when i put i 2.0A in my battery.
      But something strange is, that i have 5s interval and sometimes also is 0.0000A and than again 0.00042A
      But with the calibrate, i have everytime 0.0000A :(

    • @SpeakToTheGeekTech
      @SpeakToTheGeekTech  Před rokem

      I think you’re calibrating with too low current. You should remove all calibrate linear commands, put the clamp in place and see what you get when there’s no current running through it. That’s your calibrate for 0. Then whack the current right up, usually that’ll be 10 amps +. That’ll give you a reading at the top end of your calibration graph. It’ll then interpret the other values (like 2A) linearly. What’s likely happening now is that your zero current and 2A current readings are very close so overlapping.

    • @Reudiga
      @Reudiga Před rokem

      @@SpeakToTheGeekTech Ok, when i check Raw AC Value, i have 0.000A i think i dont have enaugh decimals there... is there a way to show more decimals?

  • @NomadNo
    @NomadNo Před 7 měsíci

    nice but to those that arent in the UK , this mottram costs about 25USD so makes the whole project a moot, thanks anyway

    • @SpeakToTheGeekTech
      @SpeakToTheGeekTech  Před 7 měsíci

      True, I am in the UK and the supplier is also in the UK. He does supply a schematic for the board so it’s entirely possible for an enterprising person elsewhere in the world to order or make a batch and sell them on

  • @taranagnew436
    @taranagnew436 Před rokem

    can i clamp it to a usb cable to calibrate it?

    • @taranagnew436
      @taranagnew436 Před rokem

      i want to hook it up to a ps5 (power cable is in utility room) will the other plugs interfere with the reading/calibration?

    • @SpeakToTheGeekTech
      @SpeakToTheGeekTech  Před rokem +2

      No, that won't work sorry for a number of reasons. Firstly the clamp is to detect AC current (not DC used in a USB cable), secondly it must be clamped over a single wire - so inside a normal AC three core flex cable, there's a live, neutral and earth - the clamp must be around just the live and not multiple cores.

  • @cico0815
    @cico0815 Před 3 měsíci

    Unable to buy the mottram board from Germany…😖

    • @SpeakToTheGeekTech
      @SpeakToTheGeekTech  Před 3 měsíci

      Yes the seller has chosen not to deliver to Germany. I don’t know the reasons why sorry.

  • @phinok.m.628
    @phinok.m.628 Před rokem +10

    You're measuring apparent power, not real power. Which I guarantee will not be the same in your case. Measuring the real power is a little more complicated than that. For that you need to measure the voltage and current a couple thousand times per second (and voltage and current must be measured simultaneously) and you need to do some math to calculate the real RMS power. That's what pretty much any energy monitoring device out there does.

    • @SpeakToTheGeekTech
      @SpeakToTheGeekTech  Před rokem +9

      Yup I totally agree. It's measuring the current and the power is just an estimate based on that. This device however is cheap to make, gives a ballpark rough reading suitable for use in home automation solutions, and is non-invasive for those who don't want to connect to mains power. It's also just a fun little project, but if you're after something seriously accurate then of course you must look for an alternative solution.

  • @theaustindude
    @theaustindude Před rokem

    Anyone have a US source for the board?

    • @SpeakToTheGeekTech
      @SpeakToTheGeekTech  Před rokem

      I'm pretty sure the seller will ship to the US?

    • @theaustindude
      @theaustindude Před rokem

      @@SpeakToTheGeekTech shipping costs to the US are pretty high.

    • @SpeakToTheGeekTech
      @SpeakToTheGeekTech  Před rokem

      Fair enough. I'm pretty sure the seller makes them all by himself in the UK though rather than this being a large business seller so I'd be surprised if you find them for sale anywhere else.

  • @tinchooyola
    @tinchooyola Před rokem

    8 pounds for that print! wow, you should have sourced a local 3d printer service.. that print cost is probably in the cents

    • @SpeakToTheGeekTech
      @SpeakToTheGeekTech  Před rokem

      Yeah but at the time I ordered it, it was the cheapest online service I could find. I compared quite a few. Now though I know a few people with printers so I could avoid that cost.

  • @technovelodos
    @technovelodos Před rokem

    "I'm not rich enough to buy a 3D printer"... says the guy wearing an Apple Watch LOL. I just bought my first 3D printer and it cost about a third the cost of my Apple Watch.

    • @SpeakToTheGeekTech
      @SpeakToTheGeekTech  Před rokem +1

      Haha best comment so far :) Fair point well made! I guess the real point is that other household members would definitely notice a hulking great 3D printer humming away in the house and start asking questions, whereas an Apple Watch can quietly sit on my wrist and usually go unnoticed... I'd also need to consider the cost for how often I'd use one vs printing the occasional item online. Don't get me wrong, if I could get away with purchasing one right now I absolutely would!

    • @technovelodos
      @technovelodos Před rokem

      @@SpeakToTheGeekTech I get that - I kept a list of things I could make with a 3D printer and when that list got over 30 items I started thinking seriously about it. I sold my wife on it by extolling how the kids could use for school projects, etc... that has yet to happen ;-)

  • @icarossavvides2641
    @icarossavvides2641 Před rokem

    "I'm not rich enough to have a 3D printer" yet you seem to be able to afford an Apple computer, with no less than three monitors, and a solar power array! Hilarious bit of irony! 😀😀😀😀😀

    • @SpeakToTheGeekTech
      @SpeakToTheGeekTech  Před rokem +1

      Point taken... but to clarify - that Apple iMac you see is a 2010 model, purchased second hand from someone else, some internal upgrades from me, but sadly retired only a few weeks ago as it's no longer able to keep up. Those two additional monitors are even older, from 2009. I like to keep kit for as long as possible to reduce the tech churn. It took me many years to save up for that solar array and will hopefully break even in about 6 more years so that's a spend worth making. It's all about choosing your purchases carefully to make the best use of limited funds in areas that are important to you. A 3D printer would be a bit of an extravagance given I'm unlikely to use it that often.

  • @christianandersen1495
    @christianandersen1495 Před rokem +1

    The calculated power shown will only be correct when used on the same load. (what its calibrated against, and assuming a constant phase angle, cosɸ) This method for power calculation does not correct for the phase angle difference. To measure the active power (Watts) and not only the apparent power (Volt-Amps) the phase voltage must be sampled continuously togter with the current. The Active power is then calculated by integrating the area under the curves. The module shown is only a Mains Current Sensor not a true power sensor. The calculated Active power will only be Amps x Voltage when assuming the load is purely restive. Thus the phase angle offset is assumed to be 0°. This is not the case for motors and electronic inductive loads (switch mode power supply).

    • @SpeakToTheGeekTech
      @SpeakToTheGeekTech  Před rokem +1

      Yeah it’ll never be as accurate as a proper inline power sensor of course, but in order to give the average home user an idea of what is flowing through a cable then it’s in the right ballpark.