I would like to turn on my Apple TV when a smart outlet is turned on, so that my TV automatically turns on when I tell Alexa “Alexa outlet on” for example.
How long? HA should be reacting as soon as states are updated, but there’s nothing that can be done if the switch itself is taking a long time to report it’s state.
It might be a silly question, but you’re not just talking about the 25 second delay you’ve included, right? Because, if the socket is reporting it’s state immediately and the service call turns on the TV immediately, there’s no reason the automation shouldn’t complete in no more than a few seconds. And the trace you shared shows the automation taking 25.01 seconds, which is mostly your delay action.
I think my TV is the problem. The TV can only be switched on quickly directly with its own TV remote control. I also wanted to fix this problem with Android TV, but it doesn’t work. I thought with the Apple TV it works better.
I have solved it otherwise. I leave the TV on. By changing the state of the Apple TV to standby, I make the power outlet turn off.
When I turn on the power outlet, it turns on the Apple TV. Since the TV is still on, I don’t need a power on command.
Works fine so far.
Another question. Can I start the Apple TV with a specific app for example Plex?