Inserting shell script output into template messase

I am trying to make a notification with a shell script output. For example, when some door sensor fires, I’d like it also to sent a message via google hangouts. The script runs in shell and prints an url where the picture was uploaded - one line, I want this URL in the message. A nice thing would be a trigger id in the url. I managed to get as far as this :slight_smile:

  push_photos: "/mnt/sda/aik/s/hass/push {{ event_entity_id }}"


alias: Door
description: ''
  - type: opened
    platform: device
    device_id: 71aa4e24f888ddca22bd3fe8c53d9a55
    entity_id: binary_sensor.catflap_contact
    domain: binary_sensor
condition: []
  - service: shell_command.push_photos
      event_entity_id: {{ trigger.entity_id }}
  - data_template:
        - text: >-
            Cat  {{ trigger.entity_id }} {{as_timestamp(now()) |
            timestamp_custom('%-H:%M:%S') }}
        - name: HomeAssistantChat
    service: hangouts.send_message
mode: single

The problems are:

  1. cannot insert the script output to the hangouts message;
  2. cannot pass {{ trigger.entity_id }} to the script - when I save the automation, it replaces event_entity_id: {{ trigger.entity_id }} with '[object Object]': null so event_entity_id is {[object_Object]:None} inside the scrit but I can still use a static string.

Solvable? The shell script is python3 so in theory I could put it somewhere inside HA but really not sure if it makes the task easier.