Switch-Node problem

Hello,
I have a problem with a switch node or a question for understanding.

I have an input value from a Zigbee sensor ("feuchte").

From a visualization I have an input value ("schwelle" which I first convert into a number).

Now I want to work with these two values ​​in the switch node and output true or false via the 2 outputs (in order to switch another device later).

However, the switch node does not provide any output values.
It seems as if the value "schwelle" is not read in into the switch-node. Why?

I have more screenshots, but new users are not allowed to upload more than 2 images.
Hope someone can help further
Thank you very much.
Regards Marc

I don't actually think you need both switch and change nodes for this. The change node alone can change values based on the input. So have a look at doing that instead.

Just to note there is no need to use JSONata.
Rule 1 greater than msg schwelle
Rule 2 otherwise.

You would also need to use a join node to join the message

See this article in the cookbook for an example of how to join messages into one object.

Hello @pio007, welcome to the forum.

Joining these two wires at the "feuchte" node does not mean that msg.feuchte and msg.schwelle are both available at the same time.
The two messages remain entirely separate.

I recommend that you put debug nodes to show the entire message coming from "Zigbee Luftfeuchte" and "Schwelle Luftfeuchte aus VIS".

Do msg.schwelle or msg.feuchte exist, or do both nodes pass a msg.payload?

Do both messages have a msg.topic property?

See this article in the cookbook for an example of how to join messages into one object.

ahhh, I see, the problem is that not both msg arrive in the switch node at the same time. JOIN-node is the solution.
Converting the string into a number doesn't seem necessary either. Thank you for your help!
I have now added a JOIN node (the 2 topics are also assigned), the result in the debug is the following:

What I don't understand yet is how I can use the tow topics (feuchte and schwelle) in the switch node. I tried this, but the result is not correct...
Thank you again...


perfect, thank you very much everybody.... that works! :hugs: :hugs:

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