Automation for turn off Apple TV after 1 hr when turned on

I am running HA 2021.6.3
I have integration setup for Apple TV, it shows two entities: 1. media_player.appletv entity. 2. remote.appletv

My Apple TV is connected to samsung TV with CEC so putting apple tv to sleep will turn off the TV and press menu button on apple tv remote will wake up and turn on TV.

The goal is to keep kids watching tv in control.
I want to write an automation where when the apple tv is turned on or start playing it should turn off after 1 hour.

I used the UI and created an automation it looks like this:

 alias: Apple TV Off after 1 hr
  description: ''
  - platform: device
    device_id: 117e9a59992b5394132d877612f5da3c
    domain: media_player
    entity_id: media_player.apple_tv
    type: playing
      hours: 1
      minutes: 0
      seconds: 0
      milliseconds: 0
  condition: []
  - type: turn_off
    device_id: 117e9a59992b5394132d877612f5da3c

but this does not work.
any idea?

  - wait_template: ''
    timeout: '01:00:00'
    continue_on_timeout: true
  -  ...

thanks for the code, i put it in the automation.
but what i notice is its not even triggering, from the automation page it shows last triggered that show it was triggered on Jun 5th thats 3 days ago, but the TV is been on many hours every day though.

You need to send remote control commands in order to turn off the AppleTV.

Using the commands home_hold and select should do the trick.