Node Red Newbie: Help in picking up state of a boolean to disable the flow

Created these light control flows, they work great However I have an boolean on my HA dashboard and I want to use this to control whether the flow is on or off.

I haven’t been able to find out much about how to do this without adding extra nodes or exposing a control to HA.

I want to use my boolean as its already controlling automations in HA.

[{"id":"a0b5a84d2201b052","type":"tab","label":"Auto Lights Flows","disabled":false,"info":"","env":[]},{"id":"8eee4710c60a9dc0","type":"server-state-changed","z":"a0b5a84d2201b052","name":"","server":"8a463abce940242c","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.office1","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":"","forType":"num","forUnits":"seconds","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":230,"y":140,"wires":[["728ab2c2ac674a50"]]},{"id":"728ab2c2ac674a50","type":"trigger","z":"a0b5a84d2201b052","name":"","op1":"1","op2":"0","op1type":"str","op2type":"str","duration":"240","extend":true,"overrideDelay":false,"units":"s","reset":"on","bytopic":"all","topic":"topic","outputs":1,"x":890,"y":100,"wires":[["5ff4a446107d50fe"]]},{"id":"87317dd68bee918e","type":"api-call-service","z":"a0b5a84d2201b052","name":"Office Bulb","server":"8a463abce940242c","version":5,"debugenabled":false,"domain":"light","service":"turn_on","areaId":[],"deviceId":["64382a2318886b768016136a22a569b8"],"entityId":[],"data":"{\"brightness\":\"255\"}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1370,"y":60,"wires":[[]]},{"id":"5ff4a446107d50fe","type":"switch","z":"a0b5a84d2201b052","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":1110,"y":80,"wires":[["87317dd68bee918e"],["148fcf3aba341bc7"]]},{"id":"148fcf3aba341bc7","type":"api-call-service","z":"a0b5a84d2201b052","name":"Office Bulb","server":"8a463abce940242c","version":5,"debugenabled":false,"domain":"light","service":"turn_off","areaId":[],"deviceId":["64382a2318886b768016136a22a569b8"],"entityId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1370,"y":120,"wires":[[]]},{"id":"f0f07190c04e6692","type":"server-state-changed","z":"a0b5a84d2201b052","name":"","server":"8a463abce940242c","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_text.last_seen","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"Downstairs","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"for":"1","forType":"num","forUnits":"seconds","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":220,"y":300,"wires":[["e625f557e4b13262"],[]]},{"id":"e625f557e4b13262","type":"switch","z":"a0b5a84d2201b052","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":710,"y":300,"wires":[["728ab2c2ac674a50"],["148fcf3aba341bc7"]]},{"id":"145bb7241738fde0","type":"server-state-changed","z":"a0b5a84d2201b052","name":"","server":"8a463abce940242c","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"counter.office_occupancy_trigger","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":"","forType":"num","forUnits":"seconds","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":260,"y":80,"wires":[["728ab2c2ac674a50"]]},{"id":"4baa3e18d210da1d","type":"trigger","z":"a0b5a84d2201b052","name":"","op1":"1","op2":"0","op1type":"str","op2type":"str","duration":"1","extend":true,"overrideDelay":false,"units":"min","reset":"on","bytopic":"all","topic":"topic","outputs":1,"x":850,"y":480,"wires":[["8ba900356a14e11b"]]},{"id":"8ba900356a14e11b","type":"api-call-service","z":"a0b5a84d2201b052","name":"Hall and Entrance Bulbs","server":"8a463abce940242c","version":5,"debugenabled":false,"domain":"light","service":"turn_on","areaId":[],"deviceId":["f8c8b2691a4d074013f05b1dfbad1746","e59fd7c5532d4c97146b8d75de728172"],"entityId":[],"data":"{\"brightness\":\"255\"}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1410,"y":480,"wires":[[]]},{"id":"23bb9582def1503f","type":"server-state-changed","z":"a0b5a84d2201b052","name":"","server":"8a463abce940242c","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_boolean.front_door","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":"","forType":"num","forUnits":"seconds","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":230,"y":480,"wires":[["4baa3e18d210da1d"]]},{"id":"46e10e1a6f69b7b0","type":"comment","z":"a0b5a84d2201b052","name":"Office Light Controls","info":"","x":170,"y":20,"wires":[]},{"id":"b9bf401a1594862f","type":"comment","z":"a0b5a84d2201b052","name":"Entrance Light Controls","info":"","x":180,"y":440,"wires":[]},{"id":"8a463abce940242c","type":"server","name":"Home Assistant","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":"30","areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":": ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"default","statusTimeFormat":"h:m","enableGlobalContextStore":true}]```

I managed to work this out, added the boolean as a state change node, added the Basic Gate node and this worked to open the gate, I used a change node to change the payload from open to close to save having a 2nd state change node.

[{"id":"8eee4710c60a9dc0","type":"server-state-changed","z":"a0b5a84d2201b052","name":"","server":"8a463abce940242c","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.office1","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":"","forType":"num","forUnits":"seconds","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":230,"y":140,"wires":[["13f8724bdd2cad13"]]},{"id":"728ab2c2ac674a50","type":"trigger","z":"a0b5a84d2201b052","name":"","op1":"1","op2":"0","op1type":"str","op2type":"str","duration":"240","extend":true,"overrideDelay":false,"units":"s","reset":"on","bytopic":"all","topic":"topic","outputs":1,"x":950,"y":120,"wires":[["5ff4a446107d50fe"]]},{"id":"87317dd68bee918e","type":"api-call-service","z":"a0b5a84d2201b052","name":"Office Bulb","server":"8a463abce940242c","version":5,"debugenabled":false,"domain":"light","service":"turn_on","areaId":[],"deviceId":["64382a2318886b768016136a22a569b8"],"entityId":[],"data":"{\"brightness\":\"255\"}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1370,"y":60,"wires":[[]]},{"id":"5ff4a446107d50fe","type":"switch","z":"a0b5a84d2201b052","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":1110,"y":80,"wires":[["87317dd68bee918e"],["148fcf3aba341bc7"]]},{"id":"148fcf3aba341bc7","type":"api-call-service","z":"a0b5a84d2201b052","name":"Office Bulb","server":"8a463abce940242c","version":5,"debugenabled":false,"domain":"light","service":"turn_off","areaId":[],"deviceId":["64382a2318886b768016136a22a569b8"],"entityId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1370,"y":120,"wires":[[]]},{"id":"f0f07190c04e6692","type":"server-state-changed","z":"a0b5a84d2201b052","name":"","server":"8a463abce940242c","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_text.last_seen","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"Downstairs","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"for":"1","forType":"num","forUnits":"seconds","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":220,"y":360,"wires":[["e625f557e4b13262"],[]]},{"id":"e625f557e4b13262","type":"switch","z":"a0b5a84d2201b052","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":710,"y":360,"wires":[["728ab2c2ac674a50"],["148fcf3aba341bc7"]]},{"id":"145bb7241738fde0","type":"server-state-changed","z":"a0b5a84d2201b052","name":"","server":"8a463abce940242c","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"counter.office_occupancy_trigger","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":"","forType":"num","forUnits":"seconds","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":260,"y":80,"wires":[["13f8724bdd2cad13"]]},{"id":"13f8724bdd2cad13","type":"gate","z":"a0b5a84d2201b052","name":"","controlTopic":"control","defaultState":"open","openCmd":"open","closeCmd":"close","toggleCmd":"toggle","defaultCmd":"default","statusCmd":"status","persist":false,"storeName":"memory","x":730,"y":120,"wires":[["728ab2c2ac674a50"]]},{"id":"acbdbdc42a58552b","type":"server-state-changed","z":"a0b5a84d2201b052","name":"","server":"8a463abce940242c","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_boolean.auto_lights","entityidfiltertype":"exact","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":"open","valueType":"str"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"control","valueType":"str"}],"x":240,"y":220,"wires":[["13f8724bdd2cad13"],["cfa0060e665ecbb9"]]},{"id":"cfa0060e665ecbb9","type":"change","z":"a0b5a84d2201b052","name":"Change Value To Close","rules":[{"t":"set","p":"payload","pt":"msg","to":"close","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":610,"y":220,"wires":[["13f8724bdd2cad13"]]},{"id":"8a463abce940242c","type":"server","name":"Home Assistant","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":"30","areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":": ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"default","statusTimeFormat":"h:m","enableGlobalContextStore":true}]