RBE node not working as expected

Hi,

I have this flow:

I catch the message from the switch and filter out state_left to see if the switch is ON or OFF. Every few minutes the switch also sends a temperature update. I don’t need that but is does that. I that case it also sends the state_left again so I use a Report-by-exeption (RBE) node to check if the state is different from the last state. BUT in my case the state “OFF” is always passing the RBE node. Why?

Did you uncheck the box for separate topics?

Thank you for replying! Yes I have unchecked that box.
I think it has to do with the result of the function node.

Edit:
I think I found a solution in changing the mode in the RBE node from ‘block unless value changes’ to ‘block unless value changes (ignore initial value)’ . Don’t understand why this has to be, but it seems to work.

Edit2:
No, not working. Now the switch from ON to OFF is not detected. And this is crucial for the rest of my flow.

I’d suggest changing your debug node to full msg object just to see if something jumps out. You can also try a change node in place of your function node to see if that makes any difference…

You could also move the rbe node ahead of your function node and check the msg.payload.state_left

Since you already have function Node in front, then you can also do the checks in the function Node and if they re right then do the return msg.

The method you use in the function retains the other parts of the incoming msg. You can create a new message that will ony contain a payload by using

let newMsg = { payload: msg.payload.state_left };
return newMsg;