Group nfc tags with helpers

Hi,

is there a way to create a group of the nfc tags with helpers or otherwise, so that in automations I can use this group for triggering. In case a new tag is added or removed I don’t have to edit varios automation, but rather just add or remove a tag from the group.

Thank you

You could add a Label to the tag entities, then use that in a Template condition:

triggers:
  - trigger: event
    event_type: tag_scanned
conditions:
  - alias: Test that the scanned tag has the desired label
    condition: template
    value_template: |
      {{ trigger.event.data.tag_id in label_entities("YOUR_LABEL_ID")
      | map('state_attr', 'tag_id') | list }}
actions:
....

good idea. I was thinking creatind a text file say tags.txt

tags: !include tags.txt

then in the condicion bit

  • conditions:
    - “{{ trigger.event.data.tag_id in tags }}”

The txt file for example

# All tags
      "12345567":
       name: "John"