[Feature Request]Help prevent crossing wires from Switch node

I've always been hoping to see the switch node gain a few extra features but things have been very quiet with it for a while now.

One issue I'd like to see resolved is some method of easily getting around this type of crossed wire situation

image

image

Obviously, the switch node is a fundemental core node so changing it's behaviour needs a very cautious approach

But a couple of ideas sprung to mind today

  1. Add option to label the outputs 1,2,3,4,5

image

  1. Add option to reverse them

image

My feeling is that would cause more problems than it saves, due to getting confused over which way up the particular node is configured.

For the problem, I often use a Link node on the top ones to link down past the nodes attached to o/p 5.

Also, you could use a regex to send it to o/p 1 if it doesn't match any of those strings.

That's the reason for the number labelling :slight_smile:

And it wouldn't cause any issue for anyone who didn't tick a checkmark :slight_smile:

I'm after NOT having to employ extra nodes

And now we have two problems....... :slight_smile:

Why?

I think still only one problem, but it is how to code the regex (which is a one off problem, fairly easily solved), instead of the continuing annoyance at the crossing wires. I must admit that a few crossing wires doesn't bother me. In your example I would add another junction further down so there is only one crossing not two.

You must be new here and not have dealt with me before :slight_smile:

2 Likes

In this cases I just use a Link node like a via in PCB design. :man_shrugging:

And with NR 3.x and above, that is nice and easy now

chrome_4uR3BaQsoA

3 Likes

This thread is not about workarounding the fundamental issue :slight_smile:

you could work up the page instead of down then the top links wouldn't cross :slight_smile: nothing says they have to start top left.

1 Like

Get out!!!!!!!!!!

I'll get my coat.... :coat:

1 Like

As I've said - I don't need workarounds - I can easily sort myself out :slight_smile:

1 Like

or simpler


but yeah, whatevs... :slight_smile: time for a :beer:

3 Likes

A rather nice red wine awaits here at Chez Knight, left-overs from Valentines Night meal. :grin:

When life gives you crossed wires, make onion domes:
Untitled 3

7 Likes

Indeed. More of my flows look like that than I care to admit !

Ah, but if only we could get those colours! Maybe in Node-RED v10?

image

3 Likes

Is it too nitpicky to say that for the specific case you've mentioned, you could move the "otherwise" to the top of the list - assuming you leave it at "checking all rules" and your "contains" doesn't match more than one.

Actually that doesn't seem to work correctly, for me at least. It seems there is a bug in otherwise

image

[{"id":"028a6eabcf716de1","type":"inject","z":"bdd7be38.d3b55","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"hello","payloadType":"str","_mcu":{"mcu":false},"x":130,"y":560,"wires":[["8471bf3fb2f60286"]]},{"id":"8e9d6d71c5833b8c","type":"inject","z":"bdd7be38.d3b55","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"foo","payloadType":"str","_mcu":{"mcu":false},"x":130,"y":600,"wires":[["8471bf3fb2f60286"]]},{"id":"aa01b753cadbce05","type":"inject","z":"bdd7be38.d3b55","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"bar","payloadType":"str","_mcu":{"mcu":false},"x":130,"y":640,"wires":[["8471bf3fb2f60286"]]},{"id":"8471bf3fb2f60286","type":"switch","z":"bdd7be38.d3b55","name":"","property":"payload","propertyType":"msg","rules":[{"t":"else"},{"t":"cont","v":"ello","vt":"str"},{"t":"cont","v":"oo","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"_mcu":{"mcu":false},"x":310,"y":600,"wires":[["77c44f49affe1f3c"],["86e6760964d010b7"],["c1f6c9298bcb1fcc"]]},{"id":"86e6760964d010b7","type":"debug","z":"bdd7be38.d3b55","name":"TWO","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","_mcu":{"mcu":false},"x":490,"y":600,"wires":[]},{"id":"c1f6c9298bcb1fcc","type":"debug","z":"bdd7be38.d3b55","name":"THREE","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","_mcu":{"mcu":false},"x":500,"y":640,"wires":[]},{"id":"77c44f49affe1f3c","type":"debug","z":"bdd7be38.d3b55","name":"ONE","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","_mcu":{"mcu":false},"x":490,"y":560,"wires":[]}]