Automation.trigger is not appearing correctly in developer services

I have two automations that should fire when a door locks:

  • id: front_door_unlocked
    alias: Front Door Unlocked
    trigger:
    entity_id: lock.schlage_be469_touchscreen_deadbolt_locked_2
    platform: state
    to: unlocked
    action:
    • service: automation.trigger
      entity_id: automation.sync_foo
    • service: automation.trigger
      entity_id: automation.front_door_custom_timer

The second automation is indeed working, as I can see my timer start. However, sync_foo doesn’t appear to fire. When I go to the developer services and select automation.trigger I see the following entity: automation.sync_front_door_input_boolean_to_foo which is an old ID that is no longer used in any of my scripts. When I fire that in devleoper services, it appears to work.

  • id: sync_foo
    alias: Sync front door input boolean to foo
    trigger:
    action:
    service_template: >
    {%- if is_state(‘lock.schlage_be469_touchscreen_deadbolt_locked_2’, ‘locked’) -%}
    input_boolean.turn_on
    {%- else -%}
    input_boolean.turn_off
    {%- endif -%}
    entity_id: input_boolean.frontdoor

It seems sync_foo isn’t firing from my script, probably for the same reason I’m seeing the incorrect ID in developer services. What’s going on?

The id field in the automation is only there for the UI editor.

The entity_id is derived from the alias.

automation.sync_front_door_input_boolean_to_foo is the correct entity_id you should be triggering.

the reason the first one works is because the alias is the same as the id. it’s actually using the entity_id created from the alias not the id.

And it really will probably help in the future to properly format the code you post:

1 Like

So if I specify an alias, there is no need to specify an ID?

The only time you need an id is if you’re planning on using the UI editor.

If you’re not using the UI editor you do not need an id field in your automations.