Tips & Tricks: Configure Automatic Approval of Chores - ad-ha/kidschores-ha GitHub Wiki

📝 Chore System Auto-Approval Automations Overview

These two Home Assistant automations are NOT part of the KidsChores System but are designed to work with it to automatically handle chore approvals based on chore completion states. They are a custom approach to streamline the process by pressing the appropriate approval button when a chore is marked as "claimed".

Auto-approving chores can simplify your chore management system by reducing the need for manual approvals in certain scenarios. This solution is compatible with the KidsChores Integration, providing flexibility and customization to suit your family’s needs.


📌 1. Approve All Open Chore Claims For All Kids at 11:45 PM

Purpose:
This automation ensures that any claimed chore that has not yet been approved by a parent is automatically approved at 11:45 PM.

  • This prevents a child from losing their claim when chores reset at midnight.
  • Parents still have the entire day to review and approve or deny claims manually.

How It Works:

  • Trigger: Runs at 11:45 PM every day.
  • Action: Finds all chore sensors that are still in "claimed" status and presses the matching approval button.

Example Use Case:

  • If a child claims a chore in the morning and a parent forgets to approve it, this automation ensures it is approved before the midnight reset.

📌 2. Auto Approve All Chores for Kidname

Purpose:
This automation automatically approves any chore for the selected kid a few seconds after it is claimed. It dynamically detects all chore status sensors for the kid without needing to list them individually.

How It Works:

  • Trigger: Runs when any chore sensor (sensor.kidname_kidschores_chore_status_*) changes to "claimed" for at least 10 seconds.
  • Action: Finds the matching approval button (button.kidname_kidschores_chore_approval_*) and presses it automatically.
  • Fully Dynamic: Automatically handles all chores for the kid without needing a list of specific chores.

Example Use Case:

  • When sensor.kaden_kidschores_chore_status_make_bed changes to "claimed", the system presses button.kaden_kidschores_chore_approval_make_bed automatically.

📌 3. Auto Approve Designated Chores for Kidname

Purpose:
This automation automatically approves only specific chores for the kid within a few seconds of the claim. Unlike the previous automation, this one targets a specific list of chores.

How It Works:

  • Trigger: Runs when specific chore sensors (sensor.kidname_kidschores_chore_status_*) reach the "claimed" state for at least 10 seconds.
  • Action: Dynamically matches and presses the corresponding approval button.
  • Targeted Control: Approves only designated chores, offering more granular control.

Example Use Case:

  • Automatically approve only empty_dishwasher and put_laundry_away chores for Kaden.
    • sensor.kaden_kidschores_chore_status_empty_dishwasherbutton.kaden_kidschores_chore_approval_empty_dishwasher
    • sensor.kaden_kidschores_chore_status_put_laundry_awaybutton.kaden_kidschores_chore_approval_put_laundry_away

🚀 Why Auto-Approve Certain Chores?

Here are common reasons:

1. Daily Routine Chores

  • Chores like “Brush your teeth”, “Make your bed”, or “Feed the pet” are part of everyday routines that don’t need constant supervision.
  • Automatically approving these tasks encourages kids to build good habits without waiting for parental confirmation every time they complete them.

2. Temporary Convenience (e.g., Weekend Getaway)

  • You might normally review and approve tasks like “Do homework”, “Clean room”, or “Unload the dishwasher”.
  • However, when you’re away for the weekend and Grandma is watching the kids, you may not want to deal with constant approvals.
  • By creating separate automations for specific chore groups, you can quickly disable or enable auto-approval as needed by turning the automation on or off.

💡 Using Multiple Automations for Flexibility:

  • Daily Routine Automation: Auto-approves all routine chores without manual review.
  • Vacation Mode Automation: Covers other chores you'd typically approve but can be turned off easily for more oversight when you're home.

This setup offers maximum flexibility—whether you want to auto-approve everything, just routines, or toggle approvals for specific chore sets with a single switch.


🛠️ How to Set Up These Automations in Home Assistant:

Step 1: Open the Automation Editor

  1. Go to Home Assistant → Settings → Automations & Scenes → Automations
  2. Click Create Automation → Edit in YAML

Step 2: Paste the Automation Code

  • For "Approve All Open Chore Claims For All Kids" Automation at 11:45PM
alias: Approve all open claims at 11:45PM
description: >-
  Automatically presses the correct approval button for claimed chores that were
  not acted
triggers:
  - trigger: time
    at: "23:45:00"
conditions: []
actions:
  - variables:
      approval_button: |-
        {% set sensors = expand(states.sensor) 
                        | selectattr('entity_id', 'match', '^sensor\.kc_[a-zA-Z0-9_]+_chore_status_.*') 
                        | selectattr('state', 'equalto', 'claimed') 
                        | map(attribute='entity_id') 
                        | list %}

        {% if sensors | count > 0 %}
          {{ sensors | map('regex_replace', '^sensor\.kc_([a-zA-Z0-9_]+)_chore_status_', 'button.kc_\\1_chore_approval_') | list }}
        {% else %}
          none
        {% endif %}
  - choose:
      - conditions:
          - condition: template
            value_template: "{{ approval_button != 'none' }}"
        sequence:
          - target:
              entity_id: "{{ approval_button }}"
            action: button.press
mode: single
  • For “Auto Approve All Chores for Kidname” Automation:
alias: Auto approve all chores for Kidname
description: Automatically presses the correct approval button for claimed chores.
trigger:
  - platform: template
    value_template: >-
      {{ expand(states.sensor) 
         | selectattr('entity_id', 'match', '^sensor\\.kc_kidname_chore_status_.*') 
         | selectattr('state', 'equalto', 'claimed') 
         | list 
         | count > 0 }}
    for:
      seconds: 5
action:
  - variables:
      approval_button: >-
        {% set sensor = expand(states.sensor) 
                        | selectattr('entity_id', 'match', '^sensor\\.kc_kidname_chore_status_.*') 
                        | selectattr('state', 'equalto', 'claimed') 
                        | map(attribute='entity_id') 
                        | first %}
        {% if sensor %}
          {{ sensor | regex_replace('^sensor\\.kc_([a-zA-Z0-9_]+)_chore_status_', 'button.kc_\\1_chore_approval_') }}
        {% else %}
          none
        {% endif %}
  - choose:
      - conditions:
          - condition: template
            value_template: "{{ approval_button != 'none' }}"
        sequence:
          - service: button.press
            target:
              entity_id: "{{ approval_button }}"
mode: single
  • For “Approve Designated Chores for Kidname” Automation:
alias: Auto approve designated chores for Kidname
description: Automatically presses the correct approval button for claimed designated chores.
trigger:
  - platform: state
    entity_id:
      - sensor.kidname_kidschores_chore_status_empty_dishwasher
      - sensor.kidname_kidschores_chore_status_put_laundry_away
    for:
      seconds: 10
action:
  - variables:
      approval_button: >-
        {% if trigger.entity_id is defined and 
           trigger.entity_id.startswith('sensor.kc_') and 
           '_chore_status_' in trigger.entity_id %}
          {{ trigger.entity_id | regex_replace('^sensor\\.kc_([a-zA-Z0-9_]+)_chore_status_', 'button.kc_\\1_chore_approval_') }}
        {% else %}
          none
        {% endif %}
  - choose:
      - conditions:
          - condition: template
            value_template: "{{ approval_button != 'none' }}"
        sequence:
          - service: button.press
            target:
              entity_id: "{{ approval_button }}"
mode: single

Step 3: Replace Kidname and update entities in the state trigger

  • Find and replace all instances of "Kidname" with your child's name, ensuring the case matches:

    • Kidname → (e.g., "Kaden")
    • kidname → (e.g., "kaden")
  • For the designated chore automation, you will need to select the appropriate sensors to add in as entities to the trigger. Ensure you chose the *status sensor for each chore.


Step 4: Save and Test

  • ✅ Click Save to create the automation.
  • ✅ Have your kid claim a chore
  • ✅ Confirm that the matching approval button is pressed automatically.

🚀 Final Notes:

  • ✅ Both automations are fully compatible with the KidsChores Integration.
  • ✅ You can set them up in different ways to suit your needs:
    • One automation for multiple kids, dynamically handling approvals for all children.
    • Separate automations for each kid, providing individual control.
    • Multiple automations for one kid, grouping chores differently.