Skip to content

Let phones tap the NFC-1 (card emulation)

Difficulty: Level 1

With card emulation on, your Apollo NFC-1 acts like an NFC tag. Tap a phone on it and the phone opens a link you choose. By the end of this guide, the NFC-1 shares your link with most unlocked phones that have NFC turned on, and still reads your tags in between.

Before you start

  • Add your NFC-1 to Home Assistant first. The getting started guide walks you through it.
  • Have the link you want to share ready. It can be up to 120 characters.

What you can do with it

  • Guest Wi-Fi page: Share a web page with your guest Wi-Fi details, so visitors tap instead of typing.
  • Menu or info page: Point guests to a menu, house rules, or a welcome page.
  • Home Assistant tag: Use a Home Assistant tag link, so Android phones with the Home Assistant app open the app when they tap. See Use a Home Assistant tag link below.

Turn on card emulation

1. Open your NFC-1 in Home Assistant: go to Settings → Devices & services → ESPHome and select it.

Open your Home Assistant instance and show an integration.

2. Under Configuration, type your link into Emulation URL, then press Enter (or tap outside the box on a phone). The box keeps your link.

  • You can leave off https://. The NFC-1 adds it for you, so example.com becomes https://example.com.
  • Emulation URL is separate from Write URL. Changing one never changes the other.

NFC-1 Configuration card with Card Emulation turned off and Emulation URL set to https://apolloautomation.com

3. Under Configuration, turn on Card Emulation.

4. Check Last Operation under Sensors. It shows Emulating: tap an unlocked phone.

5. Unlock a phone, check that NFC is on in its settings, and hold the back of the phone flat on the NFC-1.

When the phone reads the link, the LED flashes cyan (light blue) and the buzzer beeps twice (if LED Feedback and Buzzer are on), and Last Operation shows Emulated tag read by phone. The phone opens your link.

Card Emulation stays on after a restart, so you only set it up once.

What the phone needs

  • The screen is unlocked.
  • NFC is turned on in the phone's settings.

If the phone is locked, the NFC-1 tries again about 10 seconds later, up to two more times, while the phone stays on the reader. If it still doesn't open, lift the phone, unlock it and tap again.

Phones are never treated as tags

Phones send a new, random ID number each time they tap, so the NFC-1 never counts a phone as a tag scan. Phone Present (under Sensors) turns on while a phone is on the reader. Learn more in How the NFC-1 handles phones.

Reading and emulating at the same time

You don't have to choose between reading tags and sharing a link. With Card Emulation on, the NFC-1 switches back and forth between reading tags and acting as a tag.

  • Your tags still scan and run automations as usual.
  • The first time a phone shows up, the NFC-1 pauses tag reading for up to about 5 seconds (less if the phone reads the link sooner), then goes back to reading tags.
  • If a tag is resting on the NFC-1 during that pause, the NFC-1 still counts it as present. It won't report the tag as removed or scan it a second time.
  • Tap the phone again later and it gets the link again.

Reader Listen Only turns on briefly when a phone taps

With Tag Polling on, Reader Listen Only also turns on for a few seconds each time the NFC-1 pauses for a phone. That's normal. Tag Polling stays on.

Act only as a tag (listen only)

In listen-only mode, the NFC-1 waits for phones and never reads tags. To use it, turn off Tag Polling. The NFC-1 then works purely as an NFC tag.

Home Assistant hides Tag Polling by default, so turn it on first:

1. On the NFC-1 device page, under Configuration, select the entities not shown line, then select Tag Polling.

2. Select the gear icon, turn on Enabled, and select Update.

3. Wait about 30 seconds until Tag Polling shows on the device page.

4. Turn off Tag Polling.

5. Check Reader Listen Only under Diagnostic. It turns on while Card Emulation is on and the NFC-1 is not reading tags.

While Tag Polling is off, the NFC-1 reads no tags and doesn't notice phones, so Phone Present stays off. Phones can still read your link. Turn Tag Polling back on to read tags again.

Set Emulation URL to a Home Assistant tag link, like https://www.home-assistant.io/tag/your-tag-id. Find the tag ID under Settings → Tags in Home Assistant, or make up your own ID.

HA App Record adds a hint that tells Android phones to open the Home Assistant app. It's on by default.

HA App Record is under Configuration. It only applies to Home Assistant tag links. Any other link opens normally, whether the switch is on or off. Changing the switch updates emulation right away.

Each time a phone reads the whole link, the NFC-1 gives you feedback:

Where What you see
LED One cyan (light blue) flash
Buzzer Two quick high beeps
Last Operation Emulated tag read by phone
NFC Event Shows the event type emulated_tag_scanned

Use the emulated_tag_scanned event to start an automation, for example to log each guest tap. See Automations and actions. To change or silence the cues, see LED and buzzer.

Type a new link into Emulation URL. While Card Emulation is on, the NFC-1 switches to the new link right away. You don't need to turn emulation off and on.

Automations can change the link too with the esphome.apollo_nfc_1_xxxxxx_set_emulation_url action. See Automations and actions for what replaces xxxxxx. It sets the link but doesn't turn Card Emulation on.

Turn off card emulation

Under Configuration, turn off Card Emulation. Last Operation shows Emulation off, and phones no longer get your link. Your Emulation URL is kept for next time.

Troubleshooting

Problem What to do
Phone does nothing when tapped Unlock the phone and check that NFC is on. Hold the back of the phone flat on the NFC-1 for a few seconds. Make sure Card Emulation is on and Last Operation showed Emulating: tap an unlocked phone.
Phone shows a card or payment screen instead of the link Lift the phone away, unlock it, and tap again, holding it still. If it keeps happening, turn off Tag Polling so the NFC-1 acts only as a tag (see Act only as a tag).
Last Operation shows Emulation off: Emulation URL is empty Card Emulation was turned on without a link. Type a link into Emulation URL, then turn on Card Emulation again.
Last Operation shows Emulation failed to start Emulation didn't start on the NFC chip. Turn Card Emulation off and on. If it still fails, check that NFC Reader under Diagnostic shows Connected, then restart the NFC-1.
Card Emulation turns itself back off The switch turns off when emulation can't run. Check Last Operation and follow the matching row above.

Next step: run automations from taps

Your NFC-1 now shares a link with phones that tap it. Next, start automations from tag scans and phone taps, and change the link from an automation.

Automations and actions

Join our Discord if you need more help!