NodeRED Multiple binary_sensors keep triggering

Hello, I have multiple binary_sensors that keep triggering erroneously in NodeRED.
They are window/doors. When opening, I can see only the sensor opened in HASS. However, as I open more, all of the sensors that were previously opened are being triggered again but only in NodeRed. Example: I open my window. NodeRED node is triggered and I see the sensor opened in HA. I close the window and open the door. I see in HA that the window is closed and the door is now opened, BUT both the door and window have triggered again in NodeRED. This persists across restarts of HA and NodeRED.
By now if I open any one binary_sensor, ALL binary_sensor nodes are triggered in NodeRED.

Here’s the nodered flow:

[{"id":"f4009a0e.471a48","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"6cf257ef.2dd7f8","type":"server-state-changed","z":"f4009a0e.471a48","name":"Dining Rm Window Status","server":"d3adfccb.fd313","entityidfilter":"binary_sensor.dining_room_window","entityidfiltertype":"substring","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"","halt_if_compare":"is","outputs":1,"x":230,"y":320,"wires":[[]]},{"id":"53c6c397.14bd5c","type":"server-state-changed","z":"f4009a0e.471a48","name":"Living Rm Window Status","server":"d3adfccb.fd313","entityidfilter":"binary_sensor.living_room_window","entityidfiltertype":"substring","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"","halt_if_compare":"is","outputs":1,"x":230,"y":280,"wires":[[]]},{"id":"a95ec92d.2b26e8","type":"server-state-changed","z":"f4009a0e.471a48","name":"Nursery Rm Window Status","server":"d3adfccb.fd313","entityidfilter":"binary_sensor.nursery_window","entityidfiltertype":"substring","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"","halt_if_compare":"is","outputs":1,"x":220,"y":240,"wires":[[]]},{"id":"7b255903.ff3858","type":"server-state-changed","z":"f4009a0e.471a48","name":"Master Bedrm Window Status","server":"d3adfccb.fd313","entityidfilter":"binary_sensor.master_bedroom_window","entityidfiltertype":"substring","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"","halt_if_compare":"is","outputs":1,"x":220,"y":200,"wires":[[]]},{"id":"55fcbd0f.b88b44","type":"server-state-changed","z":"f4009a0e.471a48","name":"Main Entry Door Status","server":"d3adfccb.fd313","entityidfilter":"binary_sensor.main_entry_door","entityidfiltertype":"substring","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"","halt_if_compare":"is","outputs":1,"x":240,"y":360,"wires":[[]]},{"id":"9487d375.27b83","type":"server-state-changed","z":"f4009a0e.471a48","name":"Garage Entry Door Status","server":"d3adfccb.fd313","entityidfilter":"binary_sensor.garage_entry_door","entityidfiltertype":"substring","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"","halt_if_compare":"is","outputs":1,"x":230,"y":400,"wires":[[]]},{"id":"e45ea84a.66eea8","type":"server-state-changed","z":"f4009a0e.471a48","name":"Garage Overhead Door Status","server":"d3adfccb.fd313","entityidfilter":"binary_sensor.garage_overhead_door","entityidfiltertype":"substring","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"","halt_if_compare":"is","outputs":1,"x":220,"y":440,"wires":[[]]},{"id":"d3adfccb.fd313","type":"server","z":"","name":"Home Assistant"}]

Hi,

I’ve also experienced this type of behavior. As of now, I don’t have any explanation about why this is happening, but it can be fixed using a simple switch node where you make sure the new-state is different from the old one:

image

The node itself:
image
Might not be pretty but eh, it works.

I’m seeing the same thing happening too. I first thought it was just my z wave acting up cause every time my z wave lock would change state I would get a notification saying my garage heater just turned “on” when it is already “on”. I assume it must be HA scanning for state changes.

I also see this same issue with my device trackers which I have disabled for now. Will the state switch work for the device trackers to?

Yep, the checking of new_state.state vs old_state.state worked for me. Thanks @Vlavonvidden
In a few cases I was able to funnel a view binary sensors into a single function node and use javascript for the comparison.
Is this something expected or is this a bug? How does one verify if anyone else is experiencing this or working on it? Bug reports?

@Dayve67
If you use a debug node and change to view the entire msg object, you can see that timestamps are included. So it should work for any state of anything I would think.