# Startup value for dashboard Switch node

**URL:** https://discourse.nodered.org/t/startup-value-for-dashboard-switch-node/88414
**Category:** General
**Created:** [31 May 2024 16:55 UTC](https://discourse.nodered.org/t/startup-value-for-dashboard-switch-node/88414 "2024-05-31T16:55:38Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![k5map](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/k5map/32/47681_2.png) [@k5map](https://discourse.nodered.org/u/k5map)
#### Post date: [31 May 2024 16:55 UTC](https://discourse.nodered.org/t/startup-value-for-dashboard-switch-node/88414/1 "2024-05-31T16:55:38Z")

</div>

I have a dashboard Switch node in a flow. Each time I start NR, the Switch node's initial value is OFF. Is there a way I can set the default/startup value to ON without it triggering the next node in the flow?

---

<div class="post-metadata">

### Author: ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)
#### Post date: [31 May 2024 17:13 UTC](https://discourse.nodered.org/t/startup-value-for-dashboard-switch-node/88414/2 "2024-05-31T17:13:37Z")

</div>

Hi @k5map

I don't use dashboard much,  
but there is a `pass through` setting, but I believe that effects the ability to make changes on the dashboard - so likely isn't the answer.

However, If I am not mistaken:

- During your init routines, include a `msg.topic`.. lets say `init`, and then ignore any progressive affect in your downstream nodes if that `topic` is set

Much better folk here than I, if I am incorrect

Example

```auto
payload : true | false,
topic: 'init'

```

---

<div class="post-metadata">

### Author: ![k5map](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/k5map/32/47681_2.png) [@k5map](https://discourse.nodered.org/u/k5map)
#### Post date: [31 May 2024 19:57 UTC](https://discourse.nodered.org/t/startup-value-for-dashboard-switch-node/88414/3 "2024-05-31T19:57:31Z")

</div>

@marcus-j-davies ... interesting idea, I had not thought of doing it that way... off to give it a test.

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [31 May 2024 20:56 UTC](https://discourse.nodered.org/t/startup-value-for-dashboard-switch-node/88414/4 "2024-05-31T20:56:04Z")

</div>

Set the switch to not pass through messages.

---

<div class="post-metadata">

### Author: ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)
#### Post date: [31 May 2024 21:02 UTC](https://discourse.nodered.org/t/startup-value-for-dashboard-switch-node/88414/5 "2024-05-31T21:02:08Z")

</div>

> [@Colin](#):
>
> Set the switch to not pass through messages.

I tested that - and for me at least it stopped me being able to to make changes in dash.

![Screenshot 2024-05-31 at 22.00.15](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/7/970726e55bbf32ea0a8778a27c725347b5aa37b7.png)

its either (when disabled)

- Set the visual state based on input (can't set it during interaction)
- Set the visual state based on output (can't set it via `msg`)

(Only)

Unless Im missing something - entirely possible of course 😅

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [31 May 2024 21:15 UTC](https://discourse.nodered.org/t/startup-value-for-dashboard-switch-node/88414/6 "2024-05-31T21:15:16Z")

</div>

Feed the output back to the input. This is the mode I virtually always use. The switch sends its value off to MQTT and then back from MQTT into the input. Then you know the switch has been actioned.

---

<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: [29 August 2024 21:15 UTC](https://discourse.nodered.org/t/startup-value-for-dashboard-switch-node/88414/7 "2024-08-29T21:15:26Z")

</div>

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