2014-07-04 15:51:55 +02:00
node-red-node-blinkstick
========================
2014-10-01 11:02:44 +02:00
A < a href = "http://nodered.org" target = "_new" > Node-RED< / a > node to control a < a href = "http://www.blinkstick.com/" target = "_new" > BlinkStick< / a > .
2014-07-04 15:51:55 +02:00
2016-02-22 19:56:42 +01:00
Pre-requisites
--------------
Depending on your operating system you may need to install some extra libraries before installing this node... I.E make sure it works outside of Node-RED first !
For more information see < i > < a href = "http://www.blinkstick.com/help/tutorials" target = "_new" > BlinkStick tutorials< / a > < / i > or the < i > < a href = "https://github.com/arvydas/blinkstick-node" target = "_new" > node module< / a > < / i > documentation.
#### Raspberry Pi / Debian / Ubuntu
sudo apt-get install -y libudev-dev
2016-02-22 23:23:05 +01:00
You also currently need to create a file `/etc/udev/rules.d/80-blinkstick.rules` containing
2016-08-06 19:42:10 +02:00
SUBSYSTEM=="usb", ATTRS{idVendor}=="20a0", ATTRS{idProduct}=="41e5", TAG+="uaccess"
2016-02-22 23:23:05 +01:00
and either reload the udev rules or reboot.
2016-02-22 19:56:42 +01:00
2014-07-04 15:51:55 +02:00
Install
-------
2016-03-02 14:25:52 +01:00
Run the following command in your Node-RED user directory - typically `~/.node-red`
2014-07-04 15:51:55 +02:00
2016-03-02 14:25:52 +01:00
npm i node-red-node-blinkstick
2014-07-04 15:51:55 +02:00
Usage
-----
2016-03-02 14:25:52 +01:00
< i > < a href = "http://www.blinkstick.com" target = "_new" > BlinkStick< / a > < / i > output node.
Expects a `msg.payload` with one of:
2014-07-04 15:51:55 +02:00
2014-10-01 11:02:44 +02:00
* A hex string < b > "#rrggbb"</ b > triple
* < b > "red,green,blue"</ b > three 0-255 values as a string
* < b > "random"</ b > will generate a random color
* < i >< a href = "http://www.w3schools.com/html/html_colornames.asp" target = "_new" > Standard HTML color</ a ></ i > name
* < b > object</ b > can override any of the parameters
2014-07-04 15:51:55 +02:00
2014-10-01 11:02:44 +02:00
An object payload can override any of the settings on the node. Omitted parameters are left intact. For example:
2014-07-04 15:51:55 +02:00
2014-10-01 11:02:44 +02:00
{ 'color': 'blue' }
{ 'task': 'blink', 'color': 'red' }
2016-03-02 14:25:52 +01:00
{ 'task': 'pulse', 'color': 'green', 'duration': 500 }
2014-10-01 11:02:44 +02:00
{ 'task': 'morph', 'color': 'orange', 'duration': 500, 'steps': 20 }