Hi !
I am fresh to node red and I am stuck wirh current_state node which outputs the state of the entity I am checking against. But I want to have the original payload on output (when condition is met). Should be easy, but I haven’t found out how. Any hints ?
Example: current_state node named “is_dark?” checks illumination sensor and should pass payload “on”/“off” from input to output. But I get the illumination level on output if the condition is met instead.
I see in the help text it says, “Original value stored in msg.data.original_state .” I am not sure how to use that though.
update:
Well I figured it out. It does work as I want by using msg.data= entity and passing on the original payload. My problem was that I had to add a 10 ms delay to allow other flows to catch up and change the state that I was checking for at this current_state node.
I don’t, however, really understand conceptually why setting output to only msg.data= entity will pass the original payload. Is it that the .data IS the original payload? Any explanation or link to help me out? Thanks.