<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Energy-Monitoring on Intelligent Dithering</title><link>https://intelligentdithering.com/tags/energy-monitoring/</link><description>Overthinking technology so you don't have to</description><generator>Hugo</generator><language>en</language><atom:link href="https://intelligentdithering.com/tags/energy-monitoring/index.xml" rel="self" type="application/rss+xml"/><lastBuildDate>Mon, 25 Mar 2024 00:00:00 +0000</lastBuildDate><item><title>DIY Whole Home Energy Monitoring with Home Assistant</title><link>https://intelligentdithering.com/posts/2024/03/diy-whole-home-energy-monitoring-with-home-assistant/</link><pubDate>Mon, 25 Mar 2024 00:00:00 +0000</pubDate><guid isPermaLink="false">http://localhost:1313/diy-whole-home-energy-monitoring-with-home-assistant/</guid><description> Why energy monitoring?￼ Important warning The Plan￼ The Parts￼ Prepare the sensor￼ Install the sensor￼ Conclusion￼ Why energy monitoring?I recently decided I wanted more data on our home energy usage. Unfortunately our meter box is over 20 years old and our energy supplier wont replace it until it is 30 years old. It is an old spinning disk style meter with analog display.&#10;I had considered using a camera and some machine learning to read the digits from the display, but I think monitoring the actual power usage will be much better. Doing this is dangerous however so I needed a way to do it without my wife cashing in the life insurance!&#10;</description><content:encoded>&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="https://intelligentdithering.com/#why-energy-monitoring"&gt;Why energy monitoring?￼&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://intelligentdithering.com/#important-warning"&gt;Important warning&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://intelligentdithering.com/#the-plan"&gt;The Plan￼&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://intelligentdithering.com/#the-parts"&gt;The Parts￼&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://intelligentdithering.com/#prepare-the-sensor"&gt;Prepare the sensor￼&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://intelligentdithering.com/#install-the-sensor"&gt;Install the sensor￼&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://intelligentdithering.com/#conclusion"&gt;Conclusion￼&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h2 id="why-energy-monitoring"&gt;Why energy monitoring?&lt;a href="https://intelligentdithering.com/#why-energy-monitoring"&gt;&lt;/a&gt;&lt;a class="anchorjs-link" href="#why-energy-monitoring"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;I recently decided I wanted more data on our home energy usage. Unfortunately our meter box is over 20 years old and our energy supplier wont replace it until it is 30 years old. It is an old spinning disk style meter with analog display.&lt;/p&gt;&#10;&lt;p&gt;&lt;figure&gt;&#10; &lt;a class="paragraph-image"&gt;&#10; &lt;img src="https://intelligentdithering.com/posts/2024/03/diy-whole-home-energy-monitoring-with-home-assistant/images/analogmeter-1024x768.webp" data-action="zoom" alt="" class="lazyload"&gt;&#10; &lt;/a&gt;&#10; &#10;&lt;/figure&gt;&lt;/p&gt;&#10;&lt;p&gt;I had considered using a camera and some machine learning to read the digits from the display, but I think monitoring the actual power usage will be much better. Doing this is dangerous however so I needed a way to do it without my wife cashing in the life insurance!&lt;/p&gt;&#10;&lt;p&gt;CT Clamps measure the magnetic field coming from an electrical cable. My measuring the strength of the field via the induced current into a coil, you can get a measurement of the current flowing through the wire without being electrically connected to it. Split core CT Clamps make this even safer, by allowing you to “clamp” the sensor around the wire without having to disconnect anything.&lt;/p&gt;&#10;&lt;h2 id="important-warning"&gt;Important warning&lt;a class="anchorjs-link" href="#important-warning"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;I am not a qualified electrician. Using even these “safe” CT clamps does have a risk associated with it, and being in and around your electricity meter is obviously risky business. Please consult a suitably certified expert before attempting any of this! YOU HAVE BEEN WARNED!&lt;/em&gt;&lt;/strong&gt;&lt;a href="https://intelligentdithering.com/#important-warning"&gt;&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;figure&gt;&#10; &lt;a class="paragraph-image"&gt;&#10; &lt;img src="https://intelligentdithering.com/posts/2024/03/diy-whole-home-energy-monitoring-with-home-assistant/images/electric-shock.gif" data-action="zoom" alt="" class="lazyload"&gt;&#10; &lt;/a&gt;&#10; &#10;&lt;/figure&gt;&lt;/p&gt;&#10;&lt;h2 id="the-plan"&gt;The Plan&lt;a href="https://intelligentdithering.com/#the-plan"&gt;&lt;/a&gt;&lt;a class="anchorjs-link" href="#the-plan"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;My plan is to build a small system using some pre-made circuit boards for this purpose. Then install ESPHome onto an ESP8266 chip to allow easy programming and connection with Home Assistant. Once it is all installed, I should be able to have a nice simple gauge on my Home Assistant dashboard showing the live energy usage in the house. Home Assistant will also graph this data historically to allow us to see patterns of use and perhaps adjust our behaviour to help reduce our energy costs.&lt;/p&gt;&#10;&lt;p&gt;The parts should cost less that £20 ($25 USD).&lt;/p&gt;&#10;&lt;h2 id="the-parts"&gt;The Parts&lt;a href="https://intelligentdithering.com/#the-parts"&gt;&lt;/a&gt;&lt;a class="anchorjs-link" href="#the-parts"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;&lt;a href="https://amzn.to/3IWuZJ3" target="_blank"&gt;Wemos D1 Mini board with header pins ~£6&lt;/a&gt;&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;&lt;a href="https://www.ebay.co.uk/itm/134309518629?itmmeta=01HSPJ0518NW8JBEYSX3PC0K85&amp;amp;hash=item1f45789d25:g:eK0AAOSwV6RjXW7V" target="_blank"&gt;Mottram Labs CT Clamp Adaptor Board (MLP201083 for the D1 Mini) ~£3&lt;/a&gt;&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;&lt;a href="https://amzn.to/3TyEwLo" target="_blank"&gt;SCT013-000 100A - 50ma Split core CT Clamp sensor ~£9&lt;/a&gt;&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;&lt;a href="https://www.thingiverse.com/thing:3169243" target="_blank"&gt;3D Printed Case (optional)&lt;/a&gt;&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h2 id="prepare-the-sensor"&gt;Prepare the sensor&lt;a href="https://intelligentdithering.com/#prepare-the-sensor"&gt;&lt;/a&gt;&lt;a class="anchorjs-link" href="#prepare-the-sensor"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The first thing to do was to assemble the parts. This was pretty straightforward once I had the header pins soldered onto the Wemos D1 Mini. Just snap the two parts together and then connected it to my Mac via USB cable.&lt;/p&gt;&#10;&lt;p&gt;Then I navigated to the &lt;a href="https://web.esphome.io/?dashboard_wizard" target="_blank"&gt;ESPHome web installer&lt;/a&gt;. I had to do this using Google Chrome as Safari on Mac does not currently support WebSerial.&lt;/p&gt;&#10;&lt;p&gt;Just click Connect and then choose the serial port from the menu that pops up. Add in your home WiFi details and that is your ESPHome device created and it should appear in Home Assistant ready for adoption.&lt;/p&gt;&#10;&lt;p&gt;Once I had the device connected to Home Assistant it was time to program it. ESPHome allows you to use YAML files to configure the devices. Simply change the YAML, hit Save and Install and then choose WiFi. This will send your new device configuration over to the ESPHome device and reboot it, displaying logs to show how it went.&lt;/p&gt;&#10;&lt;p&gt;Here is the code I used for my sensor:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-mysql" data-lang="mysql"&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt; 1&lt;/span&gt;&lt;span&gt;substitutions:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt; 2&lt;/span&gt;&lt;span&gt;name: esphome&lt;span style="color:#ff79c6"&gt;-&lt;/span&gt;web&lt;span style="color:#ff79c6"&gt;-&lt;/span&gt;&lt;span style="color:#bd93f9"&gt;6&lt;/span&gt;eb49e&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt; 3&lt;/span&gt;&lt;span&gt;friendly_name: CT Clamp&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt; 4&lt;/span&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt; 5&lt;/span&gt;&lt;span&gt;esphome:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt; 6&lt;/span&gt;&lt;span&gt;name: ${name}&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt; 7&lt;/span&gt;&lt;span&gt;friendly_name: ${friendly_name}&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt; 8&lt;/span&gt;&lt;span&gt;name_add_mac_suffix: false&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt; 9&lt;/span&gt;&lt;span&gt;project:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;10&lt;/span&gt;&lt;span&gt;name: esphome.web&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;11&lt;/span&gt;&lt;span&gt;version: &lt;span style="color:#f1fa8c"&gt;&amp;#39;1.0&amp;#39;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;12&lt;/span&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;13&lt;/span&gt;&lt;span&gt;esp8266:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;14&lt;/span&gt;&lt;span&gt;board: esp01_1m&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;15&lt;/span&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;16&lt;/span&gt;&lt;span&gt;&lt;span style="color:#6272a4"&gt;# Enable logging&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;17&lt;/span&gt;&lt;span&gt;logger:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;18&lt;/span&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;19&lt;/span&gt;&lt;span&gt;&lt;span style="color:#6272a4"&gt;# Enable Home Assistant API&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;20&lt;/span&gt;&lt;span&gt;api:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;21&lt;/span&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;22&lt;/span&gt;&lt;span&gt;&lt;span style="color:#6272a4"&gt;# Allow Over-The-Air updates&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;23&lt;/span&gt;&lt;span&gt;ota:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;24&lt;/span&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;25&lt;/span&gt;&lt;span&gt;&lt;span style="color:#6272a4"&gt;# Allow provisioning Wi-Fi via serial&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;26&lt;/span&gt;&lt;span&gt;improv_serial:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;27&lt;/span&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;28&lt;/span&gt;&lt;span&gt;wifi:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;29&lt;/span&gt;&lt;span&gt;&lt;span style="color:#6272a4"&gt;# Set up a wifi access point&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;30&lt;/span&gt;&lt;span&gt;ap: {}&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;31&lt;/span&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;32&lt;/span&gt;&lt;span&gt;&lt;span style="color:#6272a4"&gt;# In combination with the `ap` this allows the user&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;33&lt;/span&gt;&lt;span&gt;&lt;span style="color:#6272a4"&gt;# to provision wifi credentials to the device via WiFi AP.&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;34&lt;/span&gt;&lt;span&gt;captive_portal:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;35&lt;/span&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;36&lt;/span&gt;&lt;span&gt;dashboard_import:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;37&lt;/span&gt;&lt;span&gt;package_import_url: github:&lt;span style="color:#ff79c6"&gt;//&lt;/span&gt;esphome&lt;span style="color:#ff79c6"&gt;/&lt;/span&gt;example&lt;span style="color:#ff79c6"&gt;-&lt;/span&gt;configs&lt;span style="color:#ff79c6"&gt;/&lt;/span&gt;esphome&lt;span style="color:#ff79c6"&gt;-&lt;/span&gt;web&lt;span style="color:#ff79c6"&gt;/&lt;/span&gt;esp8266.yaml&lt;span style="color:#ff79c6"&gt;@&lt;/span&gt;main&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;38&lt;/span&gt;&lt;span&gt;import_full_config: true&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;39&lt;/span&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;40&lt;/span&gt;&lt;span&gt;&lt;span style="color:#6272a4"&gt;# To have a &amp;#34;next url&amp;#34; for improv serial&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;41&lt;/span&gt;&lt;span&gt;web_server:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;42&lt;/span&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;43&lt;/span&gt;&lt;span&gt;&lt;span style="color:#6272a4"&gt;# Example configuration entry&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;44&lt;/span&gt;&lt;span&gt;sensor:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;45&lt;/span&gt;&lt;span&gt;&lt;span style="color:#ff79c6"&gt;-&lt;/span&gt; platform: ct_clamp&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;46&lt;/span&gt;&lt;span&gt;sensor: adc_sensor&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;47&lt;/span&gt;&lt;span&gt;name: &lt;span style="color:#f1fa8c"&gt;&amp;#34;Measured Current&amp;#34;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;48&lt;/span&gt;&lt;span&gt;id: home_current&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;49&lt;/span&gt;&lt;span&gt;update_interval: &lt;span style="color:#bd93f9"&gt;15&lt;/span&gt;s&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;50&lt;/span&gt;&lt;span&gt;filters:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;51&lt;/span&gt;&lt;span&gt;&lt;span style="color:#ff79c6"&gt;-&lt;/span&gt; calibrate_linear:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;52&lt;/span&gt;&lt;span&gt;&lt;span style="color:#6272a4"&gt;# Measured value of 0 maps to 0A&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;53&lt;/span&gt;&lt;span&gt;&lt;span style="color:#ff79c6"&gt;-&lt;/span&gt; &lt;span style="color:#bd93f9"&gt;0&lt;/span&gt; &lt;span style="color:#ff79c6"&gt;-&amp;gt;&lt;/span&gt; &lt;span style="color:#bd93f9"&gt;0&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;54&lt;/span&gt;&lt;span&gt;&lt;span style="color:#ff79c6"&gt;-&lt;/span&gt; &lt;span style="color:#bd93f9"&gt;0&lt;/span&gt;.&lt;span style="color:#bd93f9"&gt;028&lt;/span&gt; &lt;span style="color:#ff79c6"&gt;-&amp;gt;&lt;/span&gt; &lt;span style="color:#bd93f9"&gt;8&lt;/span&gt;.&lt;span style="color:#bd93f9"&gt;8&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;55&lt;/span&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;56&lt;/span&gt;&lt;span&gt;&lt;span style="color:#6272a4"&gt;# Example source sensor&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;57&lt;/span&gt;&lt;span&gt;&lt;span style="color:#ff79c6"&gt;-&lt;/span&gt; platform: adc&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;58&lt;/span&gt;&lt;span&gt;pin: A0&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;59&lt;/span&gt;&lt;span&gt;id: adc_sensor&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;60&lt;/span&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;61&lt;/span&gt;&lt;span&gt;&lt;span style="color:#ff79c6"&gt;-&lt;/span&gt; platform: template&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;62&lt;/span&gt;&lt;span&gt;id: my_power&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;63&lt;/span&gt;&lt;span&gt;name: &lt;span style="color:#f1fa8c"&gt;&amp;#34;Home Power&amp;#34;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;64&lt;/span&gt;&lt;span&gt;lambda: &lt;span style="color:#ff79c6"&gt;return&lt;/span&gt; &lt;span style="color:#50fa7b"&gt;id&lt;/span&gt;(home_current).state &lt;span style="color:#ff79c6"&gt;*&lt;/span&gt; &lt;span style="color:#bd93f9"&gt;230&lt;/span&gt;;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;65&lt;/span&gt;&lt;span&gt;device_class: power&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;66&lt;/span&gt;&lt;span&gt;unit_of_measurement: &lt;span style="color:#f1fa8c"&gt;&amp;#39;W&amp;#39;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;67&lt;/span&gt;&lt;span&gt;update_interval: &lt;span style="color:#bd93f9"&gt;15&lt;/span&gt;s&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You have to calibrate the sensor using a known load. How I did this was to strip back the out sheath from an extension cable, allowing me to access the live wire separately. I could then clamp the CT over the live wire, and then plug in a known load to the extension cable. I also used a plug in energy monitoring plug to verify results.&lt;/p&gt;&#10;&lt;figure&gt;&#10;&lt;p&gt;&lt;figure&gt;&#10; &lt;a class="paragraph-image"&gt;&#10; &lt;img src="https://intelligentdithering.com/posts/2024/03/diy-whole-home-energy-monitoring-with-home-assistant/images/testcable-225x300.webp" data-action="zoom" alt="" class="lazyload"&gt;&#10; &lt;/a&gt;&#10; &#10;&lt;/figure&gt;&lt;/p&gt;&#10;&lt;figcaption&gt;&#10;&lt;p&gt;Do not make a cable like this!&lt;/p&gt;&#10;&lt;/figcaption&gt;&#10;&lt;/figure&gt;&#10;&lt;p&gt;I ran a hairdryer on its medium setting and saw that it produced 4.4 amps on the digital meter, while the ESPHome chip was reporting 0.014A. I then ran it on max, and saw the digital meter showing 8.8 amps of draw, and the ESPHome showing 0.028.&lt;/p&gt;&#10;&lt;p&gt;So in the YAML file under the &lt;strong&gt;calibrate linear&lt;/strong&gt; section I add 0 -&amp;gt; 0 and 0.028 -&amp;gt; 8.8. This will then allow the sensor to work out what to convert when taking reading. I should probably have put in more readings to help make it more accurate but for my needs this will suffice.&lt;/p&gt;&#10;&lt;h2 id="install-the-sensor"&gt;Install the sensor&lt;a href="https://intelligentdithering.com/#install-the-sensor"&gt;&lt;/a&gt;&lt;a class="anchorjs-link" href="#install-the-sensor"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Happy that I had reasonably accurate readings it was now time to install the sensor. Luckily for me my power meter has the output cables easily accessible. It was simply a matter of installing the CT Clamp around one of the cables and then powering on the sensor.&lt;/p&gt;&#10;&lt;p&gt;I also 3D printed the case for the Wemos and adaptor board to keep everything neat and safe.&lt;/p&gt;&#10;&lt;p&gt;&lt;figure&gt;&#10; &lt;a class="paragraph-image"&gt;&#10; &lt;img src="https://intelligentdithering.com/posts/2024/03/diy-whole-home-energy-monitoring-with-home-assistant/images/clampinstalled-1024x768.webp" data-action="zoom" alt="energy monitoring device installed" class="lazyload"&gt;&#10; &lt;/a&gt;&#10; &#10;&lt;/figure&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;figure&gt;&#10; &lt;a class="paragraph-image"&gt;&#10; &lt;img src="https://intelligentdithering.com/posts/2024/03/diy-whole-home-energy-monitoring-with-home-assistant/images/sensorincase-1024x768.webp" data-action="zoom" alt="" class="lazyload"&gt;&#10; &lt;/a&gt;&#10; &#10;&lt;/figure&gt;&lt;/p&gt;&#10;&lt;p&gt;Within minutes I had data flowing to Home Assistant. All that was left to do is add it to the dashboard.&lt;/p&gt;&#10;&lt;p&gt;&lt;figure&gt;&#10; &lt;a class="paragraph-image"&gt;&#10; &lt;img src="https://intelligentdithering.com/posts/2024/03/diy-whole-home-energy-monitoring-with-home-assistant/images/dashboard-473x1024.webp" data-action="zoom" alt="" class="lazyload"&gt;&#10; &lt;/a&gt;&#10; &#10;&lt;/figure&gt;&lt;/p&gt;&#10;&lt;p&gt;I chose to use the Gauge type widget for this and will adjust the markings of the green, yellow and red areas as I monitor our usage.&lt;/p&gt;&#10;&lt;h2 id="conclusion"&gt;Conclusion&lt;a href="https://intelligentdithering.com/#conclusion"&gt;&lt;/a&gt;&lt;a class="anchorjs-link" href="#conclusion"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;This was a really fun little project. For under £20 I now have a gauge of how much energy we are using despite having an incredibly old analog power meter.&lt;/p&gt;&#10;&lt;p&gt;This project hit a lot of areas: soldering, 3d printing, software, hardware and a little bit of potentially dangerous electricity. Perfect mix for tinkering!&lt;/p&gt;&#10;&lt;p&gt;I hope to make a few more dashboard widgets translating the power usage into monetary value to give us a better sense of how much things cost to run. This will hopefully help us as a family adjust our behaviours a little to save some money (and perhaps the planet!).&lt;/p&gt;&#10;&lt;p&gt;If you give this a go be sure to heed the warnings and let me know in the comments how you get on!&lt;/p&gt;&#10;&lt;p&gt;Happy tinkering!&lt;/p&gt;&#10;</content:encoded></item></channel></rss>