{"id":4239,"date":"2024-12-23T08:16:33","date_gmt":"2024-12-23T14:16:33","guid":{"rendered":"https:\/\/lab.rapternet.us\/?p=4239"},"modified":"2024-09-27T20:17:49","modified_gmt":"2024-09-28T01:17:49","slug":"espdeck-3-led-backlighting","status":"publish","type":"post","link":"https:\/\/lab.rapternet.us\/?p=4239","title":{"rendered":"ESPDeck 3 + LED Backlighting"},"content":{"rendered":"\n<p>Ever since I integrated per key LEDs in the NFC Deck, I have wanted to update the ESP Deck design to incorporate them (and update some of my keypads to include them too). I finally got around to both of these, swapping the switches for clear switches on one of my ESP Decks and integrating in the LED lighting.<\/p>\n\n\n\n<!--more-->\n\n\n\n<p>This is a relatively easy addition onto the EspDeck especially if it was originally assembled with clear key switches (RGB compatible). <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Wiring Design<\/h2>\n\n\n\n<p>Wiring in the LEDs is simple. They need one GPIO pin and a connection to the 5v power.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>VIN to ESP VIN (5V +)<\/li>\n\n\n\n<li>DIN to ESP D2 (GPIO 4)<\/li>\n\n\n\n<li>GND to ESP GND<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Hardware Update<\/h2>\n\n\n\n<p>If you didn&#8217;t use RGB capable (clear-ish) key switches like I did, installing per key lighting also means swapping your switches too. As long as they aren&#8217;t all very well hot glued in, it shouldn&#8217;t be too bad to swap. I swapped them one by one, de-soldering them, pulling the one switch out, replacing it with the new one and soldering in the new one.<\/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-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"771\" data-id=\"4267\" src=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2024\/09\/pxl_20240914_1911338565523167804508933738-1024x771.jpg\" alt=\"\" class=\"wp-image-4267\" srcset=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2024\/09\/pxl_20240914_1911338565523167804508933738-1024x771.jpg 1024w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2024\/09\/pxl_20240914_1911338565523167804508933738-300x226.jpg 300w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2024\/09\/pxl_20240914_1911338565523167804508933738-768x578.jpg 768w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2024\/09\/pxl_20240914_1911338565523167804508933738-1536x1157.jpg 1536w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2024\/09\/pxl_20240914_1911338565523167804508933738.jpg 2000w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><figcaption class=\"wp-element-caption\">Starting to swap the switches<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1506\" height=\"2000\" data-id=\"4269\" src=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2024\/09\/pxl_20240914_1921361233867140434720201641.jpg\" alt=\"\" class=\"wp-image-4269\" srcset=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2024\/09\/pxl_20240914_1921361233867140434720201641.jpg 1506w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2024\/09\/pxl_20240914_1921361233867140434720201641-226x300.jpg 226w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2024\/09\/pxl_20240914_1921361233867140434720201641-771x1024.jpg 771w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2024\/09\/pxl_20240914_1921361233867140434720201641-768x1020.jpg 768w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2024\/09\/pxl_20240914_1921361233867140434720201641-1157x1536.jpg 1157w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><figcaption class=\"wp-element-caption\">Almost Finished<\/figcaption><\/figure>\n<\/figure>\n\n\n\n<p>After all the switches are soldered in, the LEDs can be installed. I slid the LEDs under the wiring for the switches and into position. It&#8217;s a bit finicky if you don&#8217;t have much slack on the wires between the switches, but the LEDs are small enough to fit through the gaps.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"771\" src=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2024\/09\/pxl_20240914_194620898238215618542657379-1024x771.jpg\" alt=\"\" class=\"wp-image-4268\" srcset=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2024\/09\/pxl_20240914_194620898238215618542657379-1024x771.jpg 1024w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2024\/09\/pxl_20240914_194620898238215618542657379-300x226.jpg 300w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2024\/09\/pxl_20240914_194620898238215618542657379-768x578.jpg 768w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2024\/09\/pxl_20240914_194620898238215618542657379-1536x1157.jpg 1536w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2024\/09\/pxl_20240914_194620898238215618542657379.jpg 2000w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><figcaption class=\"wp-element-caption\">LEDs in place<\/figcaption><\/figure>\n\n\n\n<p>I used hot glue on the edges of the LEDs to keep them in place in the grid. They should align reasonably well with the middle LED in the little notch in the middle key switch. I also used this notch as the orienting piece to determine which direction the LEDs will run.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"771\" src=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2024\/09\/pxl_20240914_1952501096734261877936794165-1024x771.jpg\" alt=\"\" class=\"wp-image-4272\" srcset=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2024\/09\/pxl_20240914_1952501096734261877936794165-1024x771.jpg 1024w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2024\/09\/pxl_20240914_1952501096734261877936794165-300x226.jpg 300w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2024\/09\/pxl_20240914_1952501096734261877936794165-768x578.jpg 768w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2024\/09\/pxl_20240914_1952501096734261877936794165-1536x1157.jpg 1536w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2024\/09\/pxl_20240914_1952501096734261877936794165.jpg 2000w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><figcaption class=\"wp-element-caption\">Hot gluing the LEDs in place<\/figcaption><\/figure>\n\n\n\n<p>With the LEDs in place, we need to wire the LEDs to VIN, GND and D2. I soldered them to the top of the PCB without taking it out of the case. <\/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\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"771\" data-id=\"4270\" src=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2024\/09\/pxl_20240914_1946250342994096037217479554-1024x771.jpg\" alt=\"\" class=\"wp-image-4270\" srcset=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2024\/09\/pxl_20240914_1946250342994096037217479554-1024x771.jpg 1024w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2024\/09\/pxl_20240914_1946250342994096037217479554-300x226.jpg 300w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2024\/09\/pxl_20240914_1946250342994096037217479554-768x578.jpg 768w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2024\/09\/pxl_20240914_1946250342994096037217479554-1536x1157.jpg 1536w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2024\/09\/pxl_20240914_1946250342994096037217479554.jpg 2000w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><figcaption class=\"wp-element-caption\">Wired into the ESP<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"2000\" height=\"1506\" data-id=\"4271\" src=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2024\/09\/pxl_20240914_1946297796884176109494439933.jpg\" alt=\"\" class=\"wp-image-4271\" srcset=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2024\/09\/pxl_20240914_1946297796884176109494439933.jpg 2000w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2024\/09\/pxl_20240914_1946297796884176109494439933-300x226.jpg 300w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2024\/09\/pxl_20240914_1946297796884176109494439933-1024x771.jpg 1024w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2024\/09\/pxl_20240914_1946297796884176109494439933-768x578.jpg 768w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2024\/09\/pxl_20240914_1946297796884176109494439933-1536x1157.jpg 1536w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><figcaption class=\"wp-element-caption\">All Wired Up<\/figcaption><\/figure>\n<\/figure>\n\n\n\n<p>With the entire thing wired up, tested, and reassembled, we have LIGHTING!<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"771\" src=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2024\/09\/pxl_20240914_2006240418771947157664137913-1024x771.jpg\" alt=\"\" class=\"wp-image-4273\" srcset=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2024\/09\/pxl_20240914_2006240418771947157664137913-1024x771.jpg 1024w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2024\/09\/pxl_20240914_2006240418771947157664137913-300x226.jpg 300w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2024\/09\/pxl_20240914_2006240418771947157664137913-768x578.jpg 768w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2024\/09\/pxl_20240914_2006240418771947157664137913-1536x1157.jpg 1536w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2024\/09\/pxl_20240914_2006240418771947157664137913.jpg 2000w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><figcaption class=\"wp-element-caption\">Lighting!<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">ESPHome YAML<\/h2>\n\n\n\n<p>With the LEDs in place, I updated the ESPHome YAML and uploaded the new firmware to the ESP.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># Configure LED<br \/>light:<br \/>&nbsp; - platform: neopixelbus<br \/>&nbsp;&nbsp;&nbsp; variant: WS2812<br \/>&nbsp;&nbsp;&nbsp; pin: 4<br \/>&nbsp;&nbsp;&nbsp; num_leds: 9<br \/>&nbsp;&nbsp;&nbsp; flash_transition_length: 500ms<br \/>&nbsp;&nbsp;&nbsp; type: GRB<br \/>&nbsp;&nbsp;&nbsp; id: light_strip<br \/>&nbsp;&nbsp;&nbsp; name: \"${friendly_name} LED\"<br \/>&nbsp;&nbsp;&nbsp; restore_mode: ALWAYS_OFF<br \/>&nbsp;&nbsp;&nbsp; effects:<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - addressable_lambda:<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; name: \"My Custom Effect\"<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; update_interval: 16ms<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lambda: |-<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (int i = it.size() - 1; i &gt; 0; i--) {<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; it[i] = it[i - 1].get();<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; it[0] = Color::random_color();<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; it.range(0, 8) = Color::BLACK;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; it.all().fade_to_black(10);<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - addressable_lambda:<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; name: \"Wipe In\"<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; update_interval: 12ms<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lambda: |-<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; static int x = 0;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (initial_run) {<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x = 0;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; it.all() = ESPColor::BLACK;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (x &lt; it.size()) {<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; it[x] = current_color;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x += 1;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; delay(500);<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - addressable_lambda:<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; name: \"Wipe Out\"<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; update_interval: 12ms<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lambda: |-<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; static int x = 0;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (initial_run) {<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x = it.size();<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (x &gt; 0) {<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x -= 1;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; it[x] = ESPColor::BLACK;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br \/>&nbsp; - platform: partition<br \/>&nbsp;&nbsp;&nbsp; name: \"Key 3 Light\"<br \/>&nbsp;&nbsp;&nbsp; id: activity_led<br \/>&nbsp;&nbsp;&nbsp; segments:<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - id: light_strip<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; from: 0<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; to: 0<br \/>&nbsp; - platform: partition<br \/>&nbsp;&nbsp;&nbsp; name: \"Key 6 Light\"<br \/>&nbsp;&nbsp;&nbsp; segments:<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - id: light_strip<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; from: 1<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; to: 1<br \/>&nbsp; - platform: partition<br \/>&nbsp;&nbsp;&nbsp; name: \"Key 9 Light\"<br \/>&nbsp;&nbsp;&nbsp; segments:<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - id: light_strip<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; from: 2<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; to: 2<br \/>&nbsp; - platform: partition<br \/>&nbsp;&nbsp;&nbsp; name: \"Key 8 Light\"<br \/>&nbsp;&nbsp;&nbsp; segments:<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - id: light_strip<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; from: 3<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; to: 3<br \/>&nbsp; - platform: partition<br \/>&nbsp;&nbsp;&nbsp; name: \"Key 5 Light\"<br \/>&nbsp;&nbsp;&nbsp; segments:<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - id: light_strip<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; from: 4<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; to: 4<br \/>&nbsp; - platform: partition<br \/>&nbsp;&nbsp;&nbsp; name: \"Key 2 Light\"<br \/>&nbsp;&nbsp;&nbsp; segments:<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - id: light_strip<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; from: 5<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; to: 5<br \/>&nbsp; - platform: partition<br \/>&nbsp;&nbsp;&nbsp; name: \"Key 1 Light\"<br \/>&nbsp;&nbsp;&nbsp; segments:<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - id: light_strip<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; from: 6<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; to: 6<br \/>&nbsp; - platform: partition<br \/>&nbsp;&nbsp;&nbsp; name: \"Key 4 Light\"<br \/>&nbsp;&nbsp;&nbsp; segments:<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - id: light_strip<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; from: 7<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; to: 7<br \/>&nbsp; - platform: partition<br \/>&nbsp;&nbsp;&nbsp; name: \"Key 7 Light\"<br \/>&nbsp;&nbsp;&nbsp; segments:<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - id: light_strip<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; from: 8<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; to: 8<\/pre>\n\n\n\n<p>To make sure all the lights are numbered correctly in Home Assistant. Activate each light in home assistant, noting which button they come from, then update the YAML config so that it all matches what you&#8217;re expecting in my case, my LEDs are not going left to right, but top to bottom.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Automations making use of it<\/h2>\n\n\n\n<p>For an example of automations making use of this feature, you can see my <a href=\"https:\/\/lab.rapternet.us\/?p=3737\">LED Notifications<\/a> post, which uses the NFC Deck backlit keys, but will work exactly the same as with the ESPDeck here.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>Adding LED backlighting to the ESP Deck gives the unit some feedback and information it can provide back to the user. It&#8217;s also pretty simple to add either while making it or even after the fact in this case. I certainly won&#8217;t be leaving it out of future keypads that I build.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ever since I integrated per key LEDs in the NFC Deck, I have wanted to update the ESP Deck design to incorporate them (and update some of my keypads to include them too). I finally got around to both of these, swapping the switches for clear switches on one of my ESP Decks and integrating &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/lab.rapternet.us\/?p=4239\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;ESPDeck 3 + LED Backlighting&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":4273,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[76,74,39,49],"class_list":["post-4239","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-how-to","tag-espdeck","tag-esphome","tag-home-assistant","tag-smart-home"],"_links":{"self":[{"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=\/wp\/v2\/posts\/4239","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4239"}],"version-history":[{"count":16,"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=\/wp\/v2\/posts\/4239\/revisions"}],"predecessor-version":[{"id":4441,"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=\/wp\/v2\/posts\/4239\/revisions\/4441"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=\/wp\/v2\/media\/4273"}],"wp:attachment":[{"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4239"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4239"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4239"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}