# Control simple gate

**URL:** <https://discourse.nodered.org/t/control-simple-gate/22024>\
**Category:** General\
**Created:** [20 February 2020 17:45 UTC](https://discourse.nodered.org/t/control-simple-gate/22024 "2020-02-20T17:45:59Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![MaxD](https://avatars.discourse-cdn.com/v4/letter/m/a9a28c/32.png) [@MaxD](https://discourse.nodered.org/u/MaxD)\
**Post date:** [20 February 2020 17:46 UTC](https://discourse.nodered.org/t/control-simple-gate/22024/1 "2020-02-20T17:46:00Z")

</div>

Hello,

I am trying to control the simple-gate-node using change nodes.  
I'm new to Node-Red and really dont know what to do.  
Can someone explain to me how this works?

Kind regards,  
Max

---

<div class="post-metadata">

**Author:** ![homeplayer](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/homeplayer/32/12388_2.png) [@homeplayer](https://discourse.nodered.org/u/homeplayer)\
**Post date:** [20 February 2020 17:58 UTC](https://discourse.nodered.org/t/control-simple-gate/22024/2 "2020-02-20T17:58:21Z")

</div>

Max what is it you like to do,  
post your flow I don't know what you have, know and or did try

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [20 February 2020 18:31 UTC](https://discourse.nodered.org/t/control-simple-gate/22024/3 "2020-02-20T18:31:47Z")

</div>

> [@MaxD](#):
>
> I am trying to control the simple-gate-node using change nodes

You need to set the the msg.topic to 'control', give me a minute and I'll let you have an example flow.

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [20 February 2020 18:49 UTC](https://discourse.nodered.org/t/control-simple-gate/22024/4 "2020-02-20T18:49:52Z")

</div>

Does this example help you -

```auto
[{"id":"c545c385.8182a","type":"inject","z":"b3b413d1.05b1b","name":"input","topic":"","payload":"","payloadType":"date","repeat":"3","crontab":"","once":false,"onceDelay":0.1,"x":145,"y":1415,"wires":[["c94df585.e57e28"]]},{"id":"c714207b.a377a","type":"inject","z":"b3b413d1.05b1b","name":"open","topic":"","payload":"open","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":145,"y":1455,"wires":[["5740aa2c.4674e4"]]},{"id":"7d10beff.05a77","type":"inject","z":"b3b413d1.05b1b","name":"close","topic":"","payload":"close","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":145,"y":1495,"wires":[["5740aa2c.4674e4"]]},{"id":"7eed6b8a.5462b4","type":"inject","z":"b3b413d1.05b1b","name":"toggle","topic":"control","payload":"toggle","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":145,"y":1535,"wires":[["5740aa2c.4674e4"]]},{"id":"c94df585.e57e28","type":"gate","z":"b3b413d1.05b1b","name":"","controlTopic":"control","defaultState":"open","openCmd":"open","closeCmd":"close","toggleCmd":"toggle","defaultCmd":"default","persist":false,"x":490,"y":1500,"wires":[["2f2dd7bd.48d128"]]},{"id":"5740aa2c.4674e4","type":"change","z":"b3b413d1.05b1b","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"control","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":330,"y":1530,"wires":[["c94df585.e57e28"]]},{"id":"2f2dd7bd.48d128","type":"debug","z":"b3b413d1.05b1b","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":635,"y":1500,"wires":[]}]

```

---

<div class="post-metadata">

**Author:** ![drmibell](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/drmibell/32/8424_2.png) [@drmibell](https://discourse.nodered.org/u/drmibell)\
**Post date:** [20 February 2020 19:31 UTC](https://discourse.nodered.org/t/control-simple-gate/22024/5 "2020-02-20T19:31:27Z")

</div>

> [@MaxD](#):
>
> I am trying to control the simple-gate-node using change nodes.

Almost everything you need to know about using the node is shown in the examples provided when you install it. From the Import item in the "hamburger" menu, select Examples and import the `gate-demo` flow.

 ![control simple gate](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/1/317a0bf8e764f9312870670399efdfdd73113e21.jpeg)

That flow and the one posted by @Paul-Reed should help solve your problem.

---

<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:** [20 April 2020 19:31 UTC](https://discourse.nodered.org/t/control-simple-gate/22024/6 "2020-04-20T19:31:30Z")

</div>

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