I’ve been out of the loop for a bit. Haven’t gotten around to checking my code for problems. That’s this evening
So a quick guide to how the curl commands work, and can be put together, here’s a working one using your IP address.
curl -s http://192.168.1.58:5000/mote/api/v1.0/larsonloop/1234/1/ee7600/0.1/1/1
and I’ve a bunch for you at the end.
This part curl -s http://192.168.1.58:5000/mote/api/v1.0/
always stays the same, you decide what comes after.
larsonloop/1234/1/ee7600/0.1/1/1
which describes:
effect type / channels / dir / colour / pause time / persist / loop
A “larsonloop” is the standard light-by-light change, you can also choose from:
-
larsonloop, larsonloop_rgb
-
larsonswipe, larsonswipe_rgb
-
cylon (essentially a larsonloop twice), cylon_rgb
-
bouncewash, bouncewash_rgb (another larsonloop sequence)
-
rainbow
-
tiedye
Next up are the channel selections - the “1234” part.
If you had only two mote sticks on port 1 & 2, you’d type “1200”. If you have 3 mote sticks on ports 1,2 & 4 - you’d type “1204”.
You can also use this to pick one stick, apply an effect then pick another stick apply a different effect:
So
curl -s http://192.168.1.58:5000/mote/api/v1.0/larsonloop/1000/1/ee7600/0.1/1/1
Make only channel one, an “ee7600” colour (ambery yellow)
curl -s http://192.168.1.58:5000/mote/api/v1.0/larsonloop/0200/1/ff0000/0.1/1/1
Make only channel two, an “ff0000” colour (max red)
You can check the codes here: http://www.december.com/html/spec/colorhex.html
curl -s http://192.168.1.58:5000/mote/api/v1.0/larsonloop/0034/1/ff00ff/0.1/1/1
Make channels three & four purple.
You don’t have to use Hex colour codes, if you find RGB easier the just call larsonloop_rgb instead, and here’s a list for them:
http://www.rapidtables.com/web/color/RGB_Color.htm#rgb-format
Right after the channels is the light direction setting:
0 = Travels from the USB port to the End.
1 = Travels from the End to the USB port.
Next is the colour selection, which we’ve looked at above.
After that is the pause time, in seconds:
So for one tenth of a second, put in 0.1 - for two seconds 2.0
Next is persist,:
0 = Light does not remain, clears as it goes.
1 = Light remains lit.
This value may not always matter, e.g. the Cylon and Bouncewash animations will ignore this value as they have their own pattern.
Last is loop (how many repeats you want):
0 = Nothing will happen
1 = Effect happens once
2 = Total of two loops, and so on …
Anyway, assuming your IP address hasn’t changed here’s a bunch:
curl -s http://192.168.1.58:5000/mote/api/v1.0/rainbow/1200
Make channels 1 and 2 cycle through rainbow colours.
curl -s http://192.168.1.58:5000/mote/api/v1.0/tiedye/0034
Make channels 3 and 4 cycle through tiedye colours.
Next one is different, a larsonswipe. This time the channel selection is instead a channel sequence:
curl -s http://192.168.1.58:5000/mote/api/v1.0/larsonswipe_rgb/1432/0/255/80/0/0.5/0/2
So it’s stick #1, in a yellow red, then #4, #3 and finally #2 - travelling to the USB port with a pause of 0.5 seconds, no persistence, performed a total of two times.
All channels orangey-red:
curl -s http://192.168.1.58:5000/mote/api/v1.0/larsonloop_rgb/1234/1/255/60/0/0.1/1/1
All channels orangey-red, with a little travelling motion before all leds go a solid colour:
curl -s http://192.168.1.58:5000/mote/api/v1.0/bouncewash_rgb/1234/1/255/60/0/0.1/1/1
Of course if you have a sequence of these you like to run, you can put them in a script and call the script as part of a Hass Switch.
(Ahh, have to pop out again - I’ll finish this up as soon as I’m back with scripts & switches for you)