Automation turn on ps4 when harmony activity get triggered slow

Hello,

So I’m learning a lot in the last few days/hours. I’m transitioning from ioBroker to Home Assistant.

In ioBroker I had a script which turns on my PS4 when a harmony activity gets turned on. This took about 3 seconds to trigger and then I heard the beep sound of the PS4 indicating to boot/start.

Now I Integrated the harmony hub and also the PS4 into HA. Everything good so far. From the UI everything works fine.

I found an automation from @SeanM from this Post.
And here is the Pastebin Link he posted, the automation is on the bottom of the file.

But it is really slow and takes about 30 Seconds to start. It feels like nothing is happening and after 30 seconds I hear the beep from the PS4 when she boots.

First Version
- alias: PS4 On When Harmony Activity Started
    hide_entity: true
    initial_state: 'on'
    trigger:
      - platform: state
        entity_id: remote.harmony_hub
        to: 'on'
    action:
      - service: media_player.turn_on
        entity_id: media_player.playstation_4

I also tried to write it diffrently so it only starts with aspecific harmony activity when the switch for the harmonys state changes.

Second Version
- alias: PS4 On When Harmony Activity Netflix Started
    hide_entity: true
    initial_state: 'on'
    trigger:
      - platform: state
        entity_id: switch.netflix
        to: 'on'
    action:
      - service: media_player.turn_on
        data_template:
          entity_id: media_player.playstation_4
          source: 'Netflix'

I then thought maybe the additional step of the switch makes it slow so I tried it this way:

Third Version

`

- alias: PS4 On When Harmony Activity Netflix Started
    hide_entity: true
    initial_state: 'on'
    trigger:
      - platform: template
        value_template: "{{ is_state_attr('remote.harmony_hub', 'current_activity', 'Netflix') }}"
    action:
      - service: media_player.turn_on
        data:
          entity_id: media_player.playstation_4
          source: 'Netflix'

So now I am wondering why these automation take so long to trigger? How can I minimize this?

When I use the dev tools and call the turn_on service for the ps4 it starts immediatly.
So the connection shouldn’t be the problem. I’m certain it is the automation trigger but why and how a I can fix it I have no idea.

Does somebody have an idea how I can troubleshoot? or does my automation suck?

Please help me

Best

Noah