Trigger variable empty in Automation Template

Hi,

I’m trying to create a notification when in winter a window is open for a longer period of time. I’ll try to dynamically set the notification message to include the entity_id but the trigger variable seems to be undefined.

alias: Fenster auf (Generic)
description: Sends a notification if a window is open for a longer period of time in winter
trigger:
  - platform: state
    entity_id: binary_sensor.zb1c_window
    to: 'on'
    for: '00:15:05'
    from: 'off'
  - platform: state
    entity_id: binary_sensor.zb2_c_bo_window
    from: 'off'
    to: 'on'
    for: '00:15:05'
condition:
  - condition: numeric_state
    entity_id: sensor.openweathermap_temperature
    below: '15'
action:
  - service: notify.mobile_app_inspektor_gadget
    data:
      message: "Close open Window: {{ trigger.entity_id }}"
mode: restart

Any help is appreciated?

Thanks,

Robert

Did you trigger the automation manually using the UI? As documented here, in that case the trigger object will be empty / non-existent.

2 Likes

Thanks a lot. Sorry my fault. Of course I was testing triggering it manually.