I'm a newb on this programming people and need help, Im using AND logic with local inputs but it is not working however when use ultimate inject the AND logic works fine, can some one watch what do I need to change? what I noted is the ultimate inject has a topic but the localhost input.
Please help
Thanks
Hector
Not enough info - but I suspect your messages are coming at separate times.
A key peice of knowledge about node red is that multiple messages NEVER travel (or arrive) at the same time.
If you have separate messages that you want to compare, the payload from both messages need to be joined into one message.
See this article in the cookbook for an example of how to join messages into one object.
I recommend watching this playlist: Node-RED Essentials. The videos are done by the developers of node-red. They're nice & short and to the point. You will understand a whole lot more in about 1 hour. A small investment for a lot of gain.
appreciate your quick response, thanks
well, people I'm back to ask for help, after a week trying to understand context and variables context still have a question, I have been trying to setup an input sensor which pull a signal from groov epic, true/false , 1/0, and assign the name to this input but got the same mistake or step, when the name is assign to this input or variable, and try to use a boolean feature, it doesn't recognize the kind of input, it meant, i use a function to request if the input x == true but the payload is all the time like x but the true, can somebody just guide me and help on this trouble..!
Thanks
Let's atart with the basics
- what device are you runnning NR on?
- what verswion of NR and Node.js are you running (you can get this from the startup log)
- what extra nodes (node-red-contrib-???) are you using oin your flow?
- please export your flow and attach it to a reply
- Give a step by step description of what you are trying to do.
Frankly I do not understand what you are trying to describe. or example:
is the device returning a true/false or a 1/0? The easy way to find out is attach a debug
node (set to display the complete msg object) to the output of the groove epic node to see what it is actually returning.
again I don't understand what you are saying. This could be because it has to do with a contrib node, but not knowing waht the node is no-one will be able to help.
Here is how to copy and post a flow:
In order to make code readable and usable it is necessary to surround your code with three backticks (also known as a left quote or backquote ```
)
```
code goes here
```
You can edit and correct your post by clicking the pencil icon.
See this post for more details - How to share code or flow json
Thanks Zeno, appreciate your interest on this thread.. well it should be easy but my brain is making this complicated. Im using a groov Epic, the module input or the debug just shows the channel input and index, that's set , no topic, just the payload = true or false , so I need this input all around the flow and that's why assigning a var name.
im using a set or change node and change the input (boolean)
change msg.payload
search true
replace with flow var1
with this code, Im assuming the true or false is change to the flow var1, so with this change Im assuming I can use function like this
if (var1 == ' true' )
{ msg.payload = 'true'; }
else { msg.payload = 'false' ;}
msg retrun;
please let me know
thanks
Hector
Hi Hector, just incase you are mixing true
which is a boolean and 'true'
which is a string.
so if (var1 =='true')
should be if(var1 === true)
really ... omg, thanks a lot E1
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.