NODE-RED FOR DUMMIES--TUTORIAL 06--CONDITIONAL COMPARE TWO NUMBERS BASIC BEGINNERS FUNDAMENTAL

Поділитися
Вставка
  • Опубліковано 13 гру 2024

КОМЕНТАРІ • 21

  • @topfundus1093
    @topfundus1093 Місяць тому

    Super, vielen Dank und viele Grüße aus Deutschland!

  • @gustavocastrorosas3572
    @gustavocastrorosas3572 5 років тому +2

    You light me up i was bout to give up on node red.
    I was working with high and low temp set points so i look for the min.number and max number to avoid bad position in the number.
    After that i was try to compare one of this values with inside temp to do turn on pump but i can't and this is what i was looking for.
    Thanks lot.

  • @farmaforpresident8138
    @farmaforpresident8138 6 років тому

    Buenos videos, espero que sigas pronto con node-red

  • @James_Cook_Explorer
    @James_Cook_Explorer 5 років тому +1

    I found everything I need, thank you

  • @DanQcCa
    @DanQcCa Рік тому +3

    if someone want the code of the function to compare the 2 numbers, here it is
    context.node = context.node || 0;
    context.node1 = context.node1 || 0;
    if(msg.topic == 'a'){
    context.node = msg.payload;
    } else if (msg.topic == 'b'){
    context.node1 = msg.payload;
    }
    if (context.node > context.node1){
    return{ topic: 'd', payload: 'equal'}
    }else{
    return{ topic: 'e', payload: 'no equal'}
    }

  • @ykimleong
    @ykimleong 6 років тому +1

    thanks for the vide. i have a question, in the function line "11" & "13", why you need to return topic:'d', & topic:'e', i dont see and dont understand where do you use this output topic?

    • @jhordanchavez9557
      @jhordanchavez9557  6 років тому

      Hello Kim, I use return topic d and e because the output function needs to have a new topic (you can check in the screen of the debug, in the minute 6:06 for example, for equal the topic is d and in the minute 6:44 the topic is e for no equal output).

  • @raymondsiew1696
    @raymondsiew1696 2 роки тому

    Hi thanks for the video. How do you compare two state instead of number? if both state if the same? "on/on" and "off/off" but I only need state of "on/on"?

  • @tommayne237
    @tommayne237 3 роки тому

    I cannot get this to work when i do it from the numeric inputs from dashboard. Im not sure but i think the topic field within the numeric input node is bugged. It works ok when manually injecting. Any ideas?

  • @jophiljacob7163
    @jophiljacob7163 5 років тому

    I am a beginner in JavaScript and node red.
    What is the first two lines of function means?

  • @chevy8932
    @chevy8932 6 років тому +1

    Why the first value, whn you make a test in debug mode is "No equal"?

    • @jhordanchavez9557
      @jhordanchavez9557  6 років тому +1

      Very good question my friend, it is a few glitch of the program until the inputs "a" and "B" synchronize each other, because we are injecting them every second. And also because I am using node red in the cloud (maybe the connection). I will do it offline with node-red and I will let you know if the same glitch appears.

    • @chevy8932
      @chevy8932 6 років тому

      ok thank you very for your work and effort!

  • @RanjanaSingh-yw6qn
    @RanjanaSingh-yw6qn 5 років тому

    if you have any idea about adding sub-tab of the tab I dashboard, please shear me

  • @Elmuchacho
    @Elmuchacho 3 роки тому

    Helloo need help to compare csv yo variable

  • @rubnm5
    @rubnm5 4 роки тому

    I can't get this to work. I verified that my topics were all matched up. Still nothing. The output changes once and then never changes regardless of inputs.
    Edit: got it working with changes.

    • @jhordanchavez9557
      @jhordanchavez9557  4 роки тому

      Could u send me your flow? I will check what is wrong

    • @rubnm5
      @rubnm5 4 роки тому +1

      @@jhordanchavez9557 nevermind. I changed how I wrote it and now it works. I had to use .get and .update to make it work.
      Thanks for the reply though!

  • @JosellitoViral
    @JosellitoViral 6 років тому

    Like crack

  • @reezalfaris2065
    @reezalfaris2065 3 роки тому

    your code not working bro