Dashboard Switch Control "When Clicked" behaviour

This is probably really simple, but it's not working quite as I expected ...

I have a flow which generates email notifications and I want to be able to switch off and on the email notifications.

image

The filter node passes messages when only when msg.payload changes, so that in my case I get emails for timeout detected and timeout cleared.

I thought that it would be handy to drop in a dashboard switch to allow me to enable or disable emails. But having done that, I now get emails about the switch position as well. There seems to be no option to allow the switch to send nothing.

I suppose I'm looking for 'When clicked, send" = nothing!

Thankyou

It looks like you are thinking of the dashboard switch like a physical switch in a physical wire - no electrickery can get through if the switch is off.
But actually it's a widget that sends "On" or "Off" when you toggle it.

You can use the switch to control a node-red-contrib-simple-gate:


AIUI the gate won't pass through messages whose topic is "control"

Also you can use a non-dashboard switch to filter out the timeout cleared messages.

jb :grinning:

1 Like

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