Make switch entity follow boolean

Hi,
I have a switch entity via the shelly integration, what is the best way to make the switch entity follow the state of an input_boolean.
an automation? with choose to turn the switch off or on depending on the state change?
or is there a better way e.g. overwrite the switch entity to change it to a template?

Cheers

Using the choose action or a template with trigger variables are both valid options.

Why do you want to do this?

there is a boolean that tracks the state of a postbox. a zwave doorsensor installed in the postbox sets the boolean to on (and to set it to off (= postbox emptied) I use the HA Gui.
since the sensor of the postbox can trigger multiple times because letters could be inserted one by one - I use the boolean like a latch. so the automation for the postbox sensor only changes the state of the boolean and the automation that sends me a push notification tracks the boolean change (so I only get a notification once).
now I want to create a “notification led” that is switched via a shelly at the backdoor so I can see if something is in the postbox or not. so I would like this shelly switch to “follow” the state of the postbox boolean. so it turns off automatically if the boolean is “reset” either via the GUI or other means.
I have implemented a choose version now… how would your other suggestion look like?