AppleTV is not responding on commands

Hello %,

first of all thanks for the many guides and answers available on this forum. It already helped me a lot.

I’m currently trying to create a dashboard working as a remote for my AppleTV. I found several tutos for I’m trying to do including some post on this forum. Unfortunately whatever I do, my AppleTV is not reacting to any action.

Do you see any way to debug that? Is there any log I could check to see what happen? I don’t know currently if my script is wrong or if it the appletv which does not take the actions in account.

Here the look&feel of what I try to do:

What seems to be sure is that the link between home assistant and the appletv is somehow working because when a start something manually on the appletv I can pause it with the top media player integration.

Here are the scripts behind the different buttons:

bash-5.1# cat appletv.yaml
appletv_command:
  alias: "Send command to appletv"
  fields:
    command:
      description: "The command to send to the remote"
    sequence:
      - service: remote.send_command
        target:
          entity_id: remote.sejour
        data:
         command: "{{ command }}"
    default: []
  mode: single


appletv_wakeup:
  alias: "WakeUp AppleTV"
  sequence:
    - service: script.appletv_command
      data:
        command: wakeup
  mode: single

appletv_up:
  alias: "Apple TV Arrow Up"
  sequence:
    - service: script.appletv_command
      data:
        command: up
  mode: single

appletv_volumeup:
  alias: "Apple TV Volume Up"
  sequence:
    - service: script.appletv_command
      data:
        command: volume_up
  mode: single

appletv_left:
  alias: "Apple TV Arrow Left"
  sequence:
    - service: script.appletv_command
      data:
        command: left
  mode: single

appletv_ok:
  alias: "Apple TV Arrow OK"
  sequence:
    - service: script.appletv_command
      data:
        command: select
  mode: single

appletv_right:
  alias: "Apple TV Arrow Right"
  sequence:
    - service: script.appletv_command
      data:
        command: right
  mode: single


appletv_topmenu:
  alias: "Apple TV Top menu"
  sequence:
    - service: script.appletv_command
      data:
        command: top_menu
  mode: single


appletv_down:
  alias: "Apple TV Arrow Down"
  sequence:
    - service: script.appletv_command
      data:
        command: down
  mode: single

appletv_volumedown:
  alias: "Apple TV Volume Down"
  sequence:
    - service: script.appletv_command
      data:
        command: volume_down
  mode: single

Any idea on what could be wrong or where I could trace it is more than welcome.

Many thanks

The command must be a list, like this:

appletv_command:
  alias: "Send command to appletv"
  fields:
    command:
      description: "The command to send to the remote"
    sequence:
      - service: remote.send_command
        target:
          entity_id: remote.sejour
        data:
         command:
           - "{{ command }}"
    default: []
  mode: single

Hi Postlund,
thanks for the remark. Makes sense :+1:

I changed but it seems not to be suffisant :frowning:

I tried to call the service remote.send_command from the developer mode and I do have the same behaviour…nothing happens.

Then you should check the log under Configuration → Logs`, hopefully there’s something there.

Hi,

so I searched during several hours and here several outputs:

  1. My scripts integration in configuration.yaml was probably not working properly.
    I adjusted it to get all yaml files from my folder scripts loaded

  2. I saw some other posts advising to delete the integration and re-add it again

On second point I have now an issue. I run the delete which seems to have worked.
Now when I go in integration and run an Add Integration, the integration of the AppleTV fails with a message:

The configuration for this device is incomplete. please try adding it again

I want into .storage and check in core.config_entries and did not find any remaining entries for the appletv.

Make sure to install the beta component:

Won’t work without it when you have upgraded to tvOS 15.

Seems to be for hass. I use Home Assistant running on Docker. Will it work too?

Yeah, it will work.

So I integrated the latest version of the component under /config/custom_components/apple_tv

I restarted Home Assistant and tried the integration import again. It still fails with the same error message.
So I activated the debug log. Here the output:

home-assistant.log:2021-10-04 22:23:57 DEBUG (MainThread) [pyatv.support.http] Got HTTP response: HttpResponse(protocol=‘HTTP’, version=‘1.1’, code=200, message=‘OK’, headers={‘date’: ‘Mon, 04 Oct 2021 22:23:57 GMT’, ‘content-length’: ‘116’, ‘content-type’: ‘application/x-apple-binary-plist’, ‘server’: ‘AirTunes/566.25.43’}, body=b’bplist00\xd2\x01\x02\x03\x04SepkWauthTagO\x10 \xdcW)\x81\xc2T\xe2\x8f\xd6\x06\x1b8\x99\xa6\x13\x958\x10\xce\x85g\x99P\xfe\xbfM\x19\x95\x8e\xcb\xf8qO\x10\x10h\xa5v\xd7\x14"\xd14d\x8d\xdc\x8e\xff\xd7\xd4\xa2\x08\r\x11\x19<\x00\x00\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00O’):
home-assistant.log.1:2021-10-04 22:06:45 ERROR (SyncWorker_0) [homeassistant.loader] Error parsing manifest.json file at /config/custom_components/apple_tv/manifest.json: Expecting value: line 7 column 1 (char 6)

@postlund

Pierre,

Will your latest Apple TV integration changes to support tvOS 15 be included in the upcoming 2021.10 release of Home Assistant?

Thank you for all of your work on this integration!

It is not ready yet, so it will not. There are some important bugs left and tests to update.

1 Like

Please let us know here when this is back in main and functional. I had a couple of automations that depended on the state of the ATV mediaplayer.

It will be part of the next release in beginning of February. Most parts are already merged, it’s bug squashing and improvements to the experience that is happening now.

2 Likes