Automation multiple triggers that can do different actions based on state

I want to create an automation where turning my apple tv on/off turns my TV on/off. I could do this easily with two automations, but I’d like to do with a single one. Using the UI I can’t figure out how to trigger an action based on the state of the apple tv.

When the apple tv turns on the action should fire to turn the TV on and vice versa.

Would this be of any help?

2 Switches - 1 Light - Configuration - Home Assistant Community (home-assistant.io)

That’s how I kept multiple lights in sync.
If the AppleTV and the TV are on different domains, you can always (manually) replace
switch.turn_{{ trigger.to_state.state }}
with
homeassistant.turn_{{ trigger.to_state.state }}