{"id":351,"date":"2023-01-21T20:28:27","date_gmt":"2023-01-21T19:28:27","guid":{"rendered":"https:\/\/npham.dk\/?p=351"},"modified":"2024-02-17T17:36:01","modified_gmt":"2024-02-17T16:36:01","slug":"bthome-electricity-meter-for-home-assistent","status":"publish","type":"post","link":"https:\/\/npham.dk\/?p=351","title":{"rendered":"BTHome Electricity Meter for Home Assistent"},"content":{"rendered":"\n<p>I wanted to track my electric usage in real-time, and I&#8217;ve already have Home Assistant as my main smart home management system, so I wanted to make use of the Energy tracking feature that it provides.<\/p>\n\n\n\n<p>Because my meter is located outside our house, I had to find a solution that runs on batteries.<\/p>\n\n\n\n<p>I was looking into the Frient electricity meter, but couldn&#8217;t find any available anywhere. So I searched and found this DIY smart meter <a rel=\"noreferrer noopener\" href=\"https:\/\/www.espruino.com\/Smart+Meter\" target=\"_blank\">https:\/\/www.espruino.com\/Smart+Meter<\/a><\/p>\n\n\n\n<p>And to prolong the battery-life, I&#8217;m using 2 x D batteries instead of the small CR2032\u00a0battery.<\/p>\n\n\n\n<p><strong>UPDATE<\/strong>: After a couple of month using this. It became very unstable. It keept loosing connection to Home Assistant.<br>I ended up buying the Frient Electricity Meter Interface 2 &#8211; and this has been working perfectly.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What you need<\/h2>\n\n\n\n<ul>\n<li>Puck.js<\/li>\n\n\n\n<li>LDR sensor (GL5537)<\/li>\n\n\n\n<li>2 x 15mm ring magnets<\/li>\n\n\n\n<li>D battery holder<\/li>\n\n\n\n<li>2 x D batteries<\/li>\n\n\n\n<li>wire \/ 3d-printer<\/li>\n\n\n\n<li>optional: jst connector for the wire<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">3D printed casing<\/h2>\n\n\n\n<p>I started with 3d printing the casing for the LDR sensor and the Puck.JS<br>STL: <a href=\"https:\/\/www.printables.com\/model\/376244-puckjs-case-for-electricity-monitoring\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/www.printables.com\/model\/376244-puckjs-case-for-electricity-monitoring<\/a><\/p>\n\n\n\n<p>I divided it in 3 part, for easier print.<br>&#8211; Casing for the LDR sensor and Puck.JS<br>&#8211; Magnet holder<br>&#8211; Meter alignment-piece, to block out any outside ligth when attached to the meter<\/p>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-medium\"><a href=\"https:\/\/npham.dk\/wp-content\/uploads\/2023\/01\/IMG_1559.jpeg\"><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"126\" data-id=\"386\" src=\"https:\/\/npham.dk\/wp-content\/uploads\/2023\/01\/IMG_1559-300x126.jpeg\" alt=\"\" class=\"wp-image-386\" srcset=\"https:\/\/npham.dk\/wp-content\/uploads\/2023\/01\/IMG_1559-300x126.jpeg 300w, https:\/\/npham.dk\/wp-content\/uploads\/2023\/01\/IMG_1559-1024x431.jpeg 1024w, https:\/\/npham.dk\/wp-content\/uploads\/2023\/01\/IMG_1559-768x323.jpeg 768w, https:\/\/npham.dk\/wp-content\/uploads\/2023\/01\/IMG_1559-1536x647.jpeg 1536w, https:\/\/npham.dk\/wp-content\/uploads\/2023\/01\/IMG_1559.jpeg 1653w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><figcaption class=\"wp-element-caption\">3d printed pieces<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-medium\"><a href=\"https:\/\/npham.dk\/wp-content\/uploads\/2023\/01\/IMG_1560.jpeg\"><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"217\" data-id=\"385\" src=\"https:\/\/npham.dk\/wp-content\/uploads\/2023\/01\/IMG_1560-300x217.jpeg\" alt=\"\" class=\"wp-image-385\" srcset=\"https:\/\/npham.dk\/wp-content\/uploads\/2023\/01\/IMG_1560-300x217.jpeg 300w, https:\/\/npham.dk\/wp-content\/uploads\/2023\/01\/IMG_1560-1024x741.jpeg 1024w, https:\/\/npham.dk\/wp-content\/uploads\/2023\/01\/IMG_1560-768x556.jpeg 768w, https:\/\/npham.dk\/wp-content\/uploads\/2023\/01\/IMG_1560.jpeg 1224w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><figcaption class=\"wp-element-caption\">Removed the batteryclip and button<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-medium\"><a href=\"https:\/\/npham.dk\/wp-content\/uploads\/2023\/01\/IMG_1561.jpeg\"><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"160\" data-id=\"384\" src=\"https:\/\/npham.dk\/wp-content\/uploads\/2023\/01\/IMG_1561-300x160.jpeg\" alt=\"\" class=\"wp-image-384\" srcset=\"https:\/\/npham.dk\/wp-content\/uploads\/2023\/01\/IMG_1561-300x160.jpeg 300w, https:\/\/npham.dk\/wp-content\/uploads\/2023\/01\/IMG_1561-1024x546.jpeg 1024w, https:\/\/npham.dk\/wp-content\/uploads\/2023\/01\/IMG_1561-768x410.jpeg 768w, https:\/\/npham.dk\/wp-content\/uploads\/2023\/01\/IMG_1561.jpeg 1338w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><figcaption class=\"wp-element-caption\">Ready for assembly<\/figcaption><\/figure>\n<\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Assembly<\/h2>\n\n\n\n<p>I started with removing the battery clip and the button from the Puck, for it to be more low-profile<\/p>\n\n\n\n<p>&#8211; Put doublesided tape on one of the magnets, and attach it on the meters led.<br>&#8211; Solder the LDR and battery-connecter \/ wires together.<br>&#8211; Assemble the 3 3d printed pieces by glueing them together.<\/p>\n\n\n\n<p>I added a red cap, so that the Puck&#8217;s led could shine throgh.<\/p>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-2 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-medium\"><a href=\"https:\/\/npham.dk\/wp-content\/uploads\/2023\/01\/IMG_1564.jpeg\"><img loading=\"lazy\" decoding=\"async\" width=\"225\" height=\"300\" data-id=\"387\" src=\"https:\/\/npham.dk\/wp-content\/uploads\/2023\/01\/IMG_1564-225x300.jpeg\" alt=\"\" class=\"wp-image-387\" srcset=\"https:\/\/npham.dk\/wp-content\/uploads\/2023\/01\/IMG_1564-225x300.jpeg 225w, https:\/\/npham.dk\/wp-content\/uploads\/2023\/01\/IMG_1564-768x1024.jpeg 768w, https:\/\/npham.dk\/wp-content\/uploads\/2023\/01\/IMG_1564-1152x1536.jpeg 1152w, https:\/\/npham.dk\/wp-content\/uploads\/2023\/01\/IMG_1564.jpeg 1536w\" sizes=\"(max-width: 225px) 100vw, 225px\" \/><\/a><figcaption class=\"wp-element-caption\">Solder the LDR<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-medium\"><a href=\"https:\/\/npham.dk\/wp-content\/uploads\/2023\/01\/IMG_1565.jpeg\"><img loading=\"lazy\" decoding=\"async\" width=\"225\" height=\"300\" data-id=\"388\" src=\"https:\/\/npham.dk\/wp-content\/uploads\/2023\/01\/IMG_1565-225x300.jpeg\" alt=\"\" class=\"wp-image-388\" srcset=\"https:\/\/npham.dk\/wp-content\/uploads\/2023\/01\/IMG_1565-225x300.jpeg 225w, https:\/\/npham.dk\/wp-content\/uploads\/2023\/01\/IMG_1565-768x1024.jpeg 768w, https:\/\/npham.dk\/wp-content\/uploads\/2023\/01\/IMG_1565-1152x1536.jpeg 1152w, https:\/\/npham.dk\/wp-content\/uploads\/2023\/01\/IMG_1565.jpeg 1536w\" sizes=\"(max-width: 225px) 100vw, 225px\" \/><\/a><figcaption class=\"wp-element-caption\">Red cap on<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-medium\"><a href=\"https:\/\/npham.dk\/wp-content\/uploads\/2023\/01\/IMG_1567.jpeg\"><img loading=\"lazy\" decoding=\"async\" width=\"225\" height=\"300\" data-id=\"383\" src=\"https:\/\/npham.dk\/wp-content\/uploads\/2023\/01\/IMG_1567-225x300.jpeg\" alt=\"\" class=\"wp-image-383\" srcset=\"https:\/\/npham.dk\/wp-content\/uploads\/2023\/01\/IMG_1567-225x300.jpeg 225w, https:\/\/npham.dk\/wp-content\/uploads\/2023\/01\/IMG_1567-768x1024.jpeg 768w, https:\/\/npham.dk\/wp-content\/uploads\/2023\/01\/IMG_1567-1152x1536.jpeg 1152w, https:\/\/npham.dk\/wp-content\/uploads\/2023\/01\/IMG_1567.jpeg 1536w\" sizes=\"(max-width: 225px) 100vw, 225px\" \/><\/a><figcaption class=\"wp-element-caption\">All done<\/figcaption><\/figure>\n<\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Coding<\/h2>\n\n\n\n<p>Get the code for the puck from github: <a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/aegjoyce\/bthome-electricity-meter\" target=\"_blank\">https:\/\/github.com\/aegjoyce\/bthome-electricity-meter<\/a><\/p>\n\n\n\n<p>You need to adjust the imp variable to match your meters. It should be printed on your meter. Something like: 1000&nbsp;imp\/kWh<\/p>\n\n\n\n<p>If your Home assistant is setup correctly, it will find the device automatically.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I wanted to track my electric usage in real-time, and I&#8217;ve already have Home Assistant as my main smart home management system, so I wanted to make use of the Energy tracking feature that it provides. Because my meter is located outside our house, I had to find a solution that runs on batteries. I [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[16,17],"_links":{"self":[{"href":"https:\/\/npham.dk\/index.php?rest_route=\/wp\/v2\/posts\/351"}],"collection":[{"href":"https:\/\/npham.dk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/npham.dk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/npham.dk\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/npham.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=351"}],"version-history":[{"count":19,"href":"https:\/\/npham.dk\/index.php?rest_route=\/wp\/v2\/posts\/351\/revisions"}],"predecessor-version":[{"id":404,"href":"https:\/\/npham.dk\/index.php?rest_route=\/wp\/v2\/posts\/351\/revisions\/404"}],"wp:attachment":[{"href":"https:\/\/npham.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=351"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/npham.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=351"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/npham.dk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=351"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}