hi,
i am trying to get NFC tags running and automate based only on certain devices which scan the NFC tag - i have running a test setup where i can cath the tag_scanned event BUT despite the HA documentation which says…
To find your scanner’s device ID, open Developer tools → Events → Listen to events and subscribe to tag_scanned
. Then scan a tag on the reader and note down the device_id
from the data
section.
… i get an empty data[] like …
event_type: "tag_scanned "
data: {}
origin: LOCAL
time_fired: "2023-11-04T10:18:57.843205+00:00"
context:
id: 01HECXFJD93RJ1JJXY03FS0W7R
parent_id: 01HECXFJD8D865YPF0ZCMZRR7Y
user_id: null
how can i get the deviceID ??
cheerz from vienna
hmmmm…very weird … i tried again on the developer section → event listening page and now i get the device ID in the data section … strange but OK
now i am struggling with setting up proper automation to fire an action only when a certain deviceID read an NFC tag …
i assume this can be somehow done under the “conditions” section but i do not know how …
do i have to setup a template ?
cheerz
You add it via YAML in the tag trigger.
- platform: tag
tag_id: xxxxxxxxx
device_id: yyyyyyyyy
hmmm,
did this already
alias: Tag t3test is scanned
description: ""
trigger:
- platform: tag
tag_id: 33a3056e-cc72-41a4-87e0-baab8572e089
device_id: caf7d04012ffd49a1d299ec09c93e83e
condition: []
action:
- type: turn_on
device_id: 4bca0bfadc51b5fc4f03371863afc4f1
entity_id: 17daba063df14a7f787f3d8879415cfb
domain: light
mode: single
and tested with a different device … and it still triggered
Canaletto
(Lionel)
February 14, 2024, 9:26pm
5
Looks like a bug, the device_id
is not taken into account…