node-red-dashboard icon indicating copy to clipboard operation
node-red-dashboard copied to clipboard

On/Off Payload Swap on Switch component

Open justoke opened this issue 11 months ago • 3 comments

Description

When using a switch where specifying the ON and OFF payload properties, a common scenario is where logic needs to be inverted. The ON payload may be OFF where the consumer of say an MQTT message interprets OFF as the default on state of a NC relay contact. While it is easy to just change the text for the ON and OFF payloads, when a flow has multiple switches this quickly becomes a chore and a tedious workflow.

Proposal is to have a toggle button which allows the swapping of the ON and OFF payload values. image

Have you provided an initial effort estimate for this issue?

I have provided an initial effort estimate

justoke avatar Mar 23 '24 12:03 justoke

That doesn't help if you want true/false, On/Off 1/0 or something else. The vast majority of the systems I have built don't use ON/OFF.

colinl avatar Mar 23 '24 18:03 colinl

I think the proposal here is simpler than you're interpretation @colinl.

I think the request is just a button in the node's editor that switches the values in that editor.

joepavitt avatar Mar 24 '24 13:03 joepavitt

@joepavitt Yes, this is purely a time saving suggestion. A bigger picture view might be the ability to select a set of like nodes and make property changes to them all. These don't seem important until you have flows with plenty of nodes and want to refactor. I'm often stuck with this task and its always tedious. Let's make the easy things easy or even easier.

justoke avatar Mar 24 '24 13:03 justoke