keepcalculator

06 Numbers and Powers

NFC Tag Home Assistant Automations That Work

Card No. 06·28061 · Updated · Standard formula, shown below

NFC tags give Home Assistant a reliable, physical trigger for automations that works offline, costs almost nothing, and responds in under a second. You tap a tag with your phone and a chosen action runs immediately—no app open, no voice command, no motion sensor needed. This article covers the automations that genuinely benefit from NFC, how to set them up, and the pitfalls that trip up most users.

Why NFC tags are a good fit for Home Assistant

Home Assistant already supports many triggers: motion sensors, schedules, device states, and voice assistants. NFC adds a deliberate, location-specific input. Unlike motion sensors, which fire on any movement, an NFC tag only reacts when someone intentionally taps it. This makes it ideal for actions that should happen only when a person is present and chooses to act—like arming the alarm when leaving or starting a coffee maker when entering the kitchen.

NFC also works entirely offline. The tag stores a simple identifier (a URL or text string) that your phone reads and passes to the Home Assistant app. No cloud service is involved, and the trigger is nearly instant. For comparison, a typical motion sensor may take 1–3 seconds to report, while a voice command can take 2–5 seconds including wake word and processing. An NFC tap is usually under 0.5 seconds.

Cost is another advantage. A pack of ten blank NFC tags (NTAG213 or NTAG215) costs a few dollars, and you can reuse the same tag for multiple automations by changing its payload. They are also small and unobtrusive—you can stick them behind a picture frame, under a desk, or on a nightstand.

How NFC automations work in Home Assistant

When you tap an NFC tag with your phone, the Home Assistant Companion app reads the tag and sends an event to your server. The event is tag_scanned, and it includes the tag’s ID (a unique hexadecimal identifier) and the payload (the text or URL stored on the tag). Your automations can listen for this event and trigger based on the tag ID or payload.

To set up a tag, you first need to write it. You can use the Home Assistant Companion app itself (it has a built-in tag writer) or any NFC writing app on your phone. The tag should contain a URL in the format https://myhomeassistant.example/tag/your_tag_id or simply a text string like my_tag_id. The ID is what you will reference in your automations.

Once the tag is written, you create an automation with a trigger of type tag, and set the tag_id to the ID you wrote. The automation can then perform any action: turn on lights, send a notification, start a script, or call a service. Here is a minimal example in YAML:

automation:
  - alias: "Tap to arm alarm"
    trigger:
      - platform: tag
        tag_id: "my_tag_id"
    action:
      - service: alarm_control_panel.alarm_arm_away
        target:
          entity_id: alarm_control_panel.home

You can also use the payload instead of the tag ID, but the ID is more reliable because it is unique to the physical tag and cannot be accidentally overwritten by another app.

Best automations for NFC tags

NFC tags shine in situations where you want a physical, intentional trigger. Here are the most practical uses, with concrete examples.

  • Arming/disarming the alarm: Place a tag near the front door. Tap to arm when you leave, tap again to disarm when you return. This is faster than typing a code and works even if you have no keypad.
  • Scene activation: A tag on your nightstand can trigger a “Goodnightâ€� scene that turns off all lights, locks doors, and sets the thermostat to sleep mode. A tag in the living room can activate a “Movieâ€� scene that dims lights and lowers the projector screen.
  • Routine timers: Tap a tag in the kitchen to start a 10-minute timer for cooking. The automation can send a notification when the timer ends, or even turn off the oven if you have a smart plug.
  • Guest access: Place a tag near the entrance with a payload that triggers a “Guest modeâ€� script: unlock the door for a limited time, turn on a welcome light, and send a notification to your phone.
  • Media control: A tag on your desk can pause/resume music or start a specific playlist. Tap it once to play, tap again to pause—the automation can toggle a media player.
  • Morning routine: A tag in the bathroom can trigger a “Morningâ€� scene: turn on the bathroom light, start the kettle, and read out the weather forecast via a speaker.

The key is to choose actions that benefit from being triggered by a deliberate touch. Avoid using NFC for things that happen automatically (like turning on lights when someone enters a room) because that is what motion sensors are for.

How to choose the right NFC tag

Not all NFC tags are the same. The two most common types are NTAG213 and NTAG215. NTAG213 has 144 bytes of user memory, which is plenty for a URL or short text. NTAG215 has 504 bytes and is often used for gaming figures, but the extra memory is rarely needed for Home Assistant. Both are read-only after you lock them, which prevents accidental overwrites.

When buying tags, check the size and adhesive. Smaller tags (like 25mm diameter) are easier to hide, but they have a shorter read range—typically 1–2 cm. Larger tags (like 50mm) have a longer range of 3–5 cm, which can be useful if you want to tap without precise alignment. Also consider the surface: metal surfaces interfere with NFC, so you need tags with a ferrite layer if you plan to stick them on a metal door or appliance.

For most Home Assistant users, a pack of NTAG213 tags with adhesive backing is sufficient. They cost a few dollars and work with any modern smartphone. Avoid cheap tags that claim to be “NFC� but are actually RFID—they are not compatible with phones.

Common problems and how to fix them

The most frequent issue is the tag not triggering. This usually happens because the phone’s NFC is off, or the Home Assistant Companion app is not set to handle tag scans. On Android, you may need to enable “NFC� in the app’s settings and ensure the app is set as the default handler for NFC tags. On iOS, you need to enable “NFC Tag Reading� in the Companion app’s settings, and the phone must be unlocked.

Another problem is the tag being read by the wrong app. If you have multiple NFC apps installed, the phone may ask which app to open. To fix this, set the Home Assistant app as the default for the tag’s URL scheme (https) or use a custom URL scheme like homeassistant:// which the app registers.

If the automation fires but the action doesn’t happen, check the tag ID. The automation must use the exact ID that the Companion app reports. You can find this in the Home Assistant logs under “tag_scanned� events. Also verify that the automation is enabled and that the entity or service you are calling exists.

Finally, some users report that tags stop working after a while. This is often because the tag was not locked and got overwritten by a stray NFC write, or the adhesive failed and the tag moved. Lock the tag after writing (most writing apps have a lock option) and use a strong adhesive if placing it on a frequently touched surface.

NFC vs. other trigger methods

NFC is not always the best trigger. Here is a quick comparison with alternatives.

  • Motion sensors: Best for automatic presence detection. They require no action from the user, but they cannot distinguish between different people or intentional actions.
  • Voice assistants: Good for hands-free control, but they require a wake word, are slower, and may not work in noisy environments. They also rely on cloud services, which can fail.
  • QR codes: Similar to NFC but require the camera app and a network connection to resolve the URL. They are slower and less reliable.
  • Physical buttons: Great for simple toggles, but they require wiring or a battery, and they are not as flexible as NFC for multiple actions.

NFC wins when you want a fast, offline, physical trigger that can be placed anywhere and reprogrammed easily. It loses when you need continuous presence detection or hands-free operation.

Costs and safety considerations

The cost of NFC tags is minimal—typically under $10 for a pack of ten. You also need a smartphone with NFC, which most modern phones have. There is no recurring cost, and the tags are passive, meaning they require no battery.

From a safety perspective, NFC tags are harmless. They emit no radiation and are safe to touch. However, be careful when using NFC for security-related actions like unlocking doors or disarming alarms. An NFC tag can be cloned if it is not locked, so always lock the tag after writing. Also, avoid placing tags in locations where they could be accidentally triggered, such as right next to a door handle where someone might tap it unintentionally. For high-security actions, consider adding a PIN or biometric check in the automation.

Frequently Asked Questions

Can I use any NFC tag with Home Assistant? Yes, as long as it is a standard NFC tag (NTAG, Mifare, etc.) and your phone can read it. The Home Assistant Companion app works with most tags, but NTAG213 and NTAG215 are the most reliable.

Do I need to buy a special NFC writer? No, you can write tags directly from the Home Assistant Companion app on your phone. No extra hardware is needed.

Can I use the same tag for multiple automations? Yes, you can write a payload that contains multiple identifiers, and then create automations that check the payload. However, it is simpler to use one tag per automation, or use the tag ID and have one automation that branches based on the tag ID.

Why doesn’t my tag work on iOS? On iOS, you must enable NFC Tag Reading in the Companion app settings, and your phone must be unlocked. Also, iOS may require you to hold the phone closer to the tag than on Android.

Can I use NFC tags to trigger automations when I’m away from home? No, NFC requires physical proximity. The tag must be within a few centimeters of your phone. For remote triggers, use geofencing or a button in the app.

Is it possible to lock an NFC tag? Yes, most writing apps have a “lock� option that makes the tag read-only. This prevents accidental overwrites and cloning. Lock the tag after you have written the correct ID.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →