Skip to content

Instantly share code, notes, and snippets.

@kylec32
Last active April 15, 2021 00:28
Show Gist options
  • Save kylec32/30af0c02c0d542f3d204e99d24cf181d to your computer and use it in GitHub Desktop.
Save kylec32/30af0c02c0d542f3d204e99d24cf181d to your computer and use it in GitHub Desktop.
[
{
"id": "c2ecfc5b.739ae",
"type": "tab",
"label": "Flow 1",
"disabled": false,
"info": ""
},
{
"id": "b8e5318a.0a834",
"type": "api-call-service",
"z": "c2ecfc5b.739ae",
"name": "Set Effect",
"server": "7c76f9cf.1331b8",
"version": 1,
"debugenabled": false,
"service_domain": "wled",
"service": "effect",
"entityId": "light.wled",
"data": "{\"effect\":msg.payload}",
"dataType": "jsonata",
"mergecontext": "",
"output_location": "",
"output_location_type": "none",
"mustacheAltTags": false,
"x": 660,
"y": 340,
"wires": [
[]
]
},
{
"id": "28de7781.376738",
"type": "function",
"z": "c2ecfc5b.739ae",
"name": "Pick Effect",
"func": "var options = [\n {\"effect\":\"Solid\", \"id\":0},\n{\"effect\":\"Blink\", \"id\":1},\n{\"effect\":\"Breathe\", \"id\":2},\n{\"effect\":\"Wipe\", \"id\":3},\n{\"effect\":\"Wipe Random\", \"id\":4},\n{\"effect\":\"Random Colors\", \"id\":5},\n{\"effect\":\"Sweep\", \"id\":6},\n{\"effect\":\"Dynamic\", \"id\":7},\n{\"effect\":\"Colorloop\", \"id\":8},\n{\"effect\":\"Rainbow\", \"id\":9},\n{\"effect\":\"Scan\", \"id\":10},\n{\"effect\":\"Scan Dual\", \"id\":11},\n{\"effect\":\"Fade\", \"id\":12},\n{\"effect\":\"Theater\", \"id\":13},\n{\"effect\":\"Theater Rainbow\", \"id\":14},\n{\"effect\":\"Running\", \"id\":15, \"speed\":70},\n{\"effect\":\"Saw\", \"id\":16},\n{\"effect\":\"Twinkle\", \"id\":17},\n{\"effect\":\"Dissolve\", \"id\":18},\n{\"effect\":\"Dissolve Rnd\", \"id\":19},\n{\"effect\":\"Sparkle\", \"id\":20},\n{\"effect\":\"Sparkle Dark\", \"id\":21},\n{\"effect\":\"Sparkle+\", \"id\":22},\n//{\"effect\":\"Strobe\", \"id\":23},\n//{\"effect\":\"Strobe Rainbow\", \"id\":24},\n//{\"effect\":\"Strobe Mega\", \"id\":25},\n{\"effect\":\"Blink Rainbow\", \"id\":26},\n{\"effect\":\"Android\", \"id\":27},\n{\"effect\":\"Chase\", \"id\":28},\n{\"effect\":\"Chase Random\", \"id\":29},\n{\"effect\":\"Chase Rainbow\", \"id\":30},\n{\"effect\":\"Chase Flash\", \"id\":31},\n{\"effect\":\"Chase Flash Rnd\", \"id\":32},\n{\"effect\":\"Rainbow Runner\", \"id\":33},\n{\"effect\":\"Colorful\", \"id\":34},\n{\"effect\":\"Traffic Light\", \"id\":35},\n{\"effect\":\"Sweep Random\", \"id\":36},\n{\"effect\":\"Running 2\", \"id\":37},\n{\"effect\":\"Red & Blue\", \"id\":38},\n{\"effect\":\"Stream\", \"id\":39},\n{\"effect\":\"Scanner\", \"id\":40},\n{\"effect\":\"Lighthouse\", \"id\":41},\n{\"effect\":\"Fireworks\", \"id\":42},\n{\"effect\":\"Rain\", \"id\":43},\n{\"effect\":\"Merry Christmas\", \"id\":44},\n{\"effect\":\"Fire Flicker\", \"id\":45},\n{\"effect\":\"Gradient\", \"id\":46},\n{\"effect\":\"Loading\", \"id\":47},\n{\"effect\":\"Police\", \"id\":48},\n{\"effect\":\"Police All\", \"id\":49},\n{\"effect\":\"Two Dots\", \"id\":50},\n{\"effect\":\"Two Areas\", \"id\":51},\n{\"effect\":\"Circus\", \"id\":52},\n{\"effect\":\"Halloween\", \"id\":53},\n{\"effect\":\"Tri Chase\", \"id\":54},\n{\"effect\":\"Tri Wipe\", \"id\":55},\n{\"effect\":\"Tri Fade\", \"id\":56},\n{\"effect\":\"Lightning\", \"id\":57},\n{\"effect\":\"ICU\", \"id\":58},\n{\"effect\":\"Multi Comet\", \"id\":59},\n{\"effect\":\"Scanner Dual\", \"id\":60},\n{\"effect\":\"Stream 2\", \"id\":61},\n{\"effect\":\"Oscillate\", \"id\":62},\n{\"effect\":\"Pride 2015\", \"id\":63},\n{\"effect\":\"Juggle\", \"id\":64},\n{\"effect\":\"Palette\", \"id\":65},\n{\"effect\":\"Fire 2012\", \"id\":66},\n{\"effect\":\"Colorwaves\", \"id\":67},\n{\"effect\":\"Bpm\", \"id\":68},\n{\"effect\":\"Fill Noise\", \"id\":69},\n{\"effect\":\"Noise 1\", \"id\":70},\n{\"effect\":\"Noise 2\", \"id\":71},\n{\"effect\":\"Noise 3\", \"id\":72},\n{\"effect\":\"Noise 4\", \"id\":73},\n{\"effect\":\"Colortwinkles\", \"id\":74},\n{\"effect\":\"Lake\", \"id\":75},\n{\"effect\":\"Meteor\", \"id\":76},\n{\"effect\":\"Meteor Smooth\", \"id\":77},\n{\"effect\":\"Railway\", \"id\":78},\n{\"effect\":\"Ripple\", \"id\":79},\n{\"effect\":\"Twinklefox\", \"id\":80},\n{\"effect\":\"Twinklecat\", \"id\":81},\n{\"effect\":\"Halloween Eyes\", \"id\":82},\n{\"effect\":\"Solid Pattern\", \"id\":83},\n{\"effect\":\"Solid Pattern Tri\", \"id\":84},\n{\"effect\":\"Spots\", \"id\":85},\n{\"effect\":\"Spots Fade\", \"id\":86},\n{\"effect\":\"Glitter\", \"id\":87},\n{\"effect\":\"Candle\", \"id\":88},\n{\"effect\":\"Fireworks Starburst\", \"id\":89},\n{\"effect\":\"Fireworks 1D\", \"id\":90},\n{\"effect\":\"Bouncing Balls\", \"id\":91},\n//{\"effect\":\"Sinelon\", \"id\":92},\n//{\"effect\":\"Sinelon Dual\", \"id\":93},\n{\"effect\":\"Sinelon Rainbow\", \"id\":94},\n{\"effect\":\"Popcorn\", \"id\":95},\n{\"effect\":\"Drip\", \"id\":96},\n{\"effect\":\"Plasma\", \"id\":97},\n{\"effect\":\"Percent\", \"id\":98},\n{\"effect\":\"Ripple Rainbow\", \"id\":99},\n{\"effect\":\"Heartbeat\", \"id\":100},\n{\"effect\":\"Pacifica\", \"id\":101},\n{\"effect\":\"Candle Multi\", \"id\":102},\n{\"effect\":\"Solid Glitter\", \"id\":103},\n{\"effect\":\"Sunrise\", \"id\":104},\n{\"effect\":\"Phased\", \"id\":105},\n{\"effect\":\"Twinkleup\", \"id\":106},\n{\"effect\":\"Noise Pal\", \"id\":107},\n{\"effect\":\"Sine\", \"id\":108},\n{\"effect\":\"Phased Noise\", \"id\":109},\n{\"effect\":\"Flow\", \"id\":110},\n{\"effect\":\"Chunchun\", \"id\":111},\n{\"effect\":\"Dancing Shadows\", \"id\":112},\n{\"effect\":\"Washing Machine\", \"id\":113},\n{\"effect\":\"Candy Cane\", \"id\":114},\n{\"effect\":\"Blends\", \"id\":115},\n{\"effect\":\"TV Simulator\", \"id\":116},\n{\"effect\":\"Dynamic Smooth\", \"id\":117}\n]\n// \"Strobe Rainbow\", \"Strobe\", \"Strobe Mega\", \"Halloween\", \"Halloween Eyes\",\n\nvar option = options[Math.floor(Math.random() * options.length)];\nreturn {\"payload\": option.id};",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"x": 490,
"y": 340,
"wires": [
[
"b8e5318a.0a834"
]
]
},
{
"id": "7c76f9cf.1331b8",
"type": "server",
"name": "Home Assistant",
"legacy": false,
"addon": false,
"rejectUnauthorizedCerts": true,
"ha_boolean": "y|yes|true|on|home|open",
"connectionDelay": true,
"cacheJson": true
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment