How can i make an automation where i can double scan my nfc tag, means if i scan it once it will toggle my lights, and if i double scan it it will toggle my fan.
@lets-automate10 ай бұрын
NFC tags are a little slow to scan, so it probably wouldn't be ideal to need to scan one twice to trigger something. Given they are so cheap I would probably instead have 2 tags, 1 for the light and 1 for the fan. However, if you did want to experiment the way I can think of at the moment is to have the nfc tag as an automation trigger, and then as an "action" use "wait for trigger" and then put the nfc tag again as a trigger there. That way, it would need to be scanned twice before the final action being triggered. I *think* that would work. (You would want to ensure the automation is in single mode, which it is by default)
@mikeselltgmail6 ай бұрын
Great rundown of NFC tags! I recently bought some, but I have yet to do anything with them, so this video helps give me some ideas and helps me understand how to do it. Quick question about something like a door unlock as you shown at the end. Is there any way in HA to log who scanned the tag, or is that not an option? I have a family of 6, and all but one of us have a smartphone. It would be nice to know who unlocked the door (by scanning the NFC tag) and at what time. I think I could do it with a tag for each user, but I'd rather not have to have 6 different NFC tags.
@lets-automate6 ай бұрын
Good to hear! I like NFC Tags because they are a cheap way of automating a lot of different things. In answer to your question... Yes! You can use "device_id" from the trigger payload. This identifies the device, which should be good to use for what you want. There is also a "user_id" field, which I guess is unique per HA user, although I haven't verified that one.
@mikeselltgmail6 ай бұрын
@@lets-automate Thanks for the quick reply! I will try it out with a test tag and see what info is configurable and comes through with a scan. Also, I don't have a smart lock yet. Is there one you recommend that works well with HA? I really like the idea of smart locks for functionality and automations, but it seems there are a lot out there that either don't work well with HA or have security concerns.
@lets-automate6 ай бұрын
I wouldn't like to recommend one really, because I have only used the SwitchBot retrofit lock, which does a good job. But it depends on your door type too and whether you want integrated or not. There will likely be more coming out this year too, so might be worth waiting a little.