{"id":3704,"date":"2017-11-12T22:01:50","date_gmt":"2017-11-13T06:01:50","guid":{"rendered":"http:\/\/upon2020.com\/blog\/?p=3704"},"modified":"2018-02-09T17:43:57","modified_gmt":"2018-02-10T01:43:57","slug":"scripting-the-colorful-leds-in-my-office","status":"publish","type":"post","link":"https:\/\/upon2020.com\/blog\/2017\/11\/scripting-the-colorful-leds-in-my-office\/","title":{"rendered":"Scripting the colorful LEDs in my office"},"content":{"rendered":"<p>Finally, <a href=\"https:\/\/www.wireshark.org\/\">Wireshark<\/a> to the rescue, I got my <a href=\"http:\/\/www.limitlessled.com\/\">LimitlessLED<\/a> home office RGB LEDs scripted.<\/p>\n<p>In plain English: I can now send commands from a computer to my lights via WiFi and their base station, and they will turn on or off or red or blue or bright-white or &#8220;party&#8221; or whatever. While I previously could do that with their remote control, and via their iPhone app, now I can do it directly, from software I control. Which opens up all sorts of possibilities &#8230;<\/p>\n<p>I wanted to do that ever since I got the lights, but the very confusing documentation on their <a href=\"http:\/\/www.limitlessled.com\/dev\/\">developer site<\/a> is just about incomprehensible and I couldn&#8217;t get it to work.<\/p>\n<p>So for reference, this is how it works (for me, they have different models and the codes may be slightly different for your model):<\/p>\n<ul>\n<li>All commands are two bytes long and sent over UDP.<\/li>\n<li>The base station listens at port 8899.<\/li>\n<li>The easiest way to send those two bytes is plain-old echo, and netcat, like this:<\/li>\n<\/ul>\n<pre>echo -n -e \"\\x22\\x00\" | nc -u 192.168.100.105 8899 -w 0<\/pre>\n<ul>\n<li>Here I&#8217;m sending 0x22 followed by 0x00, if the IP address of the base station is 192.168.100.105.<\/li>\n<li>Here are the commands I know of it understands (from having Wireshark watch the iPhone app talk to the base station), all in hex:<\/li>\n<\/ul>\n<style>table.t td { text-align: left; width: 50% }<\/style>\n<table class=\"t\">\n<tr>\n<td>off<\/td>\n<td>2100<\/td>\n<\/tr>\n<tr>\n<td>on (last state)<\/td>\n<td>2200<\/td>\n<\/tr>\n<tr>\n<td>long on (all go all bright)<\/td>\n<td>a200<\/td>\n<\/tr>\n<tr>\n<td>increase brightness<\/td>\n<td>2300<\/td>\n<\/tr>\n<tr>\n<td>decrease brightness<\/td>\n<td>2400<\/td>\n<\/tr>\n<tr>\n<td>colors starting with blue<\/td>\n<td>2000<\/td>\n<\/tr>\n<tr>\n<td>&#8230;through the color circle back to blue<\/td>\n<td>20ff<\/td>\n<\/tr>\n<tr>\n<td>e.g. red<\/td>\n<td>20af<\/td>\n<\/tr>\n<tr>\n<td>e.g. yellow<\/td>\n<td>207s<\/td>\n<\/tr>\n<tr>\n<td>light show 1<\/td>\n<td>2700<\/td>\n<\/tr>\n<tr>\n<td>light show 2<\/td>\n<td>2800<\/td>\n<\/tr>\n<tr>\n<td>zone 1 on<\/td>\n<td>4500<\/td>\n<\/tr>\n<tr>\n<td>zone 1 off<\/td>\n<td>4600<\/td>\n<\/tr>\n<tr>\n<td>zone 2 on<\/td>\n<td>4700<\/td>\n<\/tr>\n<tr>\n<td>zone 2 off<\/td>\n<td>4800<\/td>\n<\/tr>\n<tr>\n<td>zone 3 on<\/td>\n<td>4900<\/td>\n<\/tr>\n<tr>\n<td>zone 3 off<\/td>\n<td>4a00<\/td>\n<\/tr>\n<tr>\n<td>zone 4 on<\/td>\n<td>4b00<\/td>\n<\/tr>\n<tr>\n<td>zone 4 off<\/td>\n<td>4c00<\/td>\n<\/tr>\n<\/table>\n<p>If the top bit is set, it means &#8220;the button was pressed long&#8221; (e.g. a100 vs 2100). If the first byte starts with 4 instead of 2, it means &#8220;brighter&#8221;.<\/p>\n<p>Which possibilities? Lots of them, like:<\/p>\n<ul>\n<li>Turn the lights on automatically (and gradually) as it gets dark outside.<\/li>\n<li>Flash the lights in red 5 min before my next conference call.<\/li>\n<li>Flash the lights in green somebody is at the front door.<\/li>\n<li>Turn on party lights for 5 min every hour of work, to remember the get up and move around.<\/li>\n<\/ul>\n<p>There will be more ideas ..<strong>.<\/p>\n<p>Update Feb. 2018:<\/strong> More content for the above table. And there&#8217;s some code to drive this at <a href=\"https:\/\/github.com\/jernst\/milight\">github.com\/jernst\/milight<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Finally, Wireshark to the rescue, I got my LimitlessLED home office RGB LEDs scripted. In plain English: I can now send commands from a computer to my lights via WiFi and their base station, and they will turn on or off or red or blue or bright-white or &#8220;party&#8221; or whatever. While I previously could&hellip;<\/p>\n","protected":false},"author":2,"featured_media":0,"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,"webmentions_disabled":false,"footnotes":""},"categories":[25,332],"tags":[508,509,437,435],"class_list":["post-3704","post","type-post","status-publish","format-standard","hentry","category-devices","category-iot","tag-led","tag-light","tag-limitlessled","tag-office","kind-article"],"kind":false,"_links":{"self":[{"href":"https:\/\/upon2020.com\/blog\/wp-json\/wp\/v2\/posts\/3704","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/upon2020.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/upon2020.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/upon2020.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/upon2020.com\/blog\/wp-json\/wp\/v2\/comments?post=3704"}],"version-history":[{"count":8,"href":"https:\/\/upon2020.com\/blog\/wp-json\/wp\/v2\/posts\/3704\/revisions"}],"predecessor-version":[{"id":3809,"href":"https:\/\/upon2020.com\/blog\/wp-json\/wp\/v2\/posts\/3704\/revisions\/3809"}],"wp:attachment":[{"href":"https:\/\/upon2020.com\/blog\/wp-json\/wp\/v2\/media?parent=3704"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/upon2020.com\/blog\/wp-json\/wp\/v2\/categories?post=3704"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/upon2020.com\/blog\/wp-json\/wp\/v2\/tags?post=3704"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}