Examples: NFC Tags - ad-ha/kidschores-ha GitHub Wiki
Version: v0.5.0 Difficulty: Intermediate Prerequisites: Home Assistant Companion App with NFC support
Enable kids to quickly claim chores by scanning NFC tags placed near chore locations (pet feeding station, bedroom, kitchen). No dashboard interaction required - just tap the phone to the tag.
What You'll Learn:
- Setting up NFC helper sensor for user tracking
- Creating basic NFC chore claim automation
- Time-based chore selection (AM/PM chores)
- Logbook integration for accountability
Note
This is NOT a built-in KidsChores feature but a tested integration pattern using Home Assistant's native NFC capabilities.
- NFC tags (NTAG213/215/216 recommended)
- Home Assistant Companion App on kid's device
- User accounts for each kid in Home Assistant
Each Home Assistant user has a unique alphanumeric ID required for tracking:
- Navigate to Settings → People → Users
- Click each user to view their profile
- Copy the User ID from the top of the dialog (long alphanumeric string)
- Store these IDs - you'll need them for the helper sensor
Example User ID: 9999999953eb45019c0f3e0811111111
This sensor translates user IDs into readable names for logging and tracking.
Add to configuration.yaml or template file:
template:
- trigger:
- trigger: event
event_type: tag_scanned
sensor:
- name: NFC Last Scan By
state: >
{% set user_map = {
"9999999953eb45019c0f3e0811111111": "Sarah",
"9999999953eb45019c0f3e0822222222": "Alex",
"9999999953eb45019c0f3e0833333333": "Mom",
"9999999953eb45019c0f3e0844444444": "Dad"
} %}
{% set user_id = trigger.event.context.user_id %}
{{ user_map.get(user_id, 'unknown') }}What This Does:
- Listens for NFC tag scans
- Maps Home Assistant user IDs to friendly names
- Creates
sensor.nfc_last_scan_bywith the user's name
Configuration Steps:
- Replace the User IDs with your actual Home Assistant user IDs
- Replace the names with your kids' names (must match KidsChores kid names)
- Save and restart Home Assistant
- Verify sensor appears: Developer Tools → States → search "nfc_last_scan_by"
Use Case: Kid scans tag on litter box → chore automatically claimed.
Physical Setup:
- Stick NFC tag on/near litter box
- Register tag in Home Assistant Companion App
- Note the Tag ID (you'll need this for the automation)
Automation:
alias: "NFC: Clean Litter Box"
description: "Claim litter box chore when NFC tag scanned"
triggers:
- tag_id: 059701cb-9096-40d3-be04-59c112345678 # ⚠️ Replace with your NFC tag ID
trigger: tag
conditions: []
actions:
- variables:
claim_button: button.sarah_kidschores_chore_claim_clean_litter_pm # ⚠️ Replace with your button entity
- action: button.press
target:
entity_id: "{{ claim_button }}"
- wait_for_trigger:
- trigger: state
entity_id:
- sensor.nfc_last_scan_by
timeout:
seconds: 5
- action: logbook.log
data:
name: Clean Litter Box
message: "Claimed by {{ states('sensor.nfc_last_scan_by') }}"
entity_id: "{{ claim_button }}"
mode: single| Field | What to Change | Example |
|---|---|---|
tag_id |
Your NFC tag's unique ID (from Companion App registration) | 059701cb-9096-40d3-be04-59c112345678 |
claim_button |
Button entity for the chore (check Developer Tools → States) | button.sarah_kidschores_chore_claim_clean_litter_pm |
name in logbook.log |
Friendly chore name for logbook | Clean Litter Box |
- Go to Developer Tools → States
- Search for:
button.kc_<kid_name>_chore_claim_ - Find your chore in the list
- Copy the full entity ID
Workflow:
- Kid scans NFC tag
- Automation presses claim button
- Waits for NFC sensor to update (5 sec timeout)
- Logs entry: "Clean Litter Box: Claimed by Sarah"
Use Case: Single NFC tag on pet food station → claims AM or PM feeding chore based on time of day.
Physical Setup:
- Place NFC tag near pet feeding station
- Register tag in Companion App
- Create separate AM and PM chores in KidsChores
Automation:
alias: "NFC: Feed Cat (AM/PM Auto-Select)"
description: "Claim AM chore before noon, PM chore after noon"
triggers:
- tag_id: 0b3b18f7-0c99-4f19-9d17-d114ccf87799 # ⚠️ Replace with your NFC tag ID
trigger: tag
conditions: []
actions:
- variables:
claim_button: >-
{% if 2 <= now().hour < 12 %}
button.sarah_kidschores_chore_claim_feed_cat_am # ⚠️ Replace with AM button entity
{% else %}
button.sarah_kidschores_chore_claim_feed_cat_pm # ⚠️ Replace with PM button entity
{% endif %}
- action: button.press
target:
entity_id: "{{ claim_button }}"
- wait_for_trigger:
- trigger: state
entity_id:
- sensor.nfc_last_scan_by
timeout:
seconds: 5
- action: logbook.log
data:
name: Feed Cat
message: >-
{{ "AM" if 2 <= now().hour < 12 else "PM" }} chore claimed by {{ states('sensor.nfc_last_scan_by') }}
entity_id: "{{ claim_button }}"
mode: single| Time Range | Chore Claimed | Reason |
|---|---|---|
| 2:00 AM - 11:59 AM | AM chore | Morning feeding window |
| 12:00 PM - 1:59 AM | PM chore | Afternoon/evening feeding + overnight fallback |
Why 2 AM Start?: Prevents late-night scans (12 AM - 2 AM) from triggering morning chore. Adjust if needed:
{ % if 6 <= now().hour < 12 % } # Stricter: only 6 AM - noon triggers AM chore| Field | What to Change | Example |
|---|---|---|
tag_id |
Your NFC tag ID | 0b3b18f7-0c99-4f19-9d17-d114ccf87799 |
button.sarah_kidschores_chore_claim_feed_cat_am |
AM chore button entity | Your specific button entity |
button.sarah_kidschores_chore_claim_feed_cat_pm |
PM chore button entity | Your specific button entity |
Time condition (2 <= now().hour < 12) |
Adjust AM/PM cutoff if needed | Change 2 to 6 for stricter morning |
Use Case: Shared chore (e.g., "First to Feed Dog") - any kid can scan to claim.
Automation:
alias: "NFC: First to Feed Dog (Shared First)"
description: "Claim shared chore for whoever scans first"
triggers:
- tag_id: your-tag-id-here
trigger: tag
conditions: []
actions:
# Get the kid name from NFC sensor
- variables:
kid_name: "{{ states('sensor.nfc_last_scan_by') }}"
claim_button: "button.kc_{{ kid_name | lower }}_chore_claim_feed_dog"
# Verify kid name is valid (not 'unknown')
- condition: template
value_template: "{{ kid_name not in ['unknown', 'unavailable', 'none'] }}"
# Press claim button
- action: button.press
target:
entity_id: "{{ claim_button }}"
# Log the claim
- action: logbook.log
data:
name: Feed Dog
message: "Claimed by {{ kid_name }} (Shared First)"
entity_id: "{{ claim_button }}"
mode: singleRequirements:
- NFC helper sensor configured with all kids' names
- Chore must be set to "Shared First" completion criteria
- Button entity IDs must follow pattern:
button.kc_{kid_name}_chore_claim_{chore_name}
Cause: User ID not in NFC helper sensor map.
Solution:
- Check if user scanned with correct device (must have Home Assistant app)
- Verify user ID in helper sensor matches user's actual ID
- Check for typos in user ID (alphanumeric, case-sensitive)
Cause: Button entity ID incorrect or chore not assigned to kid.
Solution:
- Verify button exists: Developer Tools → States → search for button
- Check kid is assigned to chore in KidsChores configuration
- Ensure chore is in
pendingstate (not already claimed/approved)
Cause: wait_for_trigger timeout or sensor not updating.
Solution:
- Increase timeout to 10 seconds
- Test NFC helper sensor manually: scan tag, check States view
- Restart Home Assistant if sensor stuck
Cause: Time logic boundary issue or timezone mismatch.
Solution:
- Check Home Assistant timezone: Settings → System → General
- Adjust time boundaries in template (change
2to6for stricter AM) - Test at boundary times (11:59 AM, 12:00 PM) to verify behavior
- Pet chores: Stick tag on food container or feeding station
- Bedroom chores: Tag on door frame or nightstand
- Kitchen chores: Tag on dishwasher or sink cabinet
- Use NTAG213 or higher (NTAG215/216 for larger data)
- Avoid metal surfaces (blocks NFC signal)
- Test scan distance (kids may need to touch phone directly to tag)
- Name pattern: "NFC: [Chore Name]"
- Group in folder: Create "NFC Automations" folder in HA
- Document Tag IDs: Keep list of which tag controls which chore
- Kids must have Home Assistant Companion App installed
- User accounts required (can't scan as guest)
- NFC tags can be scanned by anyone - place in kid-accessible but not public areas
- Services Reference - Full service action documentation
- Chore Configuration Guide - Setting up chores
- Configuration: Kids and Parents - User account linking
- Home Assistant NFC Documentation - https://www.home-assistant.io/integrations/tag/