I want to make a “virtual” switch that gets its states from an actual switch but runs scripts when “toggled”. I tried using tap_action on the switch entity row but that only works when the name is tapped and not when the toggle is tapped. So now I think my best option is a Template Switch.
The docs have an example on how to copy a switch but it is incomplete. When the original switch becomes unavailable nothing happens to the “copied” switch. There is an availability_template setting but what should I put in there to copy the availability of the original switch?