OK - that doesn’t work how it looks like (to me) it should work? I have brought it in an am using 2 toggles from a dashboard button for testing. Whats happening is if i hit toggle 1 on then off it is triggering ok, but then i need to hit toggle 2 on and off then turn 1 back on and off. Is that happening at your end? Wondering if i have accidentally altered something?
[{"id":"6215009b42c12415","type":"server-state-changed","z":"c89d915bdff0f798","name":"sensors","server":"","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":["input_boolean.test","input_boolean.test2","input_boolean.test3"],"entityidfiltertype":"list","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"entityidfilter","valueType":"config"}],"x":126,"y":2192,"wires":[["f3ad87b134efa38f"],[]]},{"id":"9278e9b0b5cee660","type":"api-get-history","z":"c89d915bdff0f798","name":"","server":"","version":0,"startdate":"","enddate":"","entityid":"","entityidtype":"is","useRelativeTime":true,"relativeTime":"10 seconds","flatten":false,"output_type":"array","output_location_type":"msg","output_location":"payload","x":442,"y":2192,"wires":[["dce924ae9b63e162"]]},{"id":"dce924ae9b63e162","type":"function","z":"c89d915bdff0f798","name":"check sensor states","func":"// loop through the different sensors\nconst activeSensors = msg.payload.map((sensor) => {\n // check if atleast one history has the state \"on\"\n return sensor.some((entity) => entity.state === \"on\");\n// count how many sensors had an \"on\" state\n}).filter((sensor) => sensor === true).length > 1;\n\n// if activeSensors is true than two sensor were active in the time window\nif(activeSensors) {\n return msg;\n}\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":644,"y":2192,"wires":[["8c93eb2647a7306b"]]},{"id":"8c93eb2647a7306b","type":"debug","z":"c89d915bdff0f798","name":"debug 101","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":838,"y":2192,"wires":[]},{"id":"f3ad87b134efa38f","type":"change","z":"c89d915bdff0f798","name":"set entity ids","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"entity_id\": payload ~> $join(\",\")}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":278,"y":2192,"wires":[["9278e9b0b5cee660"]]}]