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.
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'} }
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?
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).
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"?
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?
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.
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.
Super, vielen Dank und viele Grüße aus Deutschland!
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.
Buenos videos, espero que sigas pronto con node-red
I found everything I need, thank you
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'}
}
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?
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).
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"?
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?
I am a beginner in JavaScript and node red.
What is the first two lines of function means?
Why the first value, whn you make a test in debug mode is "No equal"?
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.
ok thank you very for your work and effort!
if you have any idea about adding sub-tab of the tab I dashboard, please shear me
Helloo need help to compare csv yo variable
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.
Could u send me your flow? I will check what is wrong
@@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!
Like crack
your code not working bro