Hey, can't for the life of me how to get a blueprint to work allowing a selector to select a list of NFC tags to trigger on. What am I doing wrong? I added a selector and it shows the list of tags in the blueprint but never fires on them. I've tried like 20 different ways and can't seem to get it to work. I want a blueprint to only fire if a specific user scans it.
blueprint:
name: User Specific NFC Tag Action
description: Run action when selected users scanned an NFC tag
domain: automation
author: joshs85
input:
tags:
name: Tags
selector:
target:
entity:
- domain:
- tag
users:
name: Users
selector:
target:
entity:
- domain:
- person
action:
name: Action
selector:
action: {}
variables:
tags: !input tags
users: !input users
user_id: "{{ trigger.context.user_id }}"
tag_id: "{{ trigger.event.data.tag_id }}"
tag_ids: "{{ expand(tags.entity_id) | map(attribute='attributes.tag_id') | list }}"
user_name: "{% set p = states.person | selectattr('attributes.user_id', 'eq', user_id) | list %}{{ p[0].attributes.friendly_name if p | count == 1 else 'unknown' }}"
triggers:
- trigger: tag
tag_id: >
{% set tag_ids = expand(tags.entity_id) | map(attribute='attributes.tag_id') | list %}
{{ tag_id in tag_ids }}
condition:
condition: template
value_template: >
{% set user_ids = expand(users.entity_id) | map(attribute='attributes.user_id') | list %}
{{ user_id in user_ids }}
action: !input action
mode: parallel
max: 10