hello, everyone
this is my first project with node-red and raspberry pi and I need your help
what I'm trying to make is...
-I had my med button (GPIO input node) that turn off led
-remind me later button (GPIO input node ) that delay the led 10m if the button pressed and if the led is on
-let's pretend that the debug nodes are LEDs (GPIO output nodes) the switch node output is string "scheduleX" then I add on change node to turn it to 1 .....is there a better way
I appreciate any help !!! thank u
[{"id":"4138d84d.b6a638","type":"tab","label":"ReMedy","disabled":false,"info":""},{"id":"975d7ea8.cca72","type":"trigger","z":"4138d84d.b6a638","op1":"0","op2":"1","op1type":"num","op2type":"str","duration":"10","extend":false,"units":"min","reset":"","bytopic":"all","name":"","x":330,"y":100,"wires":[[]]},{"id":"8b3269df.100958","type":"switch","z":"4138d84d.b6a638","name":"","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"schedule1","vt":"str"},{"t":"eq","v":"schedule2","vt":"str"},{"t":"eq","v":"schedule3","vt":"str"},{"t":"eq","v":"schedule4","vt":"str"},{"t":"eq","v":"schedule5","vt":"str"},{"t":"eq","v":"schedule6","vt":"str"},{"t":"eq","v":"schedule7","vt":"str"},{"t":"eq","v":"schedule8","vt":"str"},{"t":"eq","v":"schedule9","vt":"str"},{"t":"eq","v":"schedule10","vt":"str"},{"t":"eq","v":"schedule11","vt":"str"},{"t":"eq","v":"schedule12","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":13,"x":250,"y":340,"wires":[["43201e02.2908b"],["72bbd107.55178"],["fbf67d6d.60ac5"],["d5d35e96.974d9"],["75be7440.85b61c"],["76dee429.936eec"],["b64b7e4c.ab6d9"],["5f9902a2.a564fc"],["c1799296.56fa"],["2ad4bcc9.e7d764"],["eefc9f7d.6a4cd"],["1c9f5bac.82bea4"],[]]},{"id":"acced8a.f01e528","type":"comment","z":"4138d84d.b6a638","name":"I take my medicine","info":"","x":690,"y":40,"wires":[]},{"id":"ec760d98.d4494","type":"comment","z":"4138d84d.b6a638","name":"Remind me later","info":"","x":260,"y":40,"wires":[]},{"id":"7e8c5bb0.2fd684","type":"comment","z":"4138d84d.b6a638","name":"which schedule for witch container","info":"","x":180,"y":220,"wires":[]},{"id":"a906bd29.92583","type":"switch","z":"4138d84d.b6a638","name":"if input is 1","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":570,"y":100,"wires":[["2b8093e1.3521ac"],[]]},{"id":"2b8093e1.3521ac","type":"change","z":"4138d84d.b6a638","name":"turn 0","rules":[{"t":"set","p":"payload","pt":"msg","to":"0","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":730,"y":100,"wires":[[]]},{"id":"7c514d74.288d24","type":"cronplus","z":"4138d84d.b6a638","name":"","outputField":"payload","timeZone":"","persistDynamic":false,"commandResponseMsgOutput":"output1","outputs":1,"options":[{"name":"schedule1","topic":"schedule1","payloadType":"default","payload":"","expressionType":"cron","expression":"0 */1 * * * *","location":"","offset":"0","solarType":"all","solarEvents":"sunrise,sunset"},{"name":"schedule2","topic":"schedule2","payloadType":"default","payload":"","expressionType":"cron","expression":"0 */2 * * * *","location":"","offset":"0","solarType":"all","solarEvents":"sunrise,sunset"},{"name":"schedule3","topic":"schedule3","payloadType":"default","payload":"","expressionType":"cron","expression":"0 */3 * * * * *","location":"","offset":"0","solarType":"all","solarEvents":"sunrise,sunset"},{"name":"schedule4","topic":"schedule4","payloadType":"default","payload":"","expressionType":"cron","expression":"0 */4 * * * *","location":"","offset":"0","solarType":"all","solarEvents":"sunrise,sunset"},{"name":"schedule5","topic":"schedule5","payloadType":"default","payload":"","expressionType":"cron","expression":"0 */5 * * * * *","location":"","offset":"0","solarType":"all","solarEvents":"sunrise,sunset"},{"name":"schedule6","topic":"schedule6","payloadType":"default","payload":"","expressionType":"cron","expression":"0 */6 * * * * *","location":"","offset":"0","solarType":"all","solarEvents":"sunrise,sunset"},{"name":"schedule7","topic":"schedule7","payloadType":"default","payload":"","expressionType":"cron","expression":"0 */7 * * * * *","location":"","offset":"0","solarType":"all","solarEvents":"sunrise,sunset"},{"name":"schedule8","topic":"schedule8","payloadType":"default","payload":"","expressionType":"cron","expression":"0 */8 * * * * *","location":"","offset":"0","solarType":"all","solarEvents":"sunrise,sunset"},{"name":"schedule9","topic":"schedule9","payloadType":"default","payload":"","expressionType":"cron","expression":"0 */9 * * * * *","location":"","offset":"0","solarType":"all","solarEvents":"sunrise,sunset"},{"name":"schedule10","topic":"schedule10","payloadType":"default","payload":"","expressionType":"cron","expression":"0 */10 * * * * *","location":"","offset":"0","solarType":"all","solarEvents":"sunrise,sunset"},{"name":"schedule11","topic":"schedule11","payloadType":"default","payload":"","expressionType":"cron","expression":"0 */11 * * * * *","location":"","offset":"0","solarType":"all","solarEvents":"sunrise,sunset"},{"name":"schedule12","topic":"schedule12","payloadType":"default","payload":"","expressionType":"cron","expression":"0 */12 * * * * *","location":"","offset":"0","solarType":"all","solarEvents":"sunrise,sunset"}],"x":100,"y":340,"wires":[["8b3269df.100958"]]},{"id":"43f0b8ea.df4af8","type":"debug","z":"4138d84d.b6a638","name":"1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":770,"y":200,"wires":[]},{"id":"f7c79999.245458","type":"debug","z":"4138d84d.b6a638","name":"2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":630,"y":220,"wires":[]},{"id":"fbf67d6d.60ac5","type":"debug","z":"4138d84d.b6a638","name":"3","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":770,"y":240,"wires":[]},{"id":"76dee429.936eec","type":"debug","z":"4138d84d.b6a638","name":"6","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":630,"y":300,"wires":[]},{"id":"1c9f5bac.82bea4","type":"debug","z":"4138d84d.b6a638","name":"12","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":630,"y":420,"wires":[]},{"id":"eefc9f7d.6a4cd","type":"debug","z":"4138d84d.b6a638","name":"11","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":770,"y":400,"wires":[]},{"id":"2ad4bcc9.e7d764","type":"debug","z":"4138d84d.b6a638","name":"10","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":630,"y":380,"wires":[]},{"id":"c1799296.56fa","type":"debug","z":"4138d84d.b6a638","name":"9","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":770,"y":360,"wires":[]},{"id":"5f9902a2.a564fc","type":"debug","z":"4138d84d.b6a638","name":"8","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":630,"y":340,"wires":[]},{"id":"b64b7e4c.ab6d9","type":"debug","z":"4138d84d.b6a638","name":"7","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":770,"y":320,"wires":[]},{"id":"75be7440.85b61c","type":"debug","z":"4138d84d.b6a638","name":"5","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":770,"y":280,"wires":[]},{"id":"d5d35e96.974d9","type":"debug","z":"4138d84d.b6a638","name":"4","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":630,"y":260,"wires":[]},{"id":"43201e02.2908b","type":"change","z":"4138d84d.b6a638","name":"on","rules":[{"t":"set","p":"payload","pt":"msg","to":"1","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":200,"wires":[["43f0b8ea.df4af8"]]},{"id":"72bbd107.55178","type":"change","z":"4138d84d.b6a638","name":"on","rules":[{"t":"set","p":"payload","pt":"msg","to":"1","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":240,"wires":[["f7c79999.245458"]]},{"id":"1c866e9b.ece571","type":"switch","z":"4138d84d.b6a638","name":"if input is 1","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":130,"y":100,"wires":[["975d7ea8.cca72"],[]]}]