I have a flow that used to work, and now doesn’t after a recent update. It is supposed to check the previous state of the alarm panel, then choose an output based on that previous state. But it gives this debug info:
“output comparator failed: property “old_state.state” with value armed_home failed “is” check against (str) “armed_home””
That’s obviously supposed to be a match.
The pic is how I have the node configured. Can someone help me with what I’m doing wrong?
First. I assume that you have no conditional tests, just custom outputs. These output will fire only when the associated output condition is true.
Second. For a ‘custom message’ the output must be an object like {“payload”: “this or that”} as this output becomes the entire message (Node-RED messages are objects).
If you want to output just ‘stay–>disarmed’ then I think you should use ‘custom payload’ instead, which generates msg.payload.
Third. You are quoting your strings. When the dropdown selector option is ‘string az’ then it expects an unquoted string (confusing I know, but that is the way it is).
You are therefore testing previous state as " “armed_home” ", when it is probably just “armed_home”, and you are trying to output " “stay–> disarmed” "
The following shows how the unquoted timestamp string is successfully compared against the previous state (string), and generates an unquoted string as a custom payload output (string).
Somebody (Alexander Pope I believe) once said that a little learning is a dangerous thing, and Lady Bracknell said one should either know everything, or nothing. I’m going with:
A person who never made a mistake never tried anything new - Albert Einstein