Automation/script advice

I would definitely say the trigger to trigger id is a convention because you assign something that differs from what it was. Anyhow, you can get rid of a conversion (no matter if you call it the second conversion or the only conversion), just use the notification id as trigger id

  alias: Identify wash person
  trigger:
  - id: 'mobile_app_nokia_3_2'
    platform: event
    event_type: flic_click
    event_data:
      button_name: flic_80e4da786aa8
      click_type: single
  - id: 'mobile_app_abc'
    platform: event
    event_type: flic_click
    event_data:
      button_name: flic_abc123
      click_type: single
  - id: 'mobile_app_whatever'
    platform: event
    event_type: flic_click
    event_data:
      button_name: flic_xyz789
      click_type: single
   action:
  - service: input_text.set_value
    target:
      entity_id: input_text.notify_wash
    data:
      value: "{{ trigger.id }}"

But all in all, you don’t need an extra conversion from the version you posted, you just need to move the template if-statement to the second automation and store the triggerid, which you can make the (reabable) name like you already did.

That’s a low bar for defining “conversion” and implies that a State Trigger that triggers when the state goes “on” but its action sets something to "off’ is performing a “conversion”.

Semantics aside, I do like your version better, even though it makes the triggers a bit less self-evident (because id no longer bears the person’s name) … and it “converts” a button action to an input_text value. :wink:

1 Like