# Initial condition of node at startup

**URL:** <https://discourse.nodered.org/t/initial-condition-of-node-at-startup/83401>\
**Category:** Dashboard\
**Tags:** node-red-dashboard\
**Created:** [3 December 2023 11:21 UTC](https://discourse.nodered.org/t/initial-condition-of-node-at-startup/83401 "2023-12-03T11:21:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![engmoh321](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/engmoh321/32/85502_2.png) [@engmoh321](https://discourse.nodered.org/u/engmoh321)\
**Post date:** [3 December 2023 11:21 UTC](https://discourse.nodered.org/t/initial-condition-of-node-at-startup/83401/1 "2023-12-03T11:21:40Z")

</div>

hi  
i have this flow:

```auto
 [
    {
        "id": "9d5dc986aaaa790c",
        "type": "tab",
        "label": "serial_write",
        "disabled": false,
        "info": "created by mohammed shady",
        "env": []
    },
    {
        "id": "3a6615a17593dfc5",
        "type": "serial out",
        "z": "9d5dc986aaaa790c",
        "name": "",
        "serial": "ac94254a.4b61b",
        "x": 450,
        "y": 180,
        "wires": []
    },
    {
        "id": "35d9e03a995d8186",
        "type": "inject",
        "z": "9d5dc986aaaa790c",
        "name": "LED_off",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "0",
        "payloadType": "num",
        "x": 90,
        "y": 180,
        "wires": [
            [
                "85ddb787f071df1d"
            ]
        ]
    },
    {
        "id": "b289624b7b81c0a5",
        "type": "debug",
        "z": "9d5dc986aaaa790c",
        "name": "debug 8",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 460,
        "y": 260,
        "wires": []
    },
    {
        "id": "85ddb787f071df1d",
        "type": "ui_switch",
        "z": "9d5dc986aaaa790c",
        "name": "",
        "label": "Digital on off",
        "tooltip": "",
        "group": "46b634bd0a3d172c",
        "order": 0,
        "width": 0,
        "height": 0,
        "passthru": true,
        "decouple": "false",
        "topic": "topic",
        "topicType": "msg",
        "style": "",
        "onvalue": "1",
        "onvalueType": "num",
        "onicon": "",
        "oncolor": "",
        "offvalue": "0",
        "offvalueType": "num",
        "officon": "",
        "offcolor": "",
        "animate": false,
        "className": "",
        "x": 250,
        "y": 180,
        "wires": [
            [
                "b289624b7b81c0a5",
                "3a6615a17593dfc5"
            ]
        ]
    },
    {
        "id": "ac94254a.4b61b",
        "type": "serial-port",
        "name": "",
        "serialport": "COM9",
        "serialbaud": "9600",
        "databits": "8",
        "parity": "none",
        "stopbits": "2",
        "waitfor": "",
        "newline": "3",
        "bin": "bin",
        "out": "time",
        "addchar": "false",
        "responsetimeout": ""
    },
    {
        "id": "46b634bd0a3d172c",
        "type": "ui_group",
        "name": "LED",
        "tab": "ad9bb8f4ccb825a8",
        "order": 2,
        "disp": true,
        "width": "2",
        "collapse": false,
        "className": ""
    },
    {
        "id": "ad9bb8f4ccb825a8",
        "type": "ui_tab",
        "name": "Home",
        "icon": "dashboard",
        "disabled": false,
        "hidden": false
    }
]

```

I do not need to use the inject node manually but I need to be 0 automatically at startup.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [3 December 2023 11:30 UTC](https://discourse.nodered.org/t/initial-condition-of-node-at-startup/83401/2 "2023-12-03T11:30:53Z")

</div>

Use the "inject once" option?

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/7/57dfd6dbc58765ad51be64063f7b0072f6ab30b9.png)

---

<div class="post-metadata">

**Author:** ![engmoh321](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/engmoh321/32/85502_2.png) [@engmoh321](https://discourse.nodered.org/u/engmoh321)\
**Post date:** [3 December 2023 13:12 UTC](https://discourse.nodered.org/t/initial-condition-of-node-at-startup/83401/3 "2023-12-03T13:12:34Z")

</div>

thank you

---

<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:** [17 December 2023 13:13 UTC](https://discourse.nodered.org/t/initial-condition-of-node-at-startup/83401/4 "2023-12-17T13:13:11Z")

</div>

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