Is there an easier way to do what I have depicted below. Pretty much I have 3 motion sensors in master bathroom.
If anyone one of them detect motion, a helper is turned on.
If anyone one of them detect no motion, it checks the other two.
Only if all 3 are off at the same time will the helper turn off.
This works but wondering if theres an easier way to “code” it?
[{"id":"c9e174023076821a","type":"tab","label":"Flow 1","disabled":false,"info":"","env":[]},{"id":"acb0521ccf6bc110","type":"server-state-changed","z":"c9e174023076821a","name":"Motion sensed floor","server":"ab3e2c53.e3491","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.motion_master_bathroom2","entityidfiltertype":"exact","outputinitially":false,"state_type":"habool","haltifstate":"true","halt_if_type":"bool","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":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":210,"y":350,"wires":[["b23f42f70e640136"],["84a1f5df837747fe"]]},{"id":"425813e91943f629","type":"server-state-changed","z":"c9e174023076821a","name":"Motion sensed above door","server":"ab3e2c53.e3491","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.motion_master_bathroom_4in1","entityidfiltertype":"exact","outputinitially":false,"state_type":"habool","haltifstate":"true","halt_if_type":"bool","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":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":229,"y":296,"wires":[["b23f42f70e640136"],["768034564c15bc4b"]]},{"id":"5e77170dafcf9082","type":"server-state-changed","z":"c9e174023076821a","name":"Motion sensed closet","server":"ab3e2c53.e3491","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.motion_master_bathroom_closet","entityidfiltertype":"exact","outputinitially":false,"state_type":"habool","haltifstate":"true","halt_if_type":"bool","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":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":210,"y":410,"wires":[["b23f42f70e640136"],["9d5d0c3c41b465ec"]]},{"id":"b23f42f70e640136","type":"api-call-service","z":"c9e174023076821a","name":"ON: motion sensed helper","server":"ab3e2c53.e3491","version":3,"debugenabled":false,"service_domain":"input_boolean","service":"turn_on","entityId":"input_boolean.master_bathroom_motion_sensed","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":560,"y":230,"wires":[[]]},{"id":"0c5aae614849e225","type":"api-call-service","z":"c9e174023076821a","name":"OFF: motion sensed helper","server":"ab3e2c53.e3491","version":3,"debugenabled":false,"service_domain":"input_boolean","service":"turn_on","entityId":"input_boolean.master_bathroom_motion_sensed","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1210,"y":350,"wires":[[]]},{"id":"768034564c15bc4b","type":"api-current-state","z":"c9e174023076821a","name":"No motion on floor?","server":"ab3e2c53.e3491","version":2,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","entity_id":"binary_sensor.motion_master_bathroom2","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":530,"y":290,"wires":[["a2475c607f2b5740"],[]]},{"id":"a2475c607f2b5740","type":"api-current-state","z":"c9e174023076821a","name":"No motion in closet?","server":"ab3e2c53.e3491","version":2,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","entity_id":"binary_sensor.motion_master_bathroom_closet","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":840,"y":290,"wires":[["0c5aae614849e225"],[]]},{"id":"84a1f5df837747fe","type":"api-current-state","z":"c9e174023076821a","name":"No motion above door?","server":"ab3e2c53.e3491","version":2,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","entity_id":"binary_sensor.motion_master_bathroom_4in1","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":540,"y":350,"wires":[["2f5ff4d2db4d8622"],[]]},{"id":"9d5d0c3c41b465ec","type":"api-current-state","z":"c9e174023076821a","name":"No motion on floor?","server":"ab3e2c53.e3491","version":2,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","entity_id":"binary_sensor.motion_master_bathroom2","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":530,"y":410,"wires":[["dba1e26a477c3a91"],[]]},{"id":"2f5ff4d2db4d8622","type":"api-current-state","z":"c9e174023076821a","name":"No motion in closet?","server":"ab3e2c53.e3491","version":2,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","entity_id":"binary_sensor.motion_master_bathroom_closet","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":840,"y":350,"wires":[["0c5aae614849e225"],[]]},{"id":"dba1e26a477c3a91","type":"api-current-state","z":"c9e174023076821a","name":"No motion above door?","server":"ab3e2c53.e3491","version":2,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","entity_id":"binary_sensor.motion_master_bathroom_4in1","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":840,"y":410,"wires":[["0c5aae614849e225"],[]]},{"id":"ab3e2c53.e3491","type":"server","name":"AvilaSmartHome","version":2,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30}]