-
Notifications
You must be signed in to change notification settings - Fork 12
Remote Control API for client application
BlinkStick Client remote control API provides ability to control connected BlinkStick devices. API allows to set colors or issue requests to play patterns with simple HTTP requests. You can use your browser to control the requests or a curl command line utility.
The support of remote control API has been implemented since 2.0-RC6 release.
Add Remote Control notification from Services category in the Client Application. Please ensure that firewall is not blocking the service.
Provides an ability to test the API status.
http://127.0.0.1:9000/api/v1/test
Parameters
None.
Response JSON
{"name":"BlinkStick Client","version":"2.0-RC6","versionFull":"2.0.5899.24666"}
http://127.0.0.1:9000/api/v1/set_color/[BlinkStick-Serial-Number]
Parameters
- (!) [BlinkStick-Serial-Number] - The serial number of BlinkStick device you want to control
- color - color of the LEDs. Can be a named color (for example red, gree, blue) or color hex code ff0000, 123456. Defaults to black.
- firstLed - index of first LED to control. Available values are [0..63]. Defaults to 0.
- lastLed - index of last LED to control. Available values are [0..63]. Defaults to 0.
- channel - channel to control. Applies only to BlinkStick Pro. Available values are [0..2]. Defaults to 0.
Parameters marked with (!) are required.
Examples
Set blue first LED:
curl "http://127.0.0.1:9000/api/v1/set_color/BS123456-7.8?color=0000ff"
Set red color to LEDs from index 4 to 7:
curl "http://127.0.0.1:9000/api/v1/set_color/BS123456-7.8?color=0000ff&firstLed=4&lastLed=7"
Set all LEDs green from 0 to 63 on channel 1:
curl "http://127.0.0.1:9000/api/v1/set_color/BS123456-7.8?color=0000ff&firstLed=0&lastLed=63&channel=1"
http://127.0.0.1:9000/api/v1/play_pattern/[BlinkStick-Serial-Number]
Parameters
- (!) [BlinkStick-Serial-Number] - The serial number of BlinkStick device you want to control
- (!) pattern - the name of the pattern to start playing. Must exist within the list of patterns in the client application.
- firstLed - index of first LED to control. Available values are [0..63]. Defaults to 0.
- lastLed - index of last LED to control. Available values are [0..63]. Defaults to 0.
- channel - channel to control. Applies only to BlinkStick Pro. Available values are [0..2]. Defaults to 0.
Parameters marked with (!) are required.
Examples
Play pattern "police" on the first LED:
curl "http://127.0.0.1:9000/api/v1/play_pattern/BS123456-7.8?pattern=police"
Play pattern "police" on LEDs with index 4 to 7:
curl "http://127.0.0.1:9000/api/v1/play_pattern/BS123456-7.8?color=0000ff&firstLed=4&lastLed=7"