Skip to content

Tips & Tricks: Use NFC Tag to Mark Chore Claimed

ccpk1 edited this page Feb 20, 2025 · 2 revisions

📌 Tips & Tricks: Use NFC Tag to Mark Chore Claimed

Note: This is NOT a built-in feature of KidsChores but rather a manual configuration that has been tested and confirmed to work with the system.

Using NFC tags, kids can quickly mark chores as claimed in the KidsChores system without opening the dashboard. They do need a device that can read NFC tags and has the Home Assistant Companion App installed. This can be useful for recurring tasks like feeding pets or cleaning up.


🛠 Prerequisite: Create an NFC Helper Sensor

Before setting up the automations, you need a helper sensor to track who scanned the NFC tag. This will allow the logbook to store which user performed the action. This is a one-time add that will work for any NFC used in the future.

Step 1: Find User IDs

Each user in Home Assistant has a unique alphanumeric ID. To find them:

  1. Go to Settings → People → Users.
  2. Click on each user to view their user ID at the top of the dialog.
  3. Copy and store the user ID for later.

Step 2: Create the Helper Sensor

Add the following to your configuration.yaml or whichever yaml file you store these kinds of templates:

template:
  - trigger:
      - trigger: event
        event_type: tag_scanned
    sensor:
      - name: NFC Last Scan By
        state: >
          {% set user_map = {
            "9999999953eb45019c0f3e0811111111": "Kidname1", 
            "9999999953eb45019c0f3e0822222222": "Kidname2", 
            "9999999953eb45019c0f3e0833333333": "Parent1", 
            "9999999953eb45019c0f3e0844444444": "Parent2" 
          } %}
          {% set user_id = trigger.event.context.user_id %}
          {{ user_map.get(user_id, 'unknown') }}

🔹 Example 1: Simple NFC Tag - Clean the Litter Box

This automation marks the litter box chore as claimed when an NFC tag is scanned.

How It Works:

  • Trigger: When the NFC tag is scanned.
  • Action: Presses the "Claim Clean Litter PM" button.
  • Logs the user who scanned the tag.
alias: Clean Litter NFC
description: ""
triggers:
  - tag_id: 059701cb-9096-40d3-be04-59c112345678  # Replace with your actual NFC tag ID
    trigger: tag
conditions: []
actions:
  - variables:
      claim_button: button.kc_kidname1_chore_claim_clean_litter_pm    #Replace with the claim button for the chore you want to link
  - 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  #This isn't required, but creates an entry in the log associated with that user/chore
    data:
      name: Clean Litter 
      message: "Claimed by {{ states('sensor.nfc_last_scan_by') }}"
      entity_id: "{{ claim_button }}"
mode: single

🔹 Example 2: Choose chore to claim based on NFC tag time scanned - Feed the Cat

This automation determines whether to claim the AM or PM chore based on the time of day.

How It Works:

  • Trigger: When the NFC tag is scanned.
  • Logic:
  • Between 2AM an 12PM → Presses AM Feed Cat chore button.
  • Any other time → Presses PM Feed Cat chore button.
  • Logs the user who scanned the tag.
alias: Feed Cat NFC
description: ""
triggers:
  - tag_id: 0b3b18f7-0c99-4f19-9d17-d114ccf87799  # Replace with your actual NFC tag ID
    trigger: tag
conditions: []
actions:
  - variables:
      claim_button: >-
        {% if 2 <= now().hour < 12 %}
          button.kc_kidname1_chore_claim_feed_cat_am  #Replace with the claim button for the AM chore you want to link
        {% else %}
          button.kc_kidname2_chore_claim_feed_cat_pm #Replace with the claim button for the PM chore you want to link
        {% 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   #This isn't required, but creates an entry in the log associated with that user/chore
    data:
      name: Feed Cat NFC
      message: "Claimed by {{ states('sensor.nfc_last_scan_by') }}"
      entity_id: "{{ claim_button }}"
    
mode: single

image

🚀 Final Notes

  • These automations are customizable for any chore.
  • The helper sensor ensures every claim is logged with the correct user and only needs setup one time.
  • You can use multiple NFC tags for different locations (e.g., one by the litter box, another by the food bowl).

This method eliminates the need to manually claim chores, making daily tasks quick and seamless for the family! 🚀

Clone this wiki locally