Node red Javascript with start en stop payload for led blink

Dear Nodes,

I am no scripter, so i do not now "yet" how to program Javascript to do the following:

  • Node red Javascript node with a start (1) and stop (0) payload for led blink. And then something with a tme like 500ms.

I am trying to make a real led blink through MQTT to a ESP32 with ESPeasy on it.

I am trying to learn it, but I find it very hard, as I have no background in this.
I have found serveral scripts, but I cannot get them to do what i want.

Can anyone help me and script this for me?

Kind regards,
Me

You do not have to use Javascript, Node-red is a low code application. You could do this with standard nodes.
e.g.

[{"id":"68ea8547.c02aa4","type":"inject","z":"bf9e1e33.030598","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":160,"y":60,"wires":[["7106b69a.b98268"]]},{"id":"7106b69a.b98268","type":"change","z":"bf9e1e33.030598","name":"set blinks","rules":[{"t":"set","p":"payload","pt":"msg","to":"[1,0,1,0]","tot":"json"},{"t":"set","p":"topic","pt":"msg","to":"topic/path/to/light","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":340,"y":60,"wires":[["26637ee8.d53c0a"]]},{"id":"26637ee8.d53c0a","type":"split","z":"bf9e1e33.030598","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":490,"y":60,"wires":[["138c48.92de2bb8"]]},{"id":"138c48.92de2bb8","type":"delay","z":"bf9e1e33.030598","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"2","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":650,"y":60,"wires":[["670e4932.d1efe8"]]},{"id":"670e4932.d1efe8","type":"debug","z":"bf9e1e33.030598","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":740,"y":140,"wires":[]}]

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.