# If this then statement in node red

**URL:** <https://discourse.nodered.org/t/if-this-then-statement-in-node-red/31809>\
**Category:** Developing Nodes\
**Created:** [21 August 2020 06:33 UTC](https://discourse.nodered.org/t/if-this-then-statement-in-node-red/31809 "2020-08-21T06:33:25Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![jepe63](https://avatars.discourse-cdn.com/v4/letter/j/d07c76/32.png) [@jepe63](https://discourse.nodered.org/u/jepe63)\
**Post date:** [21 August 2020 06:33 UTC](https://discourse.nodered.org/t/if-this-then-statement-in-node-red/31809/1 "2020-08-21T06:33:25Z")

</div>

Hi all , just new here , i've searched here but didn't find the answer (yet) so maybe somone can help.  
I managed to setup node red with the Nora (google home) plugin and it's working fine with my lamps.  
I'm now trying to create a command that if i say 'close blinds' the output will activate output and when i say 'open blinds' it will activate the second output. The reason is that i've got an KM-tronic at the input of the blinds wich just gives one relais one pulse to open and another relais gives another contact a pulse to close (can't change this , thats te way it works)

 ![question](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/6/66f2165e19fb875438f780f39b8071c1de23769a.png)  
This is a visual presentation of my problem (not the actual node)  
Thx for all the help!

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [21 August 2020 07:14 UTC](https://discourse.nodered.org/t/if-this-then-statement-in-node-red/31809/2 "2020-08-21T07:14:48Z")

</div>

Welcome to the forum.

What is your actual question ?

Can you select the nodes and export the flow and post it here (use the `</>` icon )

---

<div class="post-metadata">

**Author:** ![jepe63](https://avatars.discourse-cdn.com/v4/letter/j/d07c76/32.png) [@jepe63](https://discourse.nodered.org/u/jepe63)\
**Post date:** [21 August 2020 07:23 UTC](https://discourse.nodered.org/t/if-this-then-statement-in-node-red/31809/3 "2020-08-21T07:23:24Z")

</div>

Hi , thx for your response as said in the post there is no flow now , just a representation , the nodes are empty, the qestion is how and wich nodes i use for the part: if i say 'open blinds' than send true command to output one.  
That's to simplify the whole question

---

<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:** [21 August 2020 08:17 UTC](https://discourse.nodered.org/t/if-this-then-statement-in-node-red/31809/4 "2020-08-21T08:17:46Z")

</div>

You need to show us the output in a debug node of the message you are getting that you need to test, and tell us exactly what you want to get out of the test. Vague words are not enough.  
In principle your suggested flow looks appropriate, so we don't know what additional information you need unless you fully define the problem.

---

<div class="post-metadata">

**Author:** ![jepe63](https://avatars.discourse-cdn.com/v4/letter/j/d07c76/32.png) [@jepe63](https://discourse.nodered.org/u/jepe63)\
**Post date:** [21 August 2020 10:57 UTC](https://discourse.nodered.org/t/if-this-then-statement-in-node-red/31809/5 "2020-08-21T10:57:27Z")

</div>

Sorry all new to me 😉

When i give the command to open of close the blinds , this is the response, can you do something with it ?  
Thanx for your patience!

21-8-2020 12:55:21node: 8ab111dc.fb8fa  
KM 6 : msg.payload : Object  
{ openPercent: 100 }  
21-8-2020 12:56:01node: 8ab111dc.fb8fa  
KM 6 : msg.payload : Object  
{ openPercent: 0 }

As i can not post files as a newbie, here the json file

[http://www.wernerxx.be/testflow.json](http://www.wernerxx.be/testflow.json)

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [21 August 2020 11:08 UTC](https://discourse.nodered.org/t/if-this-then-statement-in-node-red/31809/6 "2020-08-21T11:08:53Z")

</div>

> can you do something with it ?

This is the core of node-red; its' very existence.

I think it may be more worth it to go [through this whole playlist](https://www.youtube.com/watch?v=ksGeUD26Mw0&list=PLyNBB9VCLmo1hyO-4fIZ08gqFcXBkHy-6) to get an understanding about how node-red works and what you can do with messages.

For your first switch node, you need to understand how payloads/messages are constructed, so that you know how to route messages (all explained in the playlist).

 ![Screenshot 2020-08-21 at 13.07.59](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/1/0149b618e642e5c82eac94e0716bed98a603bde7.jpeg)

---

<div class="post-metadata">

**Author:** ![jepe63](https://avatars.discourse-cdn.com/v4/letter/j/d07c76/32.png) [@jepe63](https://discourse.nodered.org/u/jepe63)\
**Post date:** [21 August 2020 11:13 UTC](https://discourse.nodered.org/t/if-this-then-statement-in-node-red/31809/7 "2020-08-21T11:13:03Z")

</div>

thanx , will look at the playlist

---

<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:** [4 September 2020 11:13 UTC](https://discourse.nodered.org/t/if-this-then-statement-in-node-red/31809/8 "2020-09-04T11:13:06Z")

</div>

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