The same flow, using node-red-contrib-simple-gate
. No coding, no context variable.
[{"id":"e86dc6a6.5069b","type":"gate","z":"99c0b0a.c5701d","name":"","controlTopic":"set","defaultState":"open","openCmd":"on","closeCmd":"off","toggleCmd":"toggle","defaultCmd":"default","persist":false,"x":450,"y":420,"wires":[["dfb4ebbc.2c98b"]]},{"id":"c317029e.ada1a","type":"schedex","z":"99c0b0a.c5701d","name":"","suspended":false,"lat":"52.2","lon":"0.12","ontime":"06:00","ontopic":"set","onpayload":"on","onoffset":0,"onrandomoffset":0,"offtime":"06:30","offtopic":"set","offpayload":"off","offoffset":0,"offrandomoffset":0,"mon":true,"tue":true,"wed":true,"thu":true,"fri":true,"sat":false,"sun":false,"x":270,"y":440,"wires":[["e86dc6a6.5069b"]]},{"id":"8d311e57.4b844","type":"inject","z":"99c0b0a.c5701d","name":"","topic":"set","payload":"on","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":420,"wires":[["c317029e.ada1a"]]},{"id":"12da01a1.19923e","type":"debug","z":"99c0b0a.c5701d","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":730,"y":420,"wires":[]},{"id":"df8cc3ba.1ba52","type":"inject","z":"99c0b0a.c5701d","name":"","topic":"set","payload":"off","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":480,"wires":[["c317029e.ada1a"]]},{"id":"f8a8eb37.c4ac78","type":"inject","z":"99c0b0a.c5701d","name":"","topic":"","payload":"my msg","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":290,"y":400,"wires":[["e86dc6a6.5069b"]]},{"id":"dfb4ebbc.2c98b","type":"trigger","z":"99c0b0a.c5701d","op1":"on","op2":"off","op1type":"str","op2type":"str","duration":"5","extend":false,"units":"s","reset":"","bytopic":"all","name":"","x":580,"y":420,"wires":[["12da01a1.19923e"]]}]