Problems with conditional function

Thanks to every one to help me now I realize that my problem is no the conditions I will send you a video, so what I think is happening I'm connection a ESP8266 with the mqtt node so when my flow send open/close/ stop I think it sends to many msgs open open open until one of my conditions is completed so when is time to close the valve my flow sends close but it don't work so I have to turn off my ESP8266 turn on and he makes the close action so. My question is there is way in my if to send just one time a msg.payload "OPEN" like a sleep or something to not send to many msjs. I'm using a delay node with rate limit each 10 seconds but I think is not the best solution

You can use the same i describe here in answer to your question but apply it to the output message and not the input message.
Otherwise you could also use the rbe node.

Johannes

1 Like

The > rbe node is a good solution thanks.

I chek it out and my statments the message are send but they never pass the rbe node to the mqtt out node

What topic + payload do you send through the RBE.

RBE typically works per topic.

e.g.

index topic payload rbe will pass / block info
1 OPEN OPEN :arrow_right: because this is the first time RBE has see this payload / `topic combination
2 OPEN OPEN :x: because payload is same value as last time topic == "OPEN"
3 OPEN OPEN :x: because payload is same value as last time topic == "OPEN"
4 CLOSE CLOSE :arrow_right: because this is the first time RBE has see this payload / `topic combination
5 CLOSE CLOSE :x: because payload is same value as last time topic == "CLOSE"
6 OPEN OPEN :x: because payload is same value as last time topic == "OPEN "
7 CLOSE CLOSE :x: because payload is same value as last time topic == "CLOSE"
8 CLOSE CLOSE :x: because payload is same value as last time topic == "CLOSE"
9 CLOSE i_am_different :arrow_right: because the payload for topic "CLOSE" is different to the last time
10 CLOSE CLOSE :arrow_right: because the payload for topic "CLOSE" is different to the last time
11 CLOSE CLOSE :x: because payload is same value as last time topic == "CLOSE"

A better way to handle this is...

index topic payload rbe will pass / block info
1 STATUS OPEN :arrow_right: because this is the first time RBE has see this payload / `topic combination
2 STATUS CLOSE :arrow_right: because the payload for topic "STATUS" has changed
3 STATUS OPEN :arrow_right: because the payload for topic "STATUS" has changed
5 STATUS CLOSE :arrow_right: because the payload for topic "STATUS" has changed
4 STATUS CLOSE :x: because payload is same value as last time the RBE seen topic "STATUS"
6 STATUS OPEN :arrow_right: because the payload for topic "STATUS" has changed
7 STATUS CLOSE :arrow_right: because the payload for topic "STATUS" has changed

Might be your concern?

If not, then I hope this is useful to someone :smiley:

Dunno.

but could have a good guess if you answer...

and you show debug output of what GOES INTO the RBE?

try adding a topic.

You can do it in the function before the RBE like this...

//add the below line somewhere suitable in your function (before the return msg statement)
msg.topic = "some/suitable/topic"

--- OR ---

add a change node BETWEEN the function & the RBE

SET msg.topic
TO some/useful/and/meaningful/topic

I cant tell anything from the partial flow you have posted.

What you posted....

Also, I have no idea what values you have in your globals.
image

I have no idea what you are trying to achieve (sorry, I am not gonna read this full post to find out)

If you want someone to help, you really should only post minimum amount of flow/nodes required to replicate your issue & it should include sample data / fixed values etc. Also, you should really state an expected outcome ("it did't send anything" means nothing to me!). I cant guess what you are trying to achieve (its not as obvious as you might think)

I could say the same to you :stuck_out_tongue:

Look at my post before yours...

What is the value of these globals?

Also, you should really state an expected outcome

your reply was to simply re-posted your full flow.


Like i said before.

If you want someone to help, you really should only post minimum amount of flow/nodes required to replicate your issue & it should include sample data / fixed values

and

you should really state an expected outcome

and

I cant guess what you are trying to achieve (its not as obvious as you might think)