So i want my lights to cycle colors. But my strips doesn’t support random or colorloop so I copied and pasted this flow and got it work. But obviously I cant stop it. When i turn of the light it just gets on and keeps on going. I have no idea how to stop this. I have a vaguer idea that i need to use an input_boolean
but i cant get my head around how to do it.
Is it possible to turn this of when i turn off the rgb light identity ?
Thanks in advance
[{"id":"04f201e54e9fc6fd","type":"template","z":"8fac6b2580decde7","name":"admin","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{ \"data\": {\"entity_id\" : \"light.rgb_light\", \"rgb_color\" : {{payload.data.rgb_color}} }}","output":"json","x":690,"y":240,"wires":[["677e52db21cee4f6","1d48a0b698560759"]],"icon":"node-red-contrib-color-convert/color-convert.png"},{"id":"4e38b829efe500d6","type":"function","z":"8fac6b2580decde7","name":"change rgb","func":"var i = flow.get(\"i\");\nvar red = Math.round(Math.sin(0.3*i + 0) * 127 + 128);\nvar green = Math.round(Math.sin(0.3*i + 2) * 127 + 128);\nvar blue = Math.round(Math.sin(0.3*i + 4) * 127 + 128);\n\ni++;\nif (i>=32) {\n i = 0;\n}\n\nflow.set(\"i\", i);\n\nmsg.payload = {};\nmsg.payload.data = {};\nmsg.payload.data.rgb_color = \"[\" + red + \", \" + green + \", \" + blue + \"]\";\n\nreturn msg;","outputs":1,"noerr":0,"x":530,"y":240,"wires":[["04f201e54e9fc6fd","288285b6cc78da32"]]},{"id":"5fc6cec43bfa6dad","type":"function","z":"8fac6b2580decde7","name":"set var","func":"flow.set(\"i\", 0);\n\nreturn msg;","outputs":1,"noerr":0,"x":370,"y":240,"wires":[["4e38b829efe500d6"]]},{"id":"288285b6cc78da32","type":"delay","z":"8fac6b2580decde7","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"outputs":1,"x":540,"y":320,"wires":[["4e38b829efe500d6"]]},{"id":"677e52db21cee4f6","type":"api-call-service","z":"8fac6b2580decde7","name":"Cycle","server":"cc5f2328.3e1bd","version":5,"debugenabled":false,"domain":"homeassistant","service":"turn_on","areaId":[],"deviceId":[],"entityId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[{"property":"","propertyType":"msg","value":"","valueType":"data"}],"queue":"none","x":870,"y":240,"wires":[["5121b90714ca6e1b"]]},{"id":"1d48a0b698560759","type":"debug","z":"8fac6b2580decde7","name":"1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":870,"y":160,"wires":[]},{"id":"5121b90714ca6e1b","type":"debug","z":"8fac6b2580decde7","name":"2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1050,"y":160,"wires":[]},{"id":"b8712ff7c2b85db2","type":"inject","z":"8fac6b2580decde7","name":"23:00","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"00 23 * * *","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"str","x":220,"y":240,"wires":[["5fc6cec43bfa6dad"]]},{"id":"cc5f2328.3e1bd","type":"server","name":"Home Assistant","version":4,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30,"areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m"}]