Looking for a node to do this function....

41 views
Skip to first unread message

shykitten55

unread,
Sep 22, 2017, 6:20:14 AM9/22/17
to Node-RED
(New project)

I am wanting a node that:
If it gets anything on an input, it sends a user defined output.

Sorry, I'm looking, but still not confident enough to be able to read into the descriptions to nut it out.


Colin Law

unread,
Sep 22, 2017, 6:27:13 AM9/22/17
to node...@googlegroups.com
A change node can do that. Provided that by user you mean the user
who sets up the flow.

If you mean data entered later at run time can you give a bit more
details of exactly what you want to do as the solution will depend on
the details.

Colin
> --
> http://nodered.org
>
> Join us on Slack to continue the conversation: http://nodered.org/slack
> ---
> You received this message because you are subscribed to the Google Groups
> "Node-RED" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to node-red+u...@googlegroups.com.
> To post to this group, send email to node...@googlegroups.com.
> Visit this group at https://groups.google.com/group/node-red.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/node-red/c11953fe-9a39-4572-a0cd-638ae7c7be6f%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Cat

unread,
Sep 22, 2017, 6:34:58 AM9/22/17
to node...@googlegroups.com
Sorry....

The working is like this (log winded version):

A timestamp (and more) is passed down a flow.
I need this to be "simplified" to a basic signal indicating that the function has happened.

Rather than having to search for the constant part and act on that, I wanted to "simplify" the signal here so further down the flow it is easier to see/understand.

I think the change node shall suffice.

(Given up on the MQTT for now.)



Julian Knight

unread,
Sep 22, 2017, 1:23:32 PM9/22/17
to Node-RED
You can do that various ways. A change node can do it - using a simple change or via JSONata if you need to do something more complex. A function node can also do it of course. For data transformation - e.g. "simplify" - JSONata is a great choice.

steve rickus

unread,
Sep 22, 2017, 1:45:14 PM9/22/17
to Node-RED
Another way to look at this would be to use the msg.topic as the "simplified" control code, and the msg.payload as the timestamp. Downstream nodes can simply check the topic (e.g. "start", "stop", "reset") and react accordingly. Or a single switch node can route the msg to different flows based upon that topic string...
Reply all
Reply to author
Forward
0 new messages