Skip to content
Download

HA Automations

Once the TappRFID integration is connected, your task and log entities are available as first-class objects in Home Assistant automations. This page covers practical automation patterns with ready-to-use YAML.


All automation YAML on this page uses placeholder IDs. Replace them with your actual values:

  • Entity ID (sensor.tapprfid_brush_teeth) — find in Settings → Devices & Services → Entities, filter by tapprfid
  • Task UUID (task_id) — open the entity in HA, expand Attributes, copy task_id
  • Log UUID (log_id) — same process for log entities

Use an NFC tag in a physical location to complete a task directly from HA. This is useful for locations where you want the completion logged in both HA and TappRFID simultaneously (e.g. an entry sensor that also triggers a task), or for Android users where TappRFID isn’t available.

The HA mobile app can read NFC tags and fire events. Pair this with the tap_rfid.complete_task service:

automation:
alias: "NFC: Complete Take Vitamins"
trigger:
- platform: event
event_type: tag_scanned
event_data:
tag_id: "YOUR_NFC_TAG_ID"
action:
- service: tap_rfid.complete_task
data:
task_id: "YOUR_TASK_UUID"

If you have a smart button or a Zigbee button assigned to a task:

automation:
alias: "Button: Complete Morning Workout"
trigger:
- platform: state
entity_id: binary_sensor.smart_button_gym
to: "on"
action:
- service: tap_rfid.complete_task
data:
task_id: "YOUR_TASK_UUID"
- service: notify.mobile_app_your_phone
data:
message: "Workout logged ✓"

Send a push notification when a task enters overdue state. Useful for tasks you want a reminder on without relying solely on the app’s notification system.

automation:
alias: "TappRFID: Notify overdue tasks"
trigger:
- platform: state
entity_id:
- sensor.tapprfid_brush_teeth
- sensor.tapprfid_take_vitamins
- sensor.tapprfid_hydrate
to: "overdue"
action:
- service: notify.mobile_app_your_phone
data:
title: "Task overdue"
message: "{{ trigger.to_state.attributes.friendly_name }} is overdue."

Add a for clause to avoid re-triggering on restarts:

trigger:
- platform: state
entity_id: sensor.tapprfid_brush_teeth
to: "overdue"
for:
minutes: 5

Send a summary of today’s task status each morning. This gives you a heads-up before you start the day.

automation:
alias: "TappRFID: Morning routine summary"
trigger:
- platform: time
at: "07:30:00"
action:
- service: notify.mobile_app_your_phone
data:
title: "Morning routine"
message: >
Brush Teeth: {{ states('sensor.tapprfid_brush_teeth') }}
Take Vitamins: {{ states('sensor.tapprfid_take_vitamins') }}
Workout: {{ states('sensor.tapprfid_workout') }}

4. Auto-complete a task based on another sensor

Section titled “4. Auto-complete a task based on another sensor”

Complete a task automatically when a physical sensor fires. For example, mark “Took medication” when a smart pill dispenser sensor triggers:

automation:
alias: "Pill dispenser: log medication taken"
trigger:
- platform: state
entity_id: binary_sensor.pill_dispenser_opened
from: "off"
to: "on"
condition:
- condition: time
after: "06:00:00"
before: "12:00:00"
action:
- service: tap_rfid.complete_task
data:
task_id: "YOUR_TASK_UUID"

Log entries are timestamped records. Use them to track things like sleep data, weight, or any other sensor reading:

automation:
alias: "TappRFID: Log morning weight"
trigger:
- platform: state
entity_id: sensor.smart_scale_weight
condition:
- condition: time
after: "06:00:00"
before: "09:00:00"
action:
- service: tap_rfid.add_log_entry
data:
log_id: "YOUR_LOG_UUID"
note: "{{ states('sensor.smart_scale_weight') }} kg"

Display your top streaks in a dashboard using template sensors:

# In configuration.yaml or a packages file
template:
- sensor:
- name: "Top streak task"
state: >
{% set tasks = [
states.sensor.tapprfid_brush_teeth,
states.sensor.tapprfid_workout,
states.sensor.tapprfid_take_vitamins
] %}
{% set top = tasks | sort(attribute='attributes.streak') | last %}
{{ top.attributes.friendly_name }}: {{ top.attributes.streak }} days

7. All tasks complete — trigger a reward

Section titled “7. All tasks complete — trigger a reward”

Trigger an action (a scene, a notification, or a smart device) when all tracked tasks for the day are complete:

automation:
alias: "TappRFID: All daily tasks done"
trigger:
- platform: state
entity_id:
- sensor.tapprfid_brush_teeth
- sensor.tapprfid_take_vitamins
- sensor.tapprfid_workout
- sensor.tapprfid_make_bed
to: "complete"
condition:
- condition: state
entity_id: sensor.tapprfid_brush_teeth
state: "complete"
- condition: state
entity_id: sensor.tapprfid_take_vitamins
state: "complete"
- condition: state
entity_id: sensor.tapprfid_workout
state: "complete"
- condition: state
entity_id: sensor.tapprfid_make_bed
state: "complete"
action:
- service: scene.turn_on
target:
entity_id: scene.evening_wind_down
- service: notify.mobile_app_your_phone
data:
message: "All daily tasks complete. Well done."

Notify when a streak hits a milestone (7 days, 30 days, 100 days):

automation:
alias: "TappRFID: Streak milestone"
trigger:
- platform: template
value_template: >
{{ state_attr('sensor.tapprfid_workout', 'streak') in [7, 30, 50, 100, 200, 365] }}
action:
- service: notify.mobile_app_your_phone
data:
title: "Streak milestone 🔥"
message: >
Workout streak: {{ state_attr('sensor.tapprfid_workout', 'streak') }} days.

Use task state to gate other automations. For example, only run an evening automation if the morning tasks were completed:

automation:
alias: "Evening: wind down if routine done"
trigger:
- platform: time
at: "21:00:00"
condition:
- condition: state
entity_id: sensor.tapprfid_workout
state: "complete"
action:
- service: scene.turn_on
target:
entity_id: scene.wind_down

A full Lovelace dashboard example combining the TappRFID card with entity cards:

title: Routines
views:
- title: Today
cards:
# TappRFID card — full task list
- type: custom:tapprfid-card
title: Daily Routines
sort: status
show_streak: true
# Quick-glance entity row for overdue only
- type: custom:tapprfid-card
title: Needs Attention
filter: overdue
compact: true
# Individual entity cards for key tasks
- type: entities
title: Key tasks
entities:
- entity: sensor.tapprfid_brush_teeth
- entity: sensor.tapprfid_take_vitamins
- entity: sensor.tapprfid_workout
# Streak stat
- type: statistic
entity: sensor.tapprfid_workout
stat_type: mean
name: Workout streak

Useful Jinja2 snippets for use in templates, notifications, and conditions:

{# Get streak for a task #}
{{ state_attr('sensor.tapprfid_brush_teeth', 'streak') }}
{# Get next due time #}
{{ state_attr('sensor.tapprfid_brush_teeth', 'next_due') | as_datetime | relative_time }}
{# Check if any task is overdue #}
{% set overdue = states.sensor | selectattr('entity_id', 'search', 'tapprfid') | selectattr('state', 'eq', 'overdue') | list %}
{{ overdue | count }} task(s) overdue
{# List overdue task names #}
{% for t in overdue %}
- {{ t.attributes.friendly_name }}
{% endfor %}

For installation steps, see Backend Integration and Lovelace Card.