{"id":601,"date":"2017-03-19T00:14:10","date_gmt":"2017-03-18T23:14:10","guid":{"rendered":"https:\/\/www.sevenwatt.com\/main\/?p=601"},"modified":"2017-03-19T12:26:49","modified_gmt":"2017-03-19T11:26:49","slug":"innr-smartplug-philips-hue-part-1","status":"publish","type":"post","link":"https:\/\/www.sevenwatt.com\/main\/innr-smartplug-philips-hue-part-1\/","title":{"rendered":"Innr SmartPlug for Philips Hue &#8211; part 1"},"content":{"rendered":"<h2>Philips Hue &#8211; Great, only E27 ad GU10 lights?<\/h2>\n<p>Great system, but what about the E14 lights that I have around the house, and some others where the bulbs can&#8217;t be replaced with one of the Hue lights? It seems that the Osram Lightify Plug can be connected.\u00a0A solution without soldering and flashing firmware would take the fun out of it. The new brand Innr offers a SmartPlug, that uses the Zigbee HA protocol. Could it also be used with the Zigbee ZLL protocol used by Hue? The answer is yes. It only requires flashing a custom firmware.<!--more--><\/p>\n<h2>Custom firmware Hue lights<\/h2>\n<p>Credit goes to <a href=\"https:\/\/peeveeone.com\/\">peeveeone<\/a> who has been extremely persistent in figuring out how to connect his own lights to the Philips Hue. His breakthrough moment was when he found how to <a href=\"https:\/\/peeveeone.com\/?p=166\">use a trust center link key<\/a>. After that he was able to <a href=\"https:\/\/peeveeone.com\/?p=187\">build a custom firmware<\/a> for the NXP JN5168 Zigbee module. For this he used NXP example programs for smart lighting.<\/p>\n<blockquote><p>Without this work, I could never set out to hack the Innr SmartPlug.<\/p><\/blockquote>\n<h1>Don&#8217;t try this at home<\/h1>\n<p>The author accepts no responsibility or liability for any adverse effects. This includes but is not limited to potential damage of the device itself, other equipment or personal harm, injury or dead. Working on electrical mains appliances can be dangerous. 230V is dangerous. If you decide to open such a device and work on it, never plug it into mains, until the device is closed again. If you do not feel comfortable with this, or want to experiment while powered with 230V: Do not proceed!<\/p>\n<h2>Innr SmartPlug Teardown<\/h2>\n<p><a href=\"https:\/\/www.sevenwatt.com\/main\/wp-content\/uploads\/2017\/03\/20170310_192944.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-609\" src=\"https:\/\/www.sevenwatt.com\/main\/wp-content\/uploads\/2017\/03\/20170310_192944.jpg\" alt=\"20170310_192944\" width=\"1393\" height=\"881\" srcset=\"https:\/\/www.sevenwatt.com\/main\/wp-content\/uploads\/2017\/03\/20170310_192944.jpg 1393w, https:\/\/www.sevenwatt.com\/main\/wp-content\/uploads\/2017\/03\/20170310_192944-300x190.jpg 300w, https:\/\/www.sevenwatt.com\/main\/wp-content\/uploads\/2017\/03\/20170310_192944-768x486.jpg 768w, https:\/\/www.sevenwatt.com\/main\/wp-content\/uploads\/2017\/03\/20170310_192944-1024x648.jpg 1024w\" sizes=\"auto, (max-width: 1393px) 100vw, 1393px\" \/><\/a><\/p>\n<p>Opening starts with removing four screws at the rear side. Then separating the front from the case is the though part. At the top and bottom side, there are clips holding the front in place. the plastic is quite sturdy, so there is no other way then trying to squeeze it open at the top corners a bit with plastic wedges, and then just pull with force. When the cover is removed, the socket can be taken out.<\/p>\n<blockquote><p>It contains the NXP JN5168!<\/p><\/blockquote>\n<p>That is good news. It was an educated guess. Peeveeone was able to decipher the puzzle, because an Innr light bulb contained the same module, from which he was able to pull the firmware image. What is there more to see:<\/p>\n<p><a href=\"https:\/\/www.sevenwatt.com\/main\/wp-content\/uploads\/2017\/03\/20170310_193111a.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-612\" src=\"https:\/\/www.sevenwatt.com\/main\/wp-content\/uploads\/2017\/03\/20170310_193111a.jpg\" alt=\"20170310_193111a\" width=\"1696\" height=\"1624\" srcset=\"https:\/\/www.sevenwatt.com\/main\/wp-content\/uploads\/2017\/03\/20170310_193111a.jpg 1696w, https:\/\/www.sevenwatt.com\/main\/wp-content\/uploads\/2017\/03\/20170310_193111a-300x287.jpg 300w, https:\/\/www.sevenwatt.com\/main\/wp-content\/uploads\/2017\/03\/20170310_193111a-768x735.jpg 768w, https:\/\/www.sevenwatt.com\/main\/wp-content\/uploads\/2017\/03\/20170310_193111a-1024x981.jpg 1024w\" sizes=\"auto, (max-width: 1696px) 100vw, 1696px\" \/><\/a><\/p>\n<p>Basically there are three sections. The high-voltage section where a relay switches the 230V. A power metering section that probably is not very useful in a ZLL application. And finally the low-power (3.3V) section containing a JN5168 Zigbee\/MCU module. At the rear side it can be seen that the power measuring section is galvanicly separated by an opto-coupler form the JN5168\u00a0section. There is a 5V-3.3V converter. Below the PCB there is a transformer which generates the 5V to power the low power section and the power measuring section:<\/p>\n<p><a href=\"https:\/\/www.sevenwatt.com\/main\/wp-content\/uploads\/2017\/03\/20170310_193505.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-614\" src=\"https:\/\/www.sevenwatt.com\/main\/wp-content\/uploads\/2017\/03\/20170310_193505.jpg\" alt=\"20170310_193505\" width=\"1698\" height=\"931\" srcset=\"https:\/\/www.sevenwatt.com\/main\/wp-content\/uploads\/2017\/03\/20170310_193505.jpg 1698w, https:\/\/www.sevenwatt.com\/main\/wp-content\/uploads\/2017\/03\/20170310_193505-300x164.jpg 300w, https:\/\/www.sevenwatt.com\/main\/wp-content\/uploads\/2017\/03\/20170310_193505-768x421.jpg 768w, https:\/\/www.sevenwatt.com\/main\/wp-content\/uploads\/2017\/03\/20170310_193505-1024x561.jpg 1024w, https:\/\/www.sevenwatt.com\/main\/wp-content\/uploads\/2017\/03\/20170310_193505-750x410.jpg 750w\" sizes=\"auto, (max-width: 1698px) 100vw, 1698px\" \/><\/a><\/p>\n<p>The castellated JN5168 module soldered onto the main PCB has a remarkable resemblance with the NXP manufactured\u00a0JN5168-001-M00. Lets compare them:<\/p>\n<p><a href=\"https:\/\/www.sevenwatt.com\/main\/wp-content\/uploads\/2017\/03\/20170318_204150.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-616\" src=\"https:\/\/www.sevenwatt.com\/main\/wp-content\/uploads\/2017\/03\/20170318_204150.jpg\" alt=\"20170318_204150\" width=\"1262\" height=\"517\" srcset=\"https:\/\/www.sevenwatt.com\/main\/wp-content\/uploads\/2017\/03\/20170318_204150.jpg 1262w, https:\/\/www.sevenwatt.com\/main\/wp-content\/uploads\/2017\/03\/20170318_204150-300x123.jpg 300w, https:\/\/www.sevenwatt.com\/main\/wp-content\/uploads\/2017\/03\/20170318_204150-768x315.jpg 768w, https:\/\/www.sevenwatt.com\/main\/wp-content\/uploads\/2017\/03\/20170318_204150-1024x419.jpg 1024w\" sizes=\"auto, (max-width: 1262px) 100vw, 1262px\" \/><\/a><\/p>\n<p>The resemblance is amazing. It is basically the same layout, to the level of most traces, capacitors and resistors. Only a tiny bit smaller. It already looks quite obvious, but a little bit of measuring around confirms that the castellated pins follow the pin assignments of the NXP module.<\/p>\n<p>Probing the PCB revealed the following connections from the JN5168 module to the smartplug PCB:<\/p>\n\n<table id=\"tablepress-2\" class=\"tablepress tablepress-id-2\">\n<thead>\n<tr class=\"row-1\">\n\t<th class=\"column-1\">pin<\/th><th class=\"column-2\">name<\/th><th class=\"column-3\">smartplug function<\/th>\n<\/tr>\n<\/thead>\n<tbody class=\"row-striping row-hover\">\n<tr class=\"row-2\">\n\t<td class=\"column-1\">3<\/td><td class=\"column-2\">DO1\/SPIMISO<\/td><td class=\"column-3\">pull low to program<\/td>\n<\/tr>\n<tr class=\"row-3\">\n\t<td class=\"column-1\">12<\/td><td class=\"column-2\">DIO6\/TX<\/td><td class=\"column-3\">TX<\/td>\n<\/tr>\n<tr class=\"row-4\">\n\t<td class=\"column-1\">13<\/td><td class=\"column-2\">DIO7\/RX<\/td><td class=\"column-3\">RX<\/td>\n<\/tr>\n<tr class=\"row-5\">\n\t<td class=\"column-1\">14<\/td><td class=\"column-2\">DIO8<\/td><td class=\"column-3\">BL0930-p14 power metering<\/td>\n<\/tr>\n<tr class=\"row-6\">\n\t<td class=\"column-1\">15<\/td><td class=\"column-2\">DIO9<\/td><td class=\"column-3\">LED<\/td>\n<\/tr>\n<tr class=\"row-7\">\n\t<td class=\"column-1\">16<\/td><td class=\"column-2\">DIO10<\/td><td class=\"column-3\">Manual button<\/td>\n<\/tr>\n<tr class=\"row-8\">\n\t<td class=\"column-1\">17<\/td><td class=\"column-2\">VDD<\/td><td class=\"column-3\">3.3V<\/td>\n<\/tr>\n<tr class=\"row-9\">\n\t<td class=\"column-1\">18<\/td><td class=\"column-2\">GND<\/td><td class=\"column-3\">GND<\/td>\n<\/tr>\n<tr class=\"row-10\">\n\t<td class=\"column-1\">20<\/td><td class=\"column-2\">DIO12<\/td><td class=\"column-3\">Relay<\/td>\n<\/tr>\n<tr class=\"row-11\">\n\t<td class=\"column-1\">22<\/td><td class=\"column-2\">nRESET<\/td><td class=\"column-3\">pull low to reset<\/td>\n<\/tr>\n<tr class=\"row-12\">\n\t<td class=\"column-1\">23<\/td><td class=\"column-2\">DIO14<\/td><td class=\"column-3\">magnetic switch<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<!-- #tablepress-2 from cache -->\n<p>For the following pins I was not able to figure out the connection:<\/p>\n<p><code>&nbsp1 - ADC1<br \/>\n&nbsp9 - DIO3<br \/>\n10 - DIO4<br \/>\n11 - DIO5<br \/>\n19 - DIO11<br \/>\n27 - VREF\/ADC2<br \/>\n<\/code><br \/>\nThe remaining pins <code>(2, 4, 5, 6, 7, 8, 21, 25, 25, 26)<\/code> are not connected.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Philips Hue &#8211; Great, only E27 ad GU10 lights? Great system, but what about the E14 lights that I have around the house, and some others where the bulbs can&#8217;t be replaced with one of the Hue lights? It seems that the Osram Lightify Plug can be connected.\u00a0A solution without soldering and flashing firmware would [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":607,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[59],"tags":[62,60,64,63,61],"class_list":["post-601","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-zigbee-zll","tag-hue","tag-innr","tag-jn5168","tag-philips","tag-smartplug"],"_links":{"self":[{"href":"https:\/\/www.sevenwatt.com\/main\/wp-json\/wp\/v2\/posts\/601","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sevenwatt.com\/main\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sevenwatt.com\/main\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sevenwatt.com\/main\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sevenwatt.com\/main\/wp-json\/wp\/v2\/comments?post=601"}],"version-history":[{"count":16,"href":"https:\/\/www.sevenwatt.com\/main\/wp-json\/wp\/v2\/posts\/601\/revisions"}],"predecessor-version":[{"id":630,"href":"https:\/\/www.sevenwatt.com\/main\/wp-json\/wp\/v2\/posts\/601\/revisions\/630"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.sevenwatt.com\/main\/wp-json\/wp\/v2\/media\/607"}],"wp:attachment":[{"href":"https:\/\/www.sevenwatt.com\/main\/wp-json\/wp\/v2\/media?parent=601"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sevenwatt.com\/main\/wp-json\/wp\/v2\/categories?post=601"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sevenwatt.com\/main\/wp-json\/wp\/v2\/tags?post=601"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}