MY APPLE TV DOES NOT TURN ON/OFF WHEN I PRESS ON/OFF IN THE FRONTEND
That is correct; it only toggles the power state in Home Assistant. See the example above to use the home_hold command. This can be used on Apple TVs running tvOS 14.0 or later.
休眠
apple_tv_sleep:
alias: "Make the Apple TV sleep"
sequence:
- service: remote.send_command
target:
entity_id: remote.appletv
data:
delay_secs: 1
command:
- home_hold
- select
- service: media_player.turn_off
target:
entity_id: media_player.appletv
唤醒
alias: ATV auto on
description: ""
trigger:
- platform: state
entity_id: switch.tv
from: "off"
to: "on"
condition: []
action:
- service: remote.send_command
data:
command: wakeup
target:
entity_id: remote.appletv
mode: single