Trigger.entity_id doesn't work in Conditions with Blueprints

I try building my first Blueprint, and well… it’s not that easy i thought :smiley:

How can i work with the {{ trigger.entity_id }} in Choose / Conditions?

Whatever i try to use, it always gives me an Error like this when i want to use that Blueprint:

There is an error in this Blueprint: Failed to load blueprint: invalid key: “{‘trigger.entity_id’: None}” in “/config/blueprints/automation/development/target03.yaml”, line 46, column 0

My Testing Code looks like that:

trigger:
  - platform: state
    entity_id: !input enitities_to_get_triggered
condition: []
action:
  - service: notify.persistent_notification
    data:
      message: >-
        {{ trigger.entity_id }}
  - choose:
      - conditions:
          - condition: state
            entity_id: {{ trigger.entity_id }}
            state: "on"
        sequence:
          - service: notify.mobile_app_pixel_6a
            data:
              message: "Got the triggering entity_id"

Funnily enough, for the notify-Service above it works without any issues, and throws out the correct {{ trigger.entity_id }}

How can i use the entity_id that triggered the Automation, in Conditions?

Please go into the Blueprints Exchange - Home Assistant Community and look at other blueprints.That and reading the Docs is how I learned. You are welcome to copy anything I did if it will help you. (Hint, don’t see quotes around your condition template…)

Also, as someone that has written and shared over 20 BP’s with the community, you should always write an automation or script first before you turn that into a BP. Otherwise you are fighting the automation/script logic and the BP logic with error log clues as to what is what to fix first.

Just advice, take it as you will…

1 Like

Fair enough. While i personally, when seeing ‘dumb/basic’ Questions just give the quick answer, i get the Idea “well, if he/she doesn’t know that there gonna be tons of follow-ups”.

Anyway, i really appreciate your friendly, non-harsh words. And as simple and basic your general Advice is:

the valuable it is. I followed that, and already solved this, and another Hand full of Problems :slight_smile:

1 Like