What is the state of the boolean ?
Look in developer tools
Then turn it on.
The current state node in the sequence stops the loop when the boolean is off.
You can use a trigger node and use msg.reset
to stop it. You could technically do this with the delay node, stop it by using msg.reset
There would be a small window where it wasn’t holding a message and the reset command would not work.
[{"id":"04f201e54e9fc6fd","type":"template","z":"f80b6c338afd5483","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":910,"y":3540,"wires":[["677e52db21cee4f6","1d48a0b698560759"]],"icon":"node-red-contrib-color-convert/color-convert.png"},{"id":"4e38b829efe500d6","type":"function","z":"f80b6c338afd5483","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":750,"y":3540,"wires":[["04f201e54e9fc6fd"]]},{"id":"5fc6cec43bfa6dad","type":"function","z":"f80b6c338afd5483","name":"set var","func":"flow.set(\"i\", 0);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":350,"y":3540,"wires":[["6bfabdcc6822b45a"]]},{"id":"677e52db21cee4f6","type":"api-call-service","z":"f80b6c338afd5483","name":"Cycle","server":"6b1110b5.183a4","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":1090,"y":3540,"wires":[["5121b90714ca6e1b"]]},{"id":"1d48a0b698560759","type":"debug","z":"f80b6c338afd5483","name":"1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1090,"y":3460,"wires":[]},{"id":"5121b90714ca6e1b","type":"debug","z":"f80b6c338afd5483","name":"2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1270,"y":3460,"wires":[]},{"id":"b8712ff7c2b85db2","type":"inject","z":"f80b6c338afd5483","name":"on command","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"00 23 * * *","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"str","x":170,"y":3540,"wires":[["5fc6cec43bfa6dad"]]},{"id":"6bfabdcc6822b45a","type":"trigger","z":"f80b6c338afd5483","name":"","op1":"","op2":"0","op1type":"date","op2type":"str","duration":"-5","extend":false,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":580,"y":3540,"wires":[["4e38b829efe500d6"]]},{"id":"e9f55e2106b911aa","type":"inject","z":"f80b6c338afd5483","name":"off command","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":150,"y":3660,"wires":[["35e83970ce3fa7b1"]]},{"id":"35e83970ce3fa7b1","type":"change","z":"f80b6c338afd5483","name":"","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"reset","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":340,"y":3660,"wires":[["6bfabdcc6822b45a"]]},{"id":"6b1110b5.183a4","type":"server","name":"Home Assistant","version":4,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":false,"heartbeat":false,"heartbeatInterval":"30","areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m"}]