{"id":123,"date":"2016-06-24T00:47:49","date_gmt":"2016-06-24T00:47:49","guid":{"rendered":"https:\/\/smartlifeautomated.wordpress.com\/?p=123"},"modified":"2017-06-20T15:30:43","modified_gmt":"2017-06-20T15:30:43","slug":"smartlife-h801-esp8266-based-rgbw-controller","status":"publish","type":"post","link":"https:\/\/smartlife.tech\/blog\/2016\/06\/24\/smartlife-h801-esp8266-based-rgbw-controller\/","title":{"rendered":"SmartLife (H801) esp8266 Based RGBW Controller"},"content":{"rendered":"<p><span style=\"font-weight:400;\">This is a relatively inexpensive RGBW controller powered by the esp8266. It is a great little device that I have spent some time working on. Currently using 3 in my home and they have been great. This is fun little device!<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-138\" src=\"https:\/\/smartlife.tech\/blog\/wp-content\/uploads\/2016\/06\/20160623_171501.jpg\" alt=\"20160623_171501.jpg\" width=\"614\" height=\"344\" srcset=\"https:\/\/smartlife.tech\/blog\/wp-content\/uploads\/2016\/06\/20160623_171501.jpg 614w, https:\/\/smartlife.tech\/blog\/wp-content\/uploads\/2016\/06\/20160623_171501-300x168.jpg 300w\" sizes=\"auto, (max-width: 614px) 100vw, 614px\" \/><\/p>\n<p><!--more-->I have created a service manager, device handler, and firmware for the device for SmartThings. Like I said, it is a great device, but the software probably needs some bugs ironed out. I am working on it with my limited time so hopefully it will get polished eventually.<\/p>\n<p><span style=\"font-weight:400;\">The service manager lets you create \u201cprograms\u201d and virtual switches for the programs. This way you can have a program activated based on an event. For example, you could have the LEDs flash blue and red if someone opens the front door in the middle of the night. The virtual switch will show up as a regular switch in SmartThings so there are many possibilities with this.<\/span><\/p>\n<h2>Firmware Flashing<\/h2>\n<p><span style=\"font-weight:400;\">You can flash the device just like most other esp8266 devices. D<\/span>ownload the <a href=\"https:\/\/github.com\/erocm123\/SmartThingsPublic\/raw\/master\/devicetypes\/erocm123\/sonoff-wifi-switch.src\/ESPEasy_R120.zip\" target=\"_blank\">ESPEasy firmware flashing tool<\/a>. You will use esptool.exe from this zip to flash the firmware. Next download the <a href=\"https:\/\/github.com\/erocm123\/SmartThingsPublic\/raw\/master\/devicetypes\/erocm123\/smartlife-rgbw-controller.src\/SmartLifeRGBWController.ino.generic.bin\" target=\"_blank\">firmware image that I have built here<\/a>, and place it in the same directory that you extracted the esptool.exe binary. Connect the FTDI adapter (SET AT 3.3V) to the controller leads marked TX, RX, GND, &amp; 3.3 and connect it to your computer. Bridge (or connect) the two leads labeled &#8220;J3&#8221; together and power up the controller. This puts it in flashing mode. Run the following command (make sure to replace %comport% with the comport number of your FTDI adapter i.e. COM6):<\/p>\n<blockquote><p>esptool.exe -vv -cd nodemcu -cb 115200 -cp COM%comport% -ca 0x00000 -cf SmartLifeRGBWController.ino.generic.bin<\/p><\/blockquote>\n<p><span style=\"font-weight:400;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-146\" src=\"https:\/\/smartlife.tech\/blog\/wp-content\/uploads\/2016\/06\/rgbw_board.jpg\" alt=\"RGBW_Board\" width=\"2550\" height=\"1433\" srcset=\"https:\/\/smartlife.tech\/blog\/wp-content\/uploads\/2016\/06\/rgbw_board.jpg 2550w, https:\/\/smartlife.tech\/blog\/wp-content\/uploads\/2016\/06\/rgbw_board-300x169.jpg 300w, https:\/\/smartlife.tech\/blog\/wp-content\/uploads\/2016\/06\/rgbw_board-768x432.jpg 768w, https:\/\/smartlife.tech\/blog\/wp-content\/uploads\/2016\/06\/rgbw_board-1024x575.jpg 1024w\" sizes=\"auto, (max-width: 2550px) 100vw, 2550px\" \/> <\/span><\/p>\n<h2>SmartThings Config<\/h2>\n<p><span style=\"font-weight:400;\">Second, there are three SmartThings pieces of code that need to be installed. First, the device handler for the Controller. Then the device handler for the virtual switch. Lastly, the SmartApp. They are listed at the bottom of this post.<\/span><\/p>\n<div id='gallery-1' class='gallery galleryid-123 gallery-columns-3 gallery-size-thumbnail'><figure class='gallery-item'>\n\t\t\t<div class='gallery-icon portrait'>\n\t\t\t\t<a href='https:\/\/smartlife.tech\/blog\/2016\/06\/24\/smartlife-h801-esp8266-based-rgbw-controller\/screenshot_20160623-160733\/'><img loading=\"lazy\" decoding=\"async\" width=\"150\" height=\"150\" src=\"https:\/\/smartlife.tech\/blog\/wp-content\/uploads\/2016\/06\/screenshot_20160623-160733-150x150.png\" class=\"attachment-thumbnail size-thumbnail\" alt=\"\" \/><\/a>\n\t\t\t<\/div><\/figure><figure class='gallery-item'>\n\t\t\t<div class='gallery-icon portrait'>\n\t\t\t\t<a href='https:\/\/smartlife.tech\/blog\/2016\/06\/24\/smartlife-h801-esp8266-based-rgbw-controller\/screenshot_20160623-160827\/'><img loading=\"lazy\" decoding=\"async\" width=\"150\" height=\"150\" src=\"https:\/\/smartlife.tech\/blog\/wp-content\/uploads\/2016\/06\/screenshot_20160623-160827-150x150.png\" class=\"attachment-thumbnail size-thumbnail\" alt=\"\" \/><\/a>\n\t\t\t<\/div><\/figure><figure class='gallery-item'>\n\t\t\t<div class='gallery-icon portrait'>\n\t\t\t\t<a href='https:\/\/smartlife.tech\/blog\/2016\/06\/24\/smartlife-h801-esp8266-based-rgbw-controller\/screenshot_20160623-160842\/'><img loading=\"lazy\" decoding=\"async\" width=\"150\" height=\"150\" src=\"https:\/\/smartlife.tech\/blog\/wp-content\/uploads\/2016\/06\/screenshot_20160623-160842-150x150.png\" class=\"attachment-thumbnail size-thumbnail\" alt=\"\" \/><\/a>\n\t\t\t<\/div><\/figure><figure class='gallery-item'>\n\t\t\t<div class='gallery-icon portrait'>\n\t\t\t\t<a href='https:\/\/smartlife.tech\/blog\/2016\/06\/24\/smartlife-h801-esp8266-based-rgbw-controller\/screenshot_20160623-160856\/'><img loading=\"lazy\" decoding=\"async\" width=\"150\" height=\"150\" src=\"https:\/\/smartlife.tech\/blog\/wp-content\/uploads\/2016\/06\/screenshot_20160623-1608561-150x150.png\" class=\"attachment-thumbnail size-thumbnail\" alt=\"\" \/><\/a>\n\t\t\t<\/div><\/figure><figure class='gallery-item'>\n\t\t\t<div class='gallery-icon portrait'>\n\t\t\t\t<a href='https:\/\/smartlife.tech\/blog\/2016\/06\/24\/smartlife-h801-esp8266-based-rgbw-controller\/screenshot_20160623-160909\/'><img loading=\"lazy\" decoding=\"async\" width=\"150\" height=\"150\" src=\"https:\/\/smartlife.tech\/blog\/wp-content\/uploads\/2016\/06\/screenshot_20160623-1609091-150x150.png\" class=\"attachment-thumbnail size-thumbnail\" alt=\"\" srcset=\"https:\/\/smartlife.tech\/blog\/wp-content\/uploads\/2016\/06\/screenshot_20160623-1609091-150x150.png 150w, https:\/\/smartlife.tech\/blog\/wp-content\/uploads\/2016\/06\/screenshot_20160623-1609091-200x200.png 200w\" sizes=\"auto, (max-width: 150px) 100vw, 150px\" \/><\/a>\n\t\t\t<\/div><\/figure><figure class='gallery-item'>\n\t\t\t<div class='gallery-icon portrait'>\n\t\t\t\t<a href='https:\/\/smartlife.tech\/blog\/2016\/06\/24\/smartlife-h801-esp8266-based-rgbw-controller\/screenshot_20160623-160958\/'><img loading=\"lazy\" decoding=\"async\" width=\"150\" height=\"150\" src=\"https:\/\/smartlife.tech\/blog\/wp-content\/uploads\/2016\/06\/screenshot_20160623-1609581-150x150.png\" class=\"attachment-thumbnail size-thumbnail\" alt=\"\" \/><\/a>\n\t\t\t<\/div><\/figure><figure class='gallery-item'>\n\t\t\t<div class='gallery-icon portrait'>\n\t\t\t\t<a href='https:\/\/smartlife.tech\/blog\/2016\/06\/24\/smartlife-h801-esp8266-based-rgbw-controller\/screenshot_20160623-161043\/'><img loading=\"lazy\" decoding=\"async\" width=\"150\" height=\"150\" src=\"https:\/\/smartlife.tech\/blog\/wp-content\/uploads\/2016\/06\/screenshot_20160623-1610431-150x150.png\" class=\"attachment-thumbnail size-thumbnail\" alt=\"\" \/><\/a>\n\t\t\t<\/div><\/figure>\n\t\t<\/div>\n\n<p><span style=\"font-weight:400;\">After the firmware is flashed, the device will broadcast an ssid of espRGBW.[mac address]. Connect to it with the password \u201cconfigme\u201d. After you are connected, browse to <\/span><a href=\"http:\/\/192.168.4.1\"><span style=\"font-weight:400;\">http:\/\/192.168.4.1<\/span><\/a><span style=\"font-weight:400;\"> and connect the device to your wifi network.<\/span><\/p>\n<p><span style=\"font-weight:400;\">From that point you will open the service manager app and discover new devices. It should find the device on your network as long as SSDP is working properly on all of your devices. After it is added, you can create programs, virtual switches, and rename them all from in the service manager.<\/span><\/p>\n<p><span style=\"font-weight:400;\">Like I said, this is a work in progress and I will work on it when I can. In its current state it works really well. Good luck and have fun. This is a nifty device. <\/span><\/p>\n<h2>Controller Device Handler:<\/h2>\n<p><a href=\"https:\/\/github.com\/erocm123\/SmartThingsPublic\/blob\/master\/devicetypes\/erocm123\/smartlife-rgbw-controller.src\/smartlife-rgbw-controller.groovy\"><span style=\"font-weight:400;\">https:\/\/github.com\/erocm123\/SmartThingsPublic\/blob\/master\/devicetypes\/erocm123\/smartlife-rgbw-controller.src\/smartlife-rgbw-controller.groovy<\/span><\/a><\/p>\n<h2>Virtual Switch Device Handler:<\/h2>\n<p><a href=\"https:\/\/github.com\/erocm123\/SmartThingsPublic\/blob\/master\/devicetypes\/erocm123\/smartlife-rgbw-virtual-switch.src\/smartlife-rgbw-virtual-switch.groovy\"><span style=\"font-weight:400;\">https:\/\/github.com\/erocm123\/SmartThingsPublic\/blob\/master\/devicetypes\/erocm123\/smartlife-rgbw-virtual-switch.src\/smartlife-rgbw-virtual-switch.groovy<\/span><\/a><\/p>\n<h2>Service Manager SmartApp:<\/h2>\n<p><a href=\"https:\/\/github.com\/erocm123\/SmartThingsPublic\/blob\/master\/smartapps\/erocm123\/smartlife-rgbw-light-connect.src\/smartlife-rgbw-light-connect.groovy\"><span style=\"font-weight:400;\">https:\/\/github.com\/erocm123\/SmartThingsPublic\/blob\/master\/smartapps\/erocm123\/smartlife-rgbw-light-connect.src\/smartlife-rgbw-light-connect.groovy<\/span><\/a><\/p>\n<h2>Where to purchase<\/h2>\n<p>There are several places you can buy these, but I got mine from <a href=\"http:\/\/www.aliexpress.com\/item\/DC5-24V-Wireless-Smart-Dimmer-Receiver-Output-5-Routes-PWM-Data-WiFi-APP-Controlled-for-RGBW\/32634286022.html\" target=\"_blank\">AliExpress<\/a>.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is a relatively inexpensive RGBW controller powered by the esp8266. It is a great little device that I have spent some time working on. Currently using 3 in my home and they have been great. This is fun little device!<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"categories":[6,4,5],"tags":[],"class_list":["post-123","post","type-post","status-publish","format-standard","hentry","category-home-automation","category-sonoff","category-wifi"],"_links":{"self":[{"href":"https:\/\/smartlife.tech\/blog\/wp-json\/wp\/v2\/posts\/123","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/smartlife.tech\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/smartlife.tech\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/smartlife.tech\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/smartlife.tech\/blog\/wp-json\/wp\/v2\/comments?post=123"}],"version-history":[{"count":1,"href":"https:\/\/smartlife.tech\/blog\/wp-json\/wp\/v2\/posts\/123\/revisions"}],"predecessor-version":[{"id":764,"href":"https:\/\/smartlife.tech\/blog\/wp-json\/wp\/v2\/posts\/123\/revisions\/764"}],"wp:attachment":[{"href":"https:\/\/smartlife.tech\/blog\/wp-json\/wp\/v2\/media?parent=123"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/smartlife.tech\/blog\/wp-json\/wp\/v2\/categories?post=123"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/smartlife.tech\/blog\/wp-json\/wp\/v2\/tags?post=123"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}