Heos source selection

My receiver is a Denon AVR S650H with Heos.
I have a script to switch the receiver (and other hardware) to on and select a certain source to play internet radio. In fact I turn a greenwave powernode switch to on.
My code is:

alias: radio_luisteren_woonkamer
  - device_id: bfb5be90a2df4463878d2d13fff69521
    domain: switch
    entity_id: switch.greenwave_powernode_6_port_switch_5
    type: turn_on
  - data:
      source: 92.6 | NPO Radio 2 (Adult Hits)
    entity_id: media_player.living_room
    service: media_player.select_source
  - delay: 00:00:10

In the evening I watch TV and the receiver source switches to TV because of HDMI-SEC.
When going to bed I switch all multimedia devices off with the greenwave powernode.
When I turn on the script above in the morning the receiver is not playing the internet radio source.
I have to run the script again and then it is playing this source.
Is there a possibility to make this script play the right source without having to run it twice?

Pretty sure you got this sorted out in the meantime.
My guess is that the AVR is not ready to process your request as it is still booting up. Adding a delay between the powernode and the AVR could help. You would need to play around with the delay needed though, should not be much.
Best! J

- delay:
    seconds: 1