I don’t see that working because when you turn off the switch in HA it will disable the node and it won’t trigger on the switch.send_notifacation_garage state change event.
Interesting use from your post on Github with the traffic light. A possible change to those would be to swap out the traffic node and use a current-state node where you check the state of the exposed switch unless you’re turning on and off the traffic node from something off-screen. I have it on my todo list to create a node that does this exact use-case but I haven’t implemented it.
[{"id":"c5c37106.31bc6","type":"inject","z":"9ce184b.0f5bb78","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":256,"y":1520,"wires":[["1b39943.738206c"]]},{"id":"1b39943.738206c","type":"api-current-state","z":"9ce184b.0f5bb78","name":"","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"switch.test_event","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":482,"y":1520,"wires":[["ac14dc49.0c81c"],[]]},{"id":"bcc85509.194c78","type":"server-state-changed","z":"9ce184b.0f5bb78","name":"test_event","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"test_event","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":false,"x":252,"y":1568,"wires":[[]]},{"id":"ac14dc49.0c81c","type":"debug","z":"9ce184b.0f5bb78","name":"Send Alarm Alerts","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":730,"y":1520,"wires":[]}]
The scenario where I see exposed nodes being used is if you have a flow that is started by an event and you want to have the ability to disable it from the HA UI. Something like if you have a motion sensor that triggers a light turning on and off in the bathroom and for some reason you want the light to be a dumb switch now.
[{"id":"2cea436.7c324bc","type":"server-state-changed","z":"9ce184b.0f5bb78","name":"","version":1,"exposeToHomeAssistant":true,"haConfig":[{"property":"name","value":"bathroom motion"},{"property":"icon","value":""}],"entityidfilter":"sensor.bathroom_motion","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,"x":210,"y":1744,"wires":[["efb949c.4bd71b8","60777439.e2037c"],[]]},{"id":"efb949c.4bd71b8","type":"ha-wait-until","z":"9ce184b.0f5bb78","name":"","outputs":2,"entityId":"sensor.bathroom_motion","property":"state","comparator":"is","value":"off","valueType":"str","timeout":"5","timeoutUnits":"minutes","entityLocation":"","entityLocationType":"none","checkCurrentState":true,"blockInputOverrides":true,"x":460,"y":1792,"wires":[[],["ff66455d.a47be8"]]},{"id":"60777439.e2037c","type":"api-call-service","z":"9ce184b.0f5bb78","name":"","version":1,"debugenabled":false,"service_domain":"switch","service":"turn_{{payload}}","entityId":"switch.bathroom_light","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":680,"y":1744,"wires":[[]]},{"id":"ff66455d.a47be8","type":"change","z":"9ce184b.0f5bb78","name":"off","rules":[{"t":"set","p":"payload","pt":"msg","to":"off","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":610,"y":1792,"wires":[["60777439.e2037c"]]}]