-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathflows.json
1 lines (1 loc) · 30.2 KB
/
flows.json
1
[{"id":"f3a9e590.48942","type":"tab","label":"RGB Led control","disabled":false,"info":"Drive rgbw leds with ble bluetooth low energy adapter.\n\nTested with raspberry pi 4 and Triones rgb led strip. \n\n"},{"id":"8f1057f8.5d4d78","type":"Generic BLE","z":"","localName":"Triones-FFFF000081","address":"ff:ff:00:00:81:19","uuid":"ffff00008119","muteNotifyEvents":false,"operationTimeout":"1000","characteristics":[{"uuid":"2a00","name":"Device Name","type":"org.bluetooth.characteristic.gap.device_name","notifiable":true,"readable":true,"writable":false,"writeWithoutResponse":false},{"uuid":"2a01","name":"Appearance","type":"org.bluetooth.characteristic.gap.appearance","notifiable":false,"readable":true,"writable":false,"writeWithoutResponse":false},{"uuid":"2a04","name":"Peripheral Preferred Connection Parameters","type":"org.bluetooth.characteristic.gap.peripheral_preferred_connection_parameters","notifiable":false,"readable":true,"writable":false,"writeWithoutResponse":false},{"uuid":"2a05","name":"Service Changed","type":"org.bluetooth.characteristic.gatt.service_changed","notifiable":false,"readable":false,"writable":false,"writeWithoutResponse":false},{"uuid":"2a50","name":"PnP ID","type":"org.bluetooth.characteristic.pnp_id","notifiable":false,"readable":true,"writable":false,"writeWithoutResponse":false},{"uuid":"ffd1","name":"<Unnamed>","type":"(Custom Type)","notifiable":false,"readable":false,"writable":false,"writeWithoutResponse":true},{"uuid":"ffd4","name":"<Unnamed>","type":"(Custom Type)","notifiable":true,"readable":false,"writable":false,"writeWithoutResponse":false},{"uuid":"ffd9","name":"<Unnamed>","type":"(Custom Type)","notifiable":false,"readable":false,"writable":false,"writeWithoutResponse":true},{"uuid":"ffda","name":"<Unnamed>","type":"(Custom Type)","notifiable":true,"readable":false,"writable":false,"writeWithoutResponse":false}]},{"id":"d5432831.b3f828","type":"ui_group","z":"","name":"Default","tab":"629eee5c.3d15","disp":true,"width":"6","collapse":false},{"id":"629eee5c.3d15","type":"ui_tab","z":"","name":"Home","icon":"dashboard","disabled":false,"hidden":false},{"id":"ddca90ff.abdfd8","type":"ui_base","theme":{"name":"theme-light","lightTheme":{"default":"#0094CE","baseColor":"#0094CE","baseFont":"-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif","edited":true,"reset":false},"darkTheme":{"default":"#097479","baseColor":"#097479","baseFont":"-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif","edited":false},"customTheme":{"name":"Untitled Theme 1","default":"#4B7930","baseColor":"#4B7930","baseFont":"-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif"},"themeState":{"base-color":{"default":"#0094CE","value":"#0094CE","edited":false},"page-titlebar-backgroundColor":{"value":"#0094CE","edited":false},"page-backgroundColor":{"value":"#fafafa","edited":false},"page-sidebar-backgroundColor":{"value":"#ffffff","edited":false},"group-textColor":{"value":"#1bbfff","edited":false},"group-borderColor":{"value":"#ffffff","edited":false},"group-backgroundColor":{"value":"#ffffff","edited":false},"widget-textColor":{"value":"#111111","edited":false},"widget-backgroundColor":{"value":"#0094ce","edited":false},"widget-borderColor":{"value":"#ffffff","edited":false},"base-font":{"value":"-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif"}},"angularTheme":{"primary":"indigo","accents":"blue","warn":"red","background":"grey"}},"site":{"name":"Node-RED Dashboard","hideToolbar":"false","allowSwipe":"false","lockMenu":"false","allowTempTheme":"true","dateFormat":"DD/MM/YYYY","sizes":{"sx":48,"sy":48,"gx":6,"gy":6,"cx":6,"cy":6,"px":0,"py":0}}},{"id":"36c9c7ab.2d008","type":"inject","z":"f3a9e590.48942","name":"Power off","topic":"","payload":"{\"uuid\":\"ffff00008119\",\"ffd9\":\"cc2433\"}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":220,"y":260,"wires":[["bddefcce.60afe"]]},{"id":"41b9a44.781a5dc","type":"Generic BLE in","z":"f3a9e590.48942","name":"","genericBle":"8f1057f8.5d4d78","useString":false,"notification":true,"x":450,"y":140,"wires":[["f5457ad1.c54e48"]]},{"id":"f5457ad1.c54e48","type":"debug","z":"f3a9e590.48942","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":680,"y":160,"wires":[]},{"id":"e034538b.cf40f","type":"inject","z":"f3a9e590.48942","name":"Power on","topic":"","payload":"{\"uuid\":\"ffff00008119\",\"ffd9\":\"cc2333\"}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":220,"y":220,"wires":[["bddefcce.60afe"]]},{"id":"bddefcce.60afe","type":"Generic BLE out","z":"f3a9e590.48942","name":"","genericBle":"8f1057f8.5d4d78","x":910,"y":400,"wires":[]},{"id":"a4c2ee59.5c23a8","type":"comment","z":"f3a9e590.48942","name":"Protocol reverse","info":"Please refer to https://github.com/madhead/saberlight/blob/master/protocols/Triones/protocol.md \n\n**This is only for a backup purpose**\n\n# The droids we are looking for\n\n<img src=\"../ZJ-MBL-RGBW (v3)/sample.png\" alt=\"Subject appearance\" width=\"100%\">\n\nThis document describes GATT characteristics used to control Triones smart RGBW BLE bulbs (like on the picture above). Yes, they look the same as [Zengge bulbs](../ZJ-MBL-RGBW (v3)/protocol.md). My guess is that all cheap Chinese bulbs looks identically to each other, and only differ in GATT characteristics UUIDs.\n\nAll the text below is a result of my own experience of reverse-engineering its protocol. Use it at your own risk, **I am not responsible for your hardware.**\n\n# Communication principles\n\nTODO\n\n# The protocol\n\n## Status\n\nStatus request is used to query some generic bulb parameters, like power status, current color or built-in mode. Status query is done in \"write and listen\" manner, so it will not work in non-interactive `gatttool` mode (you won't be able to see the result). Check [the code](../../app/commands/status.go) for more details.\n\n#### Request\n\n<table>\n\t<tbody>\n\t\t<tr>\n\t\t\t<td>Type</td>\n\t\t\t<td>Write and listen</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td>Write to</td>\n\t\t\t<td><code>FFD9</code></td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td>Notification from</td>\n\t\t\t<td><code>FFD4</code></td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td>Payload</td>\n\t\t\t<td>\n\t\t\t\tConstant, <code>[0xEF, 0x01, 0x77]</code>\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td>Notification</td>\n\t\t\t<td>See the description below</td>\n\t\t</tr>\n\t</tbody>\n</table>\n\n#### Notification description\n\nResulting notification _must_ be 12 bytes long.\n\n1. `result[0]` _must_ be equal to magic constant `0x66`\n1. `result[1]`: ???\n1. `result[2]`: power status:\n\t+ `0x23` is for \"ON\".\n\t+ `0x24` is for \"OFF\".\n1. `result[3]`: mode:\n\t+ `0x25`-`0x38`: [build-in mode](#built-in-modes)\n\t+ `0x41`: static color mode\n1. `result[4]`: ???\n1. `result[5]`: [speed](#speed)\n1. `result[6]`: red color component\n1. `result[7]`: green color component\n1. `result[8]`: blue color component\n1. `result[9]`: white color intensity (when the bulb is in white color mode)\n1. `result[10]`: ???\n1. `result[11]` _must_ be equal to magic constant `0x99`\n\n#### Examples\n\n<details>\n\n<table>\n\t<thead>\n\t\t<tr>\n\t\t\t<th>Magic</th>\n\t\t\t<th>???</th>\n\t\t\t<th>Power</th>\n\t\t\t<th>Mode</th>\n\t\t\t<th>???</th>\n\t\t\t<th>Speed</th>\n\t\t\t<th>R</th>\n\t\t\t<th>G</th>\n\t\t\t<th>B</th>\n\t\t\t<th>W</th>\n\t\t\t<th>???</th>\n\t\t\t<th>Magic</th>\n\t\t\t<th>Description</th>\n\t\t</tr>\n\t</thead>\n\t<tbody>\n\t\t<tr>\n\t\t\t<td title=\"Constant value 0x66\"><code>0x66</code></td>\n\t\t\t<td title=\"Unknown\"><code>0x15</code></td>\n\t\t\t<td title=\"LEDs are ON\"><code>0x23</code></td>\n\t\t\t<td title=\"Static color mode\"><code>0x41</code></td>\n\t\t\t<td title=\"Unknown\"><code>0x20</code></td>\n\t\t\t<td title=\"Speed (does not matter in static color mode)\"><code>0x00</code></td>\n\t\t\t<td title=\"Red color component\"><code>0xFF</code></td>\n\t\t\t<td title=\"Green color component\"><code>0x00</code></td>\n\t\t\t<td title=\"Blue color component\"><code>0x00</code></td>\n\t\t\t<td title=\"White color intensity (does not matter in static color mode)\"><code>0x00</code></td>\n\t\t\t<td title=\"Unknown\"><code>0x06</code></td>\n\t\t\t<td title=\"Constant value 0x99\"><code>0x99</code></td>\n\t\t\t<td>Static red color</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td title=\"Constant value 0x66\"><code>0x66</code></td>\n\t\t\t<td title=\"Unknown\"><code>0x15</code></td>\n\t\t\t<td title=\"LEDs are ON\"><code>0x23</code></td>\n\t\t\t<td title=\"Static color mode\"><code>0x41</code></td>\n\t\t\t<td title=\"Unknown\"><code>0x20</code></td>\n\t\t\t<td title=\"Speed (does not matter in static color mode)\"><code>0x00</code></td>\n\t\t\t<td title=\"Red color component\"><code>0x00</code></td>\n\t\t\t<td title=\"Green color component\"><code>0xFF</code></td>\n\t\t\t<td title=\"Blue color component\"><code>0x00</code></td>\n\t\t\t<td title=\"White color intensity (does not matter in static color mode)\"><code>0x00</code></td>\n\t\t\t<td title=\"Unknown\"><code>0x06</code></td>\n\t\t\t<td title=\"Constant value 0x99\"><code>0x99</code></td>\n\t\t\t<td>Static green color</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td title=\"Constant value 0x66\"><code>0x66</code></td>\n\t\t\t<td title=\"Unknown\"><code>0x15</code></td>\n\t\t\t<td title=\"LEDs are ON\"><code>0x23</code></td>\n\t\t\t<td title=\"Static color mode\"><code>0x41</code></td>\n\t\t\t<td title=\"Unknown\"><code>0x20</code></td>\n\t\t\t<td title=\"Speed (does not matter in static color mode)\"><code>0x00</code></td>\n\t\t\t<td title=\"Red color component\"><code>0x00</code></td>\n\t\t\t<td title=\"Green color component\"><code>0x00</code></td>\n\t\t\t<td title=\"Blue color component\"><code>0xFF</code></td>\n\t\t\t<td title=\"White color intensity (does not matter in static color mode)\"><code>0x00</code></td>\n\t\t\t<td title=\"Unknown\"><code>0x06</code></td>\n\t\t\t<td title=\"Constant value 0x99\"><code>0x99</code></td>\n\t\t\t<td>Static blue color</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td title=\"Constant value 0x66\"><code>0x66</code></td>\n\t\t\t<td title=\"Unknown\"><code>0x15</code></td>\n\t\t\t<td title=\"LEDs are ON\"><code>0x23</code></td>\n\t\t\t<td title=\"White color mode\"><code>0x41</code></td>\n\t\t\t<td title=\"Unknown\"><code>0x20</code></td>\n\t\t\t<td title=\"Speed (does not matter in white color mode)\"><code>0x00</code></td>\n\t\t\t<td title=\"Red color component (does not matter in white color mode)\"><code>0x00</code></td>\n\t\t\t<td title=\"Green color component (does not matter in white color mode)\"><code>0x00</code></td>\n\t\t\t<td title=\"Blue color component (does not matter in white color mode)\"><code>0x00</code></td>\n\t\t\t<td title=\"White color intensity\"><code>0x30</code></td>\n\t\t\t<td title=\"Unknown\"><code>0x06</code></td>\n\t\t\t<td title=\"Constant value 0x99\"><code>0x99</code></td>\n\t\t\t<td>White color with low intensity</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td title=\"Constant value 0x66\"><code>0x66</code></td>\n\t\t\t<td title=\"Unknown\"><code>0x15</code></td>\n\t\t\t<td title=\"LEDs are ON\"><code>0x23</code></td>\n\t\t\t<td title=\"Built-in mode\"><code>0x27</code></td>\n\t\t\t<td title=\"Unknown\"><code>0x20</code></td>\n\t\t\t<td title=\"Slowest possible speed\"><code>0x1F</code></td>\n\t\t\t<td title=\"Red color component (does not matter in built-in mode)\"><code>0xFF</code></td>\n\t\t\t<td title=\"Green color component (does not matter in built-in mode)\"><code>0x00</code></td>\n\t\t\t<td title=\"Blue color component (does not matter in built-in mode)\"><code>0x00</code></td>\n\t\t\t<td title=\"White color intensity (does not matter in built-in mode)\"><code>0x00</code></td>\n\t\t\t<td title=\"Unknown\"><code>0x06</code></td>\n\t\t\t<td title=\"Constant value 0x99\"><code>0x99</code></td>\n\t\t\t<td>Built‑in mode <code>0x27</code> at speed <code>0x1F</code> (the slowest possible)</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td title=\"Constant value 0x66\"><code>0x66</code></td>\n\t\t\t<td title=\"Unknown\"><code>0x15</code></td>\n\t\t\t<td title=\"LEDs are ON\"><code>0x23</code></td>\n\t\t\t<td title=\"Built-in mode\"><code>0x34</code></td>\n\t\t\t<td title=\"Unknown\"><code>0x20</code></td>\n\t\t\t<td title=\"Pretty fast speed\"><code>0x10</code></td>\n\t\t\t<td title=\"Red color component (does not matter in built-in mode)\"><code>0xFF</code></td>\n\t\t\t<td title=\"Green color component (does not matter in built-in mode)\"><code>0x00</code></td>\n\t\t\t<td title=\"Blue color component (does not matter in built-in mode)\"><code>0x00</code></td>\n\t\t\t<td title=\"White color intensity (does not matter in built-in mode)\"><code>0x00</code></td>\n\t\t\t<td title=\"Unknown\"><code>0x06</code></td>\n\t\t\t<td title=\"Constant value 0x99\"><code>0x99</code></td>\n\t\t\t<td>Built‑in mode <code>0x34</code> at speed <code>0x10</code> (fast)</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td title=\"Constant value 0x66\"><code>0x66</code></td>\n\t\t\t<td title=\"Unknown\"><code>0x15</code></td>\n\t\t\t<td title=\"LEDs are OFF\"><code>0x24</code></td>\n\t\t\t<td title=\"Built-in mode\"><code>0x34</code></td>\n\t\t\t<td title=\"Unknown\"><code>0x20</code></td>\n\t\t\t<td title=\"Pretty fast speed\"><code>0x10</code></td>\n\t\t\t<td title=\"Red color component (does not matter in built-in mode)\"><code>0xFF</code></td>\n\t\t\t<td title=\"Green color component (does not matter in built-in mode)\"><code>0x00</code></td>\n\t\t\t<td title=\"Blue color component (does not matter in built-in mode)\"><code>0x00</code></td>\n\t\t\t<td title=\"White color intensity (does not matter in built-in mode)\"><code>0x00</code></td>\n\t\t\t<td title=\"Unknown\"><code>0x06</code></td>\n\t\t\t<td title=\"Constant value 0x99\"><code>0x99</code></td>\n\t\t\t<td>Bulb is turned off with built‑in mode <code>0x34</code> at speed <code>0x10</code> (fast)</td>\n\t\t</tr>\n\t</tbody>\n</table>\n\n</details>\n\n## Power\n\n### Set current power status\n\nPower is turned on and off via write request to `FFD9` characteristic under `FFD5` servce. Check [the code](../../app/commands/power.go) for more details.\n\n#### Requests\n\n<table>\n\t<tbody>\n\t\t<tr>\n\t\t\t<td>Type</td>\n\t\t\t<td>Write</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td>Write to</td>\n\t\t\t<td><code>FFD9</code></td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td>Payload</td>\n\t\t\t<td>See below</td>\n\t\t</tr>\n\t</tbody>\n</table>\n\n#### Payload description\n\nPayload _must_ be 3 bytes long.\n\n1. `payload[0]` _must_ be equal to magic constant `0xCC`\n1. `payload[3]`: `0x23` for \"ON\" and `0x24` for \"OFF\"\n1. `payload[6]` _must_ be equal to magic constant `0x33`\n\n#### Example\n\n<details>\n<table>\n\t<thead>\n\t\t<tr>\n\t\t\t<th>Magic</th>\n\t\t\t<th>Power status</th>\n\t\t\t<th>Magic</th>\n\t\t\t<th>Description</th>\n\t\t</tr>\n\t</thead>\n\t<tbody>\n\t\t<tr>\n\t\t\t<td title=\"Constant value 0xCC\"><code>0xCC</code></td>\n\t\t\t<td title=\"ON\"><code>0x23</code></td>\n\t\t\t<td title=\"Constant value 0x33\"><code>0x33</code></td>\n\t\t\t<td>Turn power on</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td title=\"Constant value 0xCC\"><code>0xCC</code></td>\n\t\t\t<td title=\"OFF\"><code>0x24</code></td>\n\t\t\t<td title=\"Constant value 0x33\"><code>0x33</code></td>\n\t\t\t<td>Turn power off</td>\n\t\t</tr>\n\t</tbody>\n</table>\n</details>\n\n## Static color mode\n\nStatic color mode is set via write request to `FFD9` characteristic under `FFD5` servce. Check [the code](../../app/commands/color.go) for more details.\n\n#### Request\n\n<table>\n\t<tbody>\n\t\t<tr>\n\t\t\t<td>Type</td>\n\t\t\t<td>Write</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td>Write to</td>\n\t\t\t<td><code>FFD9</code></td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td>Payload</td>\n\t\t\t<td>See below</td>\n\t\t</tr>\n\t</tbody>\n</table>\n\n#### Payload description\n\nPayload _must_ be 7 bytes long.\n\n1. `payload[0]` _must_ be equal to magic constant `0x56`\n1. `payload[1]`: red color component\n1. `payload[2]`: green color component\n1. `payload[3]`: blue color component\n1. `payload[4]` _must_ be equal to magic constant `0x00`\n1. `payload[5]` _must_ be equal to magic constant `0xF0`\n1. `payload[6]` _must_ be equal to magic constant `0xAA`\n\n#### Examples\n\n<details>\n<table>\n\t<thead>\n\t\t<tr>\n\t\t\t<th>Magic</th>\n\t\t\t<th>R</th>\n\t\t\t<th>G</th>\n\t\t\t<th>B</th>\n\t\t\t<th>Magic</th>\n\t\t\t<th>Magic</th>\n\t\t\t<th>Magic</th>\n\t\t\t<th>Description</th>\n\t\t</tr>\n\t</thead>\n\t<tbody>\n\t\t<tr>\n\t\t\t<td title=\"Constant value 0x56\"><code>0x56</code></td>\n\t\t\t<td title=\"Red color component\"><code>0xFF</code></td>\n\t\t\t<td title=\"Green color component\"><code>0x00</code></td>\n\t\t\t<td title=\"Blue color component\"><code>0x00</code></td>\n\t\t\t<td title=\"Constant value 0x00\"><code>0x00</code></td>\n\t\t\t<td title=\"Constant value 0xF0\"><code>0xF0</code></td>\n\t\t\t<td title=\"Constant value 0xAA\"><code>0xAA</code></td>\n\t\t\t<td>Static red color</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td title=\"Constant value 0x56\"><code>0x56</code></td>\n\t\t\t<td title=\"Red color component\"><code>0x00</code></td>\n\t\t\t<td title=\"Green color component\"><code>0xFF</code></td>\n\t\t\t<td title=\"Blue color component\"><code>0x00</code></td>\n\t\t\t<td title=\"Constant value 0x00\"><code>0x00</code></td>\n\t\t\t<td title=\"Constant value 0xF0\"><code>0xF0</code></td>\n\t\t\t<td title=\"Constant value 0xAA\"><code>0xAA</code></td>\n\t\t\t<td>Static green color</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td title=\"Constant value 0x56\"><code>0x56</code></td>\n\t\t\t<td title=\"Red color component\"><code>0x00</code></td>\n\t\t\t<td title=\"Green color component\"><code>0x00</code></td>\n\t\t\t<td title=\"Blue color component\"><code>0xFF</code></td>\n\t\t\t<td title=\"Constant value 0x00\"><code>0x00</code></td>\n\t\t\t<td title=\"Constant value 0xF0\"><code>0xF0</code></td>\n\t\t\t<td title=\"Constant value 0xAA\"><code>0xAA</code></td>\n\t\t\t<td>Static blue color</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td title=\"Constant value 0x56\"><code>0x56</code></td>\n\t\t\t<td title=\"Red color component\"><code>0x5A</code></td>\n\t\t\t<td title=\"Green color component\"><code>0x00</code></td>\n\t\t\t<td title=\"Blue color component\"><code>0x9D</code></td>\n\t\t\t<td title=\"Constant value 0x00\"><code>0x00</code></td>\n\t\t\t<td title=\"Constant value 0xF0\"><code>0xF0</code></td>\n\t\t\t<td title=\"Constant value 0xAA\"><code>0xAA</code></td>\n\t\t\t<td>Static violet color</td>\n\t\t</tr>\n\t</tbody>\n</table>\n</details>\n\n## White color\n\nWhite color is set via write request to `FFD9` characteristic under `FFD5` servce. Check [the code](../../app/commands/color.go) for more details.\n\n#### Request\n\n<table>\n\t<tbody>\n\t\t<tr>\n\t\t\t<td>Type</td>\n\t\t\t<td>Write</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td>Write to</td>\n\t\t\t<td><code>FFD9</code></td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td>Payload</td>\n\t\t\t<td>See below</td>\n\t\t</tr>\n\t</tbody>\n</table>\n\n#### Payload description\n\nPayload _must_ be 7 bytes long.\n\n1. `payload[0]` _must_ be equal to magic constant `0x56`\n1. `payload[1]`: not used\n1. `payload[2]`: not used\n1. `payload[3]`: not used\n1. `payload[4]`: intensity\n1. `payload[5]` _must_ be equal to magic constant `0x0F`\n1. `payload[6]` _must_ be equal to magic constant `0xAA`\n\n#### Examples\n\n<details>\n<table>\n\t<thead>\n\t\t<tr>\n\t\t\t<th>Magic</th>\n\t\t\t<th>N/A</th>\n\t\t\t<th>N/A</th>\n\t\t\t<th>N/A</th>\n\t\t\t<th>Intensity</th>\n\t\t\t<th>Magic</th>\n\t\t\t<th>Magic</th>\n\t\t\t<th>Description</th>\n\t\t</tr>\n\t</thead>\n\t<tbody>\n\t\t<tr>\n\t\t\t<td title=\"Constant value 0x56\"><code>0x56</code></td>\n\t\t\t<td title=\"N/A\"><code>0xDE</code></td>\n\t\t\t<td title=\"N/A\"><code>0xAD</code></td>\n\t\t\t<td title=\"N/A\"><code>0xFF</code></td>\n\t\t\t<td title=\"Intensity\"><code>0x01</code></td>\n\t\t\t<td title=\"Constant value 0x0F\"><code>0x0F</code></td>\n\t\t\t<td title=\"Constant value 0xAA\"><code>0xAA</code></td>\n\t\t\t<td>Lowest possible intensity</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td title=\"Constant value 0x56\"><code>0x56</code></td>\n\t\t\t<td title=\"N/A\"><code>0xCA</code></td>\n\t\t\t<td title=\"N/A\"><code>0xFE</code></td>\n\t\t\t<td title=\"N/A\"><code>0x00</code></td>\n\t\t\t<td title=\"Intensity\"><code>0xFF</code></td>\n\t\t\t<td title=\"Constant value 0x0F\"><code>0x0F</code></td>\n\t\t\t<td title=\"Constant value 0xAA\"><code>0xAA</code></td>\n\t\t\t<td>Highest possible intensity</td>\n\t\t</tr>\n\t</tbody>\n</table>\n</details>\n\n## Built-in mode\n\nBuilt-in mode is set via write request to `FFD9` characteristic. Check [the code](../../app/commands/mode.go) for more details.\n\n#### Request\n\n<table>\n\t<tbody>\n\t\t<tr>\n\t\t\t<td>Type</td>\n\t\t\t<td>Write</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td>Write to</td>\n\t\t\t<td><code>FFD9</code></td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td>Payload</td>\n\t\t\t<td>See below</td>\n\t\t</tr>\n\t</tbody>\n</table>\n\n#### Payload description\n\nPayload _must_ be 4 bytes long.\n\n1. `payload[0]` _must_ be equal to magic constant `0xBB`\n1. `payload[1]`: [build-in mode](#built-in-modes)\n1. `payload[2]`: [speed](#speed)\n1. `payload[3]` _must_ be equal to magic constant `0x44`\n\n#### Examples\n\n<details>\n<table>\n\t<thead>\n\t\t<tr>\n\t\t\t<th>Magic</th>\n\t\t\t<th>Mode</th>\n\t\t\t<th>Speed</th>\n\t\t\t<th>Magic</th>\n\t\t\t<th>Description</th>\n\t\t</tr>\n\t</thead>\n\t<tbody>\n\t\t<tr>\n\t\t\t<td title=\"Constant value 0xBB\"><code>0xBB</code></td>\n\t\t\t<td title=\"Green gradual change\"><code>0x27</code></td>\n\t\t\t<td title=\"The slowest possible\"><code>0x1F</code></td>\n\t\t\t<td title=\"Constant value 0x44\"><code>0x44</code></td>\n\t\t\t<td>Built‑in mode <code>0x27</code> at speed <code>0x1F</code> (the slowest possible)</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td title=\"Constant value 0xBB\"><code>0xBB</code></td>\n\t\t\t<td title=\"Yellow strobe flash\"><code>0x34</code></td>\n\t\t\t<td title=\"Fast\"><code>0x10</code></td>\n\t\t\t<td title=\"Constant value 0x44\"><code>0x44</code></td>\n\t\t\t<td>Built‑in mode <code>0x34</code> at speed <code>0x10</code> (fast)</td>\n\t\t</tr>\n\t</tbody>\n</table>\n</details>\n\n## Clock\n\n### Query for current clock value\n\nUnfortunately, I do not know the way to query for current bulb's clock value.\n\n### Set clock value\n\nCurrent clock can be set by writing `FFD9` characteristic. Check [the code](../../app/commands/time.go) for more details.\n\n#### Request\n\n<table>\n\t<tbody>\n\t\t<tr>\n\t\t\t<td>Type</td>\n\t\t\t<td>Write</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td>Write to</td>\n\t\t\t<td><code>FFD9</code></td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td>Payload</td>\n\t\t\t<td>See below</td>\n\t\t</tr>\n\t</tbody>\n</table>\n\n#### Payload description\n\nPayload _must_ be 11 bytes long.\n\n1. `payload[0]` _must_ be equal to magic constant `0x10`\n1. `payload[1]` year divided by 100\n1. `payload[2]` remainder of dividing year by 100\n1. `payload[3]` month (1 is Jan., 2 is Feb., etc)\n1. `payload[4]` day of month, starting from 1\n1. `payload[5]` hours (24 hours format)\n1. `payload[6]` minutes\n1. `payload[7]` seconds\n1. `payload[8]` day of week (SUN is 0)\n1. `payload[9]` _must_ be equal to magic constant `0x00`\n1. `payload[10]` _must_ be equal to magic constant `0x01`\n\n#### Example\n\n<details>\n<table>\n\t<thead>\n\t\t<tr>\n\t\t\t<th>Magic</th>\n\t\t\t<th>Upper year</th>\n\t\t\t<th>Lower year</th>\n\t\t\t<th>Month</th>\n\t\t\t<th>Date</th>\n\t\t\t<th>Hours</th>\n\t\t\t<th>Minutes</th>\n\t\t\t<th>Seconds</th>\n\t\t\t<th>Day of week</th>\n\t\t\t<th>Magic</th>\n\t\t\t<th>Magic</th>\n\t\t\t<th>Description</th>\n\t\t</tr>\n\t</thead>\n\t<tbody>\n\t\t<tr>\n\t\t\t<td title=\"Constant value 0x10\"><code>0x10</code></td>\n\t\t\t<td title=\"Upper byte of year (2016 / 100 == 20)\"><code>0x14</code></td>\n\t\t\t<td title=\"Lower byte of year (2016 % 100 == 16)\"><code>0x10</code></td>\n\t\t\t<td title=\"Month (February)\"><code>0x02</code></td>\n\t\t\t<td title=\"Date (28)\"><code>0x1C</code></td>\n\t\t\t<td title=\"Hours (05)\"><code>0x05</code></td>\n\t\t\t<td title=\"Minutes (07)\"><code>0x07</code></td>\n\t\t\t<td title=\"Seconds (24)\"><code>0x18</code></td>\n\t\t\t<td title=\"Day of week (Sunday, 7)\"><code>0x07</code></td>\n\t\t\t<td title=\"Constant value 0x00\"><code>0x00</code></td>\n\t\t\t<td title=\"Constant value 0x01\"><code>0x01</code></td>\n\t\t\t<td>Sun Feb 28 05:07:24 2016</td>\n\t\t</tr>\n\t</tbody>\n</table>\n</details>\n\n## Timings\n\nTODO\n\n# Magic constants\n\n## Built-in modes\n\n1. `0x25`: Seven color cross fade\n1. `0x26`: Red gradual change\n1. `0x27`: Green gradual change\n1. `0x28`: Blue gradual change\n1. `0x29`: Yellow gradual change\n1. `0x2A`: Cyan gradual change\n1. `0x2B`: Purple gradual change\n1. `0x2C`: White gradual change\n1. `0x2D`: Red, Green cross fade\n1. `0x2E`: Red blue cross fade\n1. `0x2F`: Green blue cross fade\n1. `0x30`: Seven color stobe flash\n1. `0x31`: Red strobe flash\n1. `0x32`: Green strobe flash\n1. `0x33`: Blue strobe flash\n1. `0x34`: Yellow strobe flash\n1. `0x35`: Cyan strobe flash\n1. `0x36`: Purple strobe flash\n1. `0x37`: White strobe flash\n1. `0x38`: Seven color jumping change\n\n## Speed\n\nSome operational modes take a speed parameter that controls how fast the colors are changed. `0x01` is the fastest, `0xFF` is the slowest.\n","x":680,"y":80,"wires":[]},{"id":"3fb9946d.b0f5cc","type":"inject","z":"f3a9e590.48942","name":"Status","topic":"","payload":"{\"uuid\":\"ffff00008119\",\"ffd9\":\"ef0177\"}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":230,"y":100,"wires":[["41b9a44.781a5dc"]]},{"id":"ee8b587e.4306f8","type":"inject","z":"f3a9e590.48942","name":"Red","topic":"","payload":"{\"uuid\":\"ffff00008119\",\"ffd9\":\"56FF000000F0AA\"}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":210,"y":300,"wires":[["bddefcce.60afe"]]},{"id":"7c633aa3.721124","type":"inject","z":"f3a9e590.48942","name":"Green","topic":"","payload":"{\"uuid\":\"ffff00008119\",\"ffd9\":\"5600FF0000F0AA\"}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":210,"y":340,"wires":[["bddefcce.60afe"]]},{"id":"48d8b923.4ee8","type":"inject","z":"f3a9e590.48942","name":"Blue","topic":"","payload":"{\"uuid\":\"ffff00008119\",\"ffd9\":\"560000FF00F0AA\"}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":210,"y":380,"wires":[["bddefcce.60afe"]]},{"id":"fda64c88.54bd88","type":"function","z":"f3a9e590.48942","name":"Color to payload","func":"msg.payload={\n \"uuid\": \"ffff00008119\",\n \"ffd9\": \"56\" + msg.payload + \"00F0AA\"\n};\nreturn msg;","outputs":1,"noerr":0,"x":400,"y":480,"wires":[["26f31a0c.98baee","bddefcce.60afe"]]},{"id":"26f31a0c.98baee","type":"debug","z":"f3a9e590.48942","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":630,"y":480,"wires":[]},{"id":"6e0a2324.3f4d54","type":"ui_colour_picker","z":"f3a9e590.48942","name":"","label":"","group":"d5432831.b3f828","format":"hex","outformat":"object","showSwatch":true,"showPicker":true,"showValue":true,"showHue":true,"showAlpha":false,"showLightness":true,"square":"false","dynOutput":"false","order":1,"width":0,"height":0,"passthru":true,"topic":"","x":210,"y":480,"wires":[["fda64c88.54bd88"]]},{"id":"41d9c062.8c9958","type":"ui_dropdown","z":"f3a9e590.48942","name":"","label":"Built-in modes","tooltip":"Automatic color change by internal software","place":"Select option","group":"d5432831.b3f828","order":2,"width":0,"height":0,"passthru":true,"options":[{"label":"Seven color cross fade","value":"25","type":"str"},{"label":"Red gradual change","value":"26","type":"str"},{"label":"Green gradual change","value":"27","type":"str"},{"label":"Blue gradual change","value":"28","type":"str"},{"label":"Yellow gradual change","value":"29","type":"str"},{"label":"Cyan gradual change","value":"2A","type":"str"},{"label":"Purple gradual change","value":"2b","type":"str"},{"label":"White gradual change","value":"2c","type":"str"},{"label":"Red, Green cross fade","value":"2d","type":"str"},{"label":"Red blue cross fade","value":"2e","type":"str"},{"label":"Green blue cross fade","value":"2f","type":"str"},{"label":"Seven color stobe flash","value":"30","type":"str"},{"label":"Red strobe flash","value":"31","type":"str"},{"label":"Green strobe flash","value":"32","type":"str"},{"label":"Blue strobe flash","value":"33","type":"str"},{"label":"Yellow strobe flash","value":"34","type":"str"},{"label":"Cyan strobe flash","value":"35","type":"str"},{"label":"Purple strobe flash","value":"36","type":"str"},{"label":"White strobe flash","value":"37","type":"str"},{"label":"Seven color jumping change","value":"38","type":"str"}],"payload":"","topic":"","x":200,"y":540,"wires":[["2431b1d.22f244e"]]},{"id":"409fa30c.e214ec","type":"function","z":"f3a9e590.48942","name":"Combine mode and speed","func":"msg.payload={\n \"uuid\": \"ffff00008119\",\n \"ffd9\": \"BB\" + flow.get('builtin') + flow.get('speed') +\"44\"\n};\nreturn msg;","outputs":1,"noerr":0,"x":660,"y":560,"wires":[["81f5ea3a.4795d","bddefcce.60afe"]]},{"id":"c9f8ddb6.673f5","type":"ui_slider","z":"f3a9e590.48942","name":"","label":"Change Speed","tooltip":"Speed parameter controls how fast the colors are changed.","group":"d5432831.b3f828","order":3,"width":0,"height":0,"passthru":true,"outs":"all","topic":"","min":"1","max":"255","step":1,"x":200,"y":600,"wires":[["13c98735.a64039"]]},{"id":"2431b1d.22f244e","type":"function","z":"f3a9e590.48942","name":"Set mode to flow var","func":"flow.set('builtin',msg.payload);\nreturn msg;","outputs":1,"noerr":0,"x":420,"y":540,"wires":[["409fa30c.e214ec"]]},{"id":"13c98735.a64039","type":"function","z":"f3a9e590.48942","name":"Set speed to flow var","func":"var hex = msg.payload.toString(16);\nif (msg.payload<15) {\n hex=\"0\"+hex;\n}\nflow.set('speed',hex);\nreturn msg;","outputs":1,"noerr":0,"x":420,"y":600,"wires":[["409fa30c.e214ec"]]},{"id":"81f5ea3a.4795d","type":"debug","z":"f3a9e590.48942","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":810,"y":620,"wires":[]},{"id":"d301f56a.d3f72","type":"comment","z":"f3a9e590.48942","name":"Setup","info":"Check config of ble node, select Triones from scan result and deploy.","x":690,"y":240,"wires":[]}]