Apple TV power on/off not working

I have recently deployed HAC, current version.
I use Apple TV 4K’s all on current version of TVOS 14.
The HA integration detects and configures them fine.

Only thing is the power on/off button via the remote does not work.
If I attempt to play something then HA does wake the ATV up, it can also detect that it is on or off but I am unable to manually turn it on or off from HA.
When it is on HA shows me what is playing and I can pause, forward and rewind.

I found a old thread about this but with no solution.
Any suggestions what the issue may be?

thanks

It is not implemented yet, it will come some time in the future.

Obviously same here everything is running fine …except the on off button. Thanks a lot for the plug-in, unfortunately for me the whole point was to get a proper power on/off of the appletv to be added in HomeKit scenes. (Homebridge plug-in are not working either for that).
Hope you’ll be able to add it soon I see pyatv being updated a lot … hoping hoping :slight_smile:
Best
Thomas

I found this thread when I was trying to figure out how to turn my Apple TV on and off from HA. A few threads said it couldn’t be done, but I could SEE that HA accurately reports when my Apple TV was in standby mode, or powered on (idle, playing, etc).

Anyways, I made the following two scrips that will only turn the ATV On if it’s off, and off when it’s on. This way it’s safe to call from scripts that turn the whole living room off. I can call “turn off Apple TV” when it’s already off and it won’t toggle it on.

alias: Living Room Apple TV On
sequence:
  - if:
      - "{{is_state('media_player.living_room', 'standby' )}}"
    then:
      - service: remote.send_command
        target:
          entity_id: remote.living_room_apple_tv
        data:
          delay_secs: 1
          command:
            - home
mode: single
icon: mdi:apple
alias: Living Room Apple TV Off
sequence:
  - if:
      - "{{ not is_state('media_player.living_room', 'standby' )}}"
    then:
      - service: remote.send_command
        target:
          entity_id: remote.living_room_apple_tv
        data:
          delay_secs: 1
          command:
            - home_hold
            - select
mode: single
icon: mdi:apple

4 Likes

Hi,

I tried your script and im getting attached error. Can you please help me on what i did wrong

Hi Scott,

works perfect, thanks for the code and idea

have a good one!

1 Like

Awesome, glad to hear it. Thanks for the note!

I had the same issue… realized that when you start to enter the script… you need to click on the three dots on the top left of the screen and “edit in yaml”. Then paste the script. Edit the alias and change the device to your device id’s and you are all set!

Thank you for creating this script @scottconnor

No problem, glad it was useful. Thanks for commenting that you used it. :slight_smile:

Love this! Thank you so much!

Thank you for this, this really helped solving this issue for me.

1 Like

Glad to hear it, thanks for commenting. Good luck!

1 Like

hi, i’ve apple tv 4k and tvos 17, but home_hold not work. and you?

I struggled with this for some time and found a better solution that seems to work for 4th Gen and up ATV’s. Basically I found that in order to use the media player entity commands to sleep/wake-up my ATV’s I had to make sure that the ATV remote entities were turned on. I couldnt find a reason to ever have them turned off, feel free to correct me. So I have an automation that runs if a remote entities state is set to “off”. Just to make it easy, the automation turns “on” all my ATV remote entites even if one is turned off. When the remotes are turned on, you can simply call the media_player.turn_on and .turn_off to control the power of my ATV’s.

Whenever I try to turn my remote entities state “on” it immediately turns it to the off position again…how did you set your automation to get past that? I’m having a hard time building an automation based on when I turn the ATV on/off from the physical remote. I find the state of the ATV is unreliable as well sometimes. It was triggering my off automation while I was watching a video haha

Not sure if this will work for others, but after getting by butt kicked for several hours I found you can just call the service to turn the Apple TV on and off discretely (see image below) - works like a charm.

Hopefully the developers will get the normal method corrected soon.