Still there.
Ah. I was fixated on the rgb message part.
My bad.
But if that can only ever be 0 or 1.....
Just looked at wipe.
I am changing it.
if (msg.payload.includes("0,0,0") && wipe ==1)
{
//node.warn("HERE")
context.set("wipe",0) // <---- here
msg.wipe = "WIPE"
}
let parts = msg.payload.split(",")
let lastThree = parts.slice(-3) // get last 3 elements
if (!(lastThree.join(",") === "0,0,0")) {
//node.warn("** message detected " + part + " " + msg.payload);
context.set("wipe", 1) // <--- here
msg.wipe = "OVERWRITE"
}
Or am I still missing something?
(Dunno why, but.....)
Here's a big picture of the flow.
Top left, messages arrive and set their respective flow context values.
Directly below: test injections to simulate problems.
To the right of that (bottom middle) is the clock/cycle/counter that cycles 0 - 5.
Middle of the screen is the new block that then sends the message/s to the LEDs.
(Helps if I actually add the picture.)
(Sorry)
Closer view.
Some funky tricks happening.
Yes, I maybe could do it all in the function node.
But I guess at this point, I will K.I.S.S it.
In that case you don't need the check it at all.
Ok. Thanks.
Ok, I'm not sure where/when/if it is really fixed.
The code I posted works WAY better than the original stuff I had.
So as to not drag this on, I'll mark it as solved.
Alas it will be on this post as a lot of stuff has gone on in this thread.
No offence to helpers. I don't want to show bias.

