# Dashboard Switch Control "When Clicked" behaviour

**URL:** <https://discourse.nodered.org/t/dashboard-switch-control-when-clicked-behaviour/58045>\
**Category:** General\
**Created:** [9 February 2022 18:39 UTC](https://discourse.nodered.org/t/dashboard-switch-control-when-clicked-behaviour/58045 "2022-02-09T18:39:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MakerMan](https://avatars.discourse-cdn.com/v4/letter/m/82dd89/32.png) [@MakerMan](https://discourse.nodered.org/u/MakerMan)\
**Post date:** [9 February 2022 18:39 UTC](https://discourse.nodered.org/t/dashboard-switch-control-when-clicked-behaviour/58045/1 "2022-02-09T18:39:03Z")

</div>

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](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/1/f16ab403564cd5f3cdce9d3b3fe3d2431eebde68.png)

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.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/7/47d53f99b41844646464bc29bad8c4aefaa008f6.png)

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

Thankyou

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [9 February 2022 19:15 UTC](https://discourse.nodered.org/t/dashboard-switch-control-when-clicked-behaviour/58045/2 "2022-02-09T19:15:44Z")

</div>

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:

 ![Untitled 9](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/7/a7e22eb798d5d6fab98bd5f519ee988046ae4abe.jpeg)  
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 😀

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [23 February 2022 19:15 UTC](https://discourse.nodered.org/t/dashboard-switch-control-when-clicked-behaviour/58045/3 "2022-02-23T19:15:47Z")

</div>

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