Node-red : set/reset multiple output

  • Hi all
    I need to set multiple outputs using node red. By using websocket I am able to set single output (relay) by creating a payload like this "msg.payload = {"cmd":"set","dev":"relay","circuit":"1","value":"1"};" or like this "msg.payload = {"dev":"relay", "circuit":"", "value":"1"};"
    What I am missing is the correct syntax to use when I need to set for instance 2 relays at the same time. I try to fill the payload with two commands (the 1st with circuit="1" and the second with circuit="2") with the Json standard syntax but it doesn't work. I also try to send two messages in sequence to set on the 1st and the 2nd relay. What happen in this case is that 1st relay goes on but when the 2nd realay switch on the 1st one is switched off.
    After a quick search on the forum I saw that there is an implementation of the function relay_set_all(self, values) but I can't find any documentation on how to use it.
    Can someone give me a suggestion on this topic?
    Thank you

  • Update on my previous post.
    I was able to set two relays "almost" at the same time by adding a delay of 100ms among the two commands. This is not a good way to reach the goal but it can work until someone can help me with the correct instruction to set two relays at the same time

  • administrators

    @zeus I will think about it how to make it possible, Thanks for the tip:

Log in to reply