Pass arguments to shell_command on event

Hey @jamie,

Care to share your final code?
I’m struggling to retrieve the entity_id…
Here is my code:

Automation

- alias: Set Chromecast Radio Picture
  trigger:
    - platform: state
      entity_id: media_player.kitchen
      to: 'playing'
    - platform: state
      entity_id: media_player.bedroom
      to: 'playing'
    - platform: state
      entity_id: media_player.house
      to: 'playing'
    - platform: state
      entity_id: media_player.downstairs
      to: 'playing'
    - platform: state
      entity_id: media_player.onkyo
      to: 'playing'
  action:
  - service: shell_command.chromecast_radio_picture
    data_template:
      my_media_player: '{{ trigger.event.data.entity_id }}'

shell_command:

chromecast_radio_picture: '/home/cctv/.homeassistant/shell_scripts/ChromeCast_Radio.py "{{ my_media_player }}"'