{"id":2448,"date":"2024-12-15T22:29:28","date_gmt":"2024-12-16T02:29:28","guid":{"rendered":"https:\/\/lowtek.ca\/roo\/?p=2448"},"modified":"2024-12-15T22:29:28","modified_gmt":"2024-12-16T02:29:28","slug":"openbeken-with-globe-electric-smart-plugs","status":"publish","type":"post","link":"https:\/\/lowtek.ca\/roo\/2024\/openbeken-with-globe-electric-smart-plugs\/","title":{"rendered":"OpenBeken with Globe Electric Smart Plugs"},"content":{"rendered":"<p>I needed some more home automation friendly outlets, and my preferred <a href=\"https:\/\/sonoff.tech\/product\/smart-plugs\/s31-s31lite\/\">Sonoff S31<\/a> outlets are hard to get at the moment. It also seems that the <a href=\"https:\/\/sonoff.tech\/product\/smart-plugs\/s40-s40lite\/\">S40<\/a> has been released as a replacement, but moves away from the <a href=\"https:\/\/en.wikipedia.org\/wiki\/ESP8266\">ESP<\/a> micro-controller. This got me looking for what I could get locally.<\/p>\n<p>The Home Depot carries the <a href=\"https:\/\/www.homedepot.ca\/product\/defiant-15-amp-120-volt-smart-wi-fi-bluetooth-plug-with-1-outlet-powered-by-hubspace\/1001711539\">Defiant series<\/a>, which when I looked up the details on the <a href=\"https:\/\/fcc.report\/FCC-ID\/2AB2Q-LA02301\/5200313\">FCC<\/a> website it seemed like a great candidate having an ESP32 inside. However, it seems that the <a href=\"https:\/\/en.wikipedia.org\/wiki\/EFuse\">eFuse<\/a> has been flipped to <a href=\"https:\/\/community.home-assistant.io\/t\/help-trying-to-flash-esp32-in-home-depot-bulb\/326294\/10\">prevent any further firmware updates<\/a>. I then moved on and found a sale price of $22.99 for a 3 pack of the <a href=\"https:\/\/www.rona.ca\/en\/product\/globe-electric-3-pack-white-wi-fi-smart-plugs-50448-00795933\">Globe Electric Smart Plugs<\/a>.<\/p>\n<p><a href=\"https:\/\/lowtek.ca\/roo\/wp-content\/uploads\/2024\/12\/globeplug1.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-2449\" src=\"https:\/\/lowtek.ca\/roo\/wp-content\/uploads\/2024\/12\/globeplug1-500x255.jpg\" alt=\"\" width=\"500\" height=\"255\" srcset=\"https:\/\/lowtek.ca\/roo\/wp-content\/uploads\/2024\/12\/globeplug1-500x255.jpg 500w, https:\/\/lowtek.ca\/roo\/wp-content\/uploads\/2024\/12\/globeplug1-1024x522.jpg 1024w, https:\/\/lowtek.ca\/roo\/wp-content\/uploads\/2024\/12\/globeplug1-768x392.jpg 768w, https:\/\/lowtek.ca\/roo\/wp-content\/uploads\/2024\/12\/globeplug1-1200x612.jpg 1200w, https:\/\/lowtek.ca\/roo\/wp-content\/uploads\/2024\/12\/globeplug1.jpg 1365w\" sizes=\"auto, (max-width: 500px) 85vw, 500px\" \/><\/a>Now these plugs do not have an ESP device in them, but a <a href=\"https:\/\/developer.tuya.com\/en\/docs\/iot\/wb2s-module-datasheet?id=K9ghecl7kc479\">WB2S<\/a> module. Some folks take advantage of the fact that this is pin compatible with an ESP device and will just swap in a whole new logic board. However, you can also use <a href=\"https:\/\/github.com\/openshwprojects\/OpenBK7231T_App\">OpenBeken<\/a> which I&#8217;ve <a href=\"https:\/\/lowtek.ca\/roo\/2024\/pown-your-iot-openbeken\/\">done before<\/a>. Since these were pretty cheap I picked up 3 boxes (9 plugs).<\/p>\n<p>These plugs are fairly compact and you can fit two in an outlet (top and bottom) if you wanted.<\/p>\n<p><a href=\"https:\/\/lowtek.ca\/roo\/wp-content\/uploads\/2024\/12\/globeplug2.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2450\" src=\"https:\/\/lowtek.ca\/roo\/wp-content\/uploads\/2024\/12\/globeplug2.jpg\" alt=\"\" width=\"500\" height=\"307\" \/><\/a><a href=\"https:\/\/lowtek.ca\/roo\/wp-content\/uploads\/2024\/12\/globeplug3.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2451\" src=\"https:\/\/lowtek.ca\/roo\/wp-content\/uploads\/2024\/12\/globeplug3.jpg\" alt=\"\" width=\"500\" height=\"308\" \/><\/a>The first thing we need to do is open these. This is fairly easily done using a pocket knife and a little bit of patience \/ prying. After doing a few of these I got pretty quick, a minute or two to open them. I captured a <a href=\"https:\/\/youtu.be\/7oAYFP1BPcU\">short video I put up on YouTube<\/a> showing this process.<\/p>\n<p><a href=\"https:\/\/lowtek.ca\/roo\/wp-content\/uploads\/2024\/12\/globeplug4.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2452\" src=\"https:\/\/lowtek.ca\/roo\/wp-content\/uploads\/2024\/12\/globeplug4.jpg\" alt=\"\" width=\"500\" height=\"322\" \/><\/a>Now that it&#8217;s open, you can remove the exterior case entirely and you have access to the internals. The micro-controller was easy to spot, it is on it&#8217;s own tiny circuit board.<\/p>\n<p><a href=\"https:\/\/lowtek.ca\/roo\/wp-content\/uploads\/2024\/12\/globeplug5.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-2453\" src=\"https:\/\/lowtek.ca\/roo\/wp-content\/uploads\/2024\/12\/globeplug5-500x337.jpg\" alt=\"\" width=\"500\" height=\"337\" srcset=\"https:\/\/lowtek.ca\/roo\/wp-content\/uploads\/2024\/12\/globeplug5-500x337.jpg 500w, https:\/\/lowtek.ca\/roo\/wp-content\/uploads\/2024\/12\/globeplug5-1024x691.jpg 1024w, https:\/\/lowtek.ca\/roo\/wp-content\/uploads\/2024\/12\/globeplug5-768x518.jpg 768w, https:\/\/lowtek.ca\/roo\/wp-content\/uploads\/2024\/12\/globeplug5-1200x809.jpg 1200w, https:\/\/lowtek.ca\/roo\/wp-content\/uploads\/2024\/12\/globeplug5.jpg 1530w\" sizes=\"auto, (max-width: 500px) 85vw, 500px\" \/><\/a>You can see why some folks are simply removing the entire controller board and swapping in a compatible one with a more friendly chip to program. However, with <a href=\"https:\/\/github.com\/openshwprojects\/OpenBK7231T_App\">OpenBeken<\/a> we have the option of reprogramming this chip with some firmware to give us local only control (via <a href=\"https:\/\/www.home-assistant.io\/\">Home Assistant<\/a>).<\/p>\n<p>At the top you can see this is a WB2S board, and the chip is a BK7231TQN32. For the most part this chip is referred to as a BK7231T.<\/p>\n<p>We&#8217;re going to need to hook up 4 wires to this to reprogram it, 3.3V, GND, Tx and Rx. Let&#8217;s figure out where those pins are.<\/p>\n<p><a href=\"https:\/\/lowtek.ca\/roo\/wp-content\/uploads\/2024\/12\/globeplug6.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-2454\" src=\"https:\/\/lowtek.ca\/roo\/wp-content\/uploads\/2024\/12\/globeplug6-500x231.jpg\" alt=\"\" width=\"500\" height=\"231\" srcset=\"https:\/\/lowtek.ca\/roo\/wp-content\/uploads\/2024\/12\/globeplug6-500x231.jpg 500w, https:\/\/lowtek.ca\/roo\/wp-content\/uploads\/2024\/12\/globeplug6-1024x473.jpg 1024w, https:\/\/lowtek.ca\/roo\/wp-content\/uploads\/2024\/12\/globeplug6-768x355.jpg 768w, https:\/\/lowtek.ca\/roo\/wp-content\/uploads\/2024\/12\/globeplug6-1200x554.jpg 1200w, https:\/\/lowtek.ca\/roo\/wp-content\/uploads\/2024\/12\/globeplug6.jpg 1523w\" sizes=\"auto, (max-width: 500px) 85vw, 500px\" \/><\/a>This is the other side of the board, and if you look carefully you can see at the bottom edge we have starting from the left side BAT, GND, IRX, ITX. These are the 4 pins we need to connect with. Thankfully we can access each of these from the bottom side of the board as the controller board slots into the main circuit board on it&#8217;s edge.<\/p>\n<p><a href=\"https:\/\/lowtek.ca\/roo\/wp-content\/uploads\/2024\/12\/globeplug7.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-2455\" src=\"https:\/\/lowtek.ca\/roo\/wp-content\/uploads\/2024\/12\/globeplug7-500x260.jpg\" alt=\"\" width=\"500\" height=\"260\" srcset=\"https:\/\/lowtek.ca\/roo\/wp-content\/uploads\/2024\/12\/globeplug7-500x260.jpg 500w, https:\/\/lowtek.ca\/roo\/wp-content\/uploads\/2024\/12\/globeplug7-1024x533.jpg 1024w, https:\/\/lowtek.ca\/roo\/wp-content\/uploads\/2024\/12\/globeplug7-768x400.jpg 768w, https:\/\/lowtek.ca\/roo\/wp-content\/uploads\/2024\/12\/globeplug7-1200x624.jpg 1200w, https:\/\/lowtek.ca\/roo\/wp-content\/uploads\/2024\/12\/globeplug7.jpg 1311w\" sizes=\"auto, (max-width: 500px) 85vw, 500px\" \/><\/a>Not very pretty, but it gets the job done. The wires are from some stripped ethernet cable and I think they are 26AWG &#8211; fairly small. While this was convenient for me to connect some wires to, upon inspection it seems the only reason there is any solder here is to support the board-to-board connection, I&#8217;m pretty sure all of the actual interfacing to the circuits is on the other side.<\/p>\n<p>Someone on the <a href=\"https:\/\/www.elektroda.com\/rtvforum\/topic3937148.html\">Elektroda forum<\/a> seems to have done the first work on one of these plugs. A lot of people using OpenBeken have used the <a href=\"https:\/\/digiblur.com\/2023\/04\/10\/tuya-cloudcutter-with-esphome-how-to-guide\/\">CloudCutter<\/a> project to reprogram things without wiring anything up, but this seemed more complicated to me and not guaranteed to work with all devices.<\/p>\n<p>My first attempt I used the same software as I had <a href=\"https:\/\/lowtek.ca\/roo\/2024\/pown-your-iot-openbeken\/\">previously<\/a>. The only change was to download a different firmware because this is a different module. Unfortunately I goofed somewhere and when flashing the device it failed, then it was no longer responsive to my attempts to connect via serial at all. It may be a brick now, boo.<\/p>\n<p>For my second attempt, I did more reading about the <a href=\"https:\/\/esphome.io\/components\/libretiny\">ESPHome support for BK72xx<\/a> chips. There is quite detailed information about <a href=\"https:\/\/docs.libretiny.eu\/docs\/platform\/beken-72xx\/#flashing\">flashing the chips<\/a>, and it seems to strongly recommend you do not use the old tool I had previously used. There is also a section there on un-bricking things which I&#8217;ll have to try later.<\/p>\n<p>Thus I picked the <code>ltchiptool<\/code> &#8211; and installed it under Windows. The easy way to do this on Windows was use the Microsoft Store to install &#8220;Python 3.10&#8221; &#8211; then run <code>pip install ltchiptool[gui]<\/code><\/p>\n<p>Once installed, you can launch the GUI with <code>python -m ltchiptool gui<\/code><\/p>\n<p>While I may eventually end up using ESPHome, I decided to stick with OpenBeken and grabbed the latest <a href=\"https:\/\/github.com\/openshwprojects\/OpenBK7231T_App\/releases\/download\/1.17.800\/OpenBK7231T_UA_1.17.800.bin\">OpenBK7231T_UA_1.17.800.bin<\/a> from their <a href=\"https:\/\/github.com\/openshwprojects\/OpenBK7231T_App\/releases\">download page<\/a>. I first used the <code>ltchiptool<\/code> to download the existing flash image to confirm my wiring was working. Then I held my breath and uploaded the firmware.. and it worked.<\/p>\n<p>Then it was a simple matter of repeating things. Crack open the case. Solder some wires. Hook it up to <code>ltchiptool<\/code>, download to confirm things are working, upload new firmware. De-solder the wires. Re-assemble. Now I had 8 outlets reprogrammed.<\/p>\n<p>A dab of crazy glue helped re-seal the exterior cases. So far this seems just fine after a few insert \/ removals of the plugs.<\/p>\n<p>Next we need to do some configuration. Upon first boot the device will offer up a captive portal. Connect your computer to the &#8220;OpenBK76231N_XXXXX&#8221; WiFi and visit <code>http:\/\/192.168.4.1<\/code> in a browser. From here we can pick &#8220;Config&#8221; then &#8220;Configure Wifi &amp; Web&#8221; to setup the Wifi connection.<\/p>\n<p>Once the device is on our WiFi network, it can then see the internet which allows us to use the &#8220;Web Application&#8221; to further configure the device. You can launch the Web Application from the main landing page. I did find that it was important to access the device via IP address (ie: <code>http:\/\/192.168.1.56<\/code>) vs. by name.<\/p>\n<p><a href=\"https:\/\/lowtek.ca\/roo\/wp-content\/uploads\/2024\/12\/globeplug8.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-2456\" src=\"https:\/\/lowtek.ca\/roo\/wp-content\/uploads\/2024\/12\/globeplug8-500x289.png\" alt=\"\" width=\"500\" height=\"289\" srcset=\"https:\/\/lowtek.ca\/roo\/wp-content\/uploads\/2024\/12\/globeplug8-500x289.png 500w, https:\/\/lowtek.ca\/roo\/wp-content\/uploads\/2024\/12\/globeplug8-1024x592.png 1024w, https:\/\/lowtek.ca\/roo\/wp-content\/uploads\/2024\/12\/globeplug8-768x444.png 768w, https:\/\/lowtek.ca\/roo\/wp-content\/uploads\/2024\/12\/globeplug8-1536x887.png 1536w, https:\/\/lowtek.ca\/roo\/wp-content\/uploads\/2024\/12\/globeplug8-1200x693.png 1200w, https:\/\/lowtek.ca\/roo\/wp-content\/uploads\/2024\/12\/globeplug8.png 1686w\" sizes=\"auto, (max-width: 500px) 85vw, 500px\" \/><\/a>Once we launch the Web Application, we can easily configure the device by using the &#8220;Config&#8221; tab, and searching for the right template from the web. I have to say this is a pretty clever way to do things.<\/p>\n<p><a href=\"https:\/\/lowtek.ca\/roo\/wp-content\/uploads\/2024\/12\/globeplug9.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-2457\" src=\"https:\/\/lowtek.ca\/roo\/wp-content\/uploads\/2024\/12\/globeplug9-500x346.jpg\" alt=\"\" width=\"500\" height=\"346\" srcset=\"https:\/\/lowtek.ca\/roo\/wp-content\/uploads\/2024\/12\/globeplug9-500x346.jpg 500w, https:\/\/lowtek.ca\/roo\/wp-content\/uploads\/2024\/12\/globeplug9-1024x709.jpg 1024w, https:\/\/lowtek.ca\/roo\/wp-content\/uploads\/2024\/12\/globeplug9-768x532.jpg 768w, https:\/\/lowtek.ca\/roo\/wp-content\/uploads\/2024\/12\/globeplug9-1536x1064.jpg 1536w, https:\/\/lowtek.ca\/roo\/wp-content\/uploads\/2024\/12\/globeplug9-2048x1419.jpg 2048w, https:\/\/lowtek.ca\/roo\/wp-content\/uploads\/2024\/12\/globeplug9-1200x831.jpg 1200w\" sizes=\"auto, (max-width: 500px) 85vw, 500px\" \/><\/a>You can see I&#8217;ve searched up the &#8220;Globe Globe smart plug&#8221; and have used &#8220;Copy Device Settings&#8221; to populate the &#8220;Pin Settings&#8221;. At the bottom of the page there is a &#8220;Save&#8221; button to persist the choice. Now if we revisit the Home page we will see the device now offers up control of the power. The button on the side of the plug also now works to toggle power.<\/p>\n<p><a href=\"https:\/\/lowtek.ca\/roo\/wp-content\/uploads\/2024\/12\/globeplug10.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-2458\" src=\"https:\/\/lowtek.ca\/roo\/wp-content\/uploads\/2024\/12\/globeplug10-495x500.jpg\" alt=\"\" width=\"495\" height=\"500\" srcset=\"https:\/\/lowtek.ca\/roo\/wp-content\/uploads\/2024\/12\/globeplug10-495x500.jpg 495w, https:\/\/lowtek.ca\/roo\/wp-content\/uploads\/2024\/12\/globeplug10-1014x1024.jpg 1014w, https:\/\/lowtek.ca\/roo\/wp-content\/uploads\/2024\/12\/globeplug10-768x775.jpg 768w, https:\/\/lowtek.ca\/roo\/wp-content\/uploads\/2024\/12\/globeplug10-1521x1536.jpg 1521w, https:\/\/lowtek.ca\/roo\/wp-content\/uploads\/2024\/12\/globeplug10-1200x1212.jpg 1200w, https:\/\/lowtek.ca\/roo\/wp-content\/uploads\/2024\/12\/globeplug10.jpg 1751w\" sizes=\"auto, (max-width: 495px) 85vw, 495px\" \/><\/a>The last thing we&#8217;ll do is connect this up to Home Assistant. The easy path here is to setup MQTT (Config-&gt;Configure MQTT) and get connect to your broker. I was left scratching my head why Home Assistant wouldn&#8217;t see these new devices &#8211; and after a lot of probing around my MQTT setup and verifying that data was flowing, I finally <a href=\"https:\/\/www.youtube.com\/watch?v=pkcspey25V4\">watched the video<\/a> the explains it.<\/p>\n<p>Short story was &#8211; after you&#8217;ve got MQTT setup, and the main page will show you the MQTT State is connected &#8211; you need to do one more thing to have it emit a discovery payload to Home Assistant. (Config-&gt;Home Assistant Configuration) and hit &#8220;Start Home Assistant Discovery&#8221;. Then the devices just appeared with their short name in Home Assistant.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I needed some more home automation friendly outlets, and my preferred Sonoff S31 outlets are hard to get at the moment. It also seems that the S40 has been released as a replacement, but moves away from the ESP micro-controller. This got me looking for what I could get locally. The Home Depot carries the &hellip; <a href=\"https:\/\/lowtek.ca\/roo\/2024\/openbeken-with-globe-electric-smart-plugs\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;OpenBeken with Globe Electric Smart Plugs&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,12,22],"tags":[],"class_list":["post-2448","post","type-post","status-publish","format-standard","hentry","category-gadgets","category-how-to","category-iot"],"_links":{"self":[{"href":"https:\/\/lowtek.ca\/roo\/wp-json\/wp\/v2\/posts\/2448","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lowtek.ca\/roo\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lowtek.ca\/roo\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lowtek.ca\/roo\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lowtek.ca\/roo\/wp-json\/wp\/v2\/comments?post=2448"}],"version-history":[{"count":2,"href":"https:\/\/lowtek.ca\/roo\/wp-json\/wp\/v2\/posts\/2448\/revisions"}],"predecessor-version":[{"id":2460,"href":"https:\/\/lowtek.ca\/roo\/wp-json\/wp\/v2\/posts\/2448\/revisions\/2460"}],"wp:attachment":[{"href":"https:\/\/lowtek.ca\/roo\/wp-json\/wp\/v2\/media?parent=2448"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lowtek.ca\/roo\/wp-json\/wp\/v2\/categories?post=2448"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lowtek.ca\/roo\/wp-json\/wp\/v2\/tags?post=2448"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}