Press, Track, Earn: Transforming a Zigbee Button into a Smart Chore Tracker

Press, Track, Earn: Transforming a Zigbee Button into a Smart Chore Tracker

In a previous post I introduced you to a surprisingly capable little Zigbee button that integrates seamlessly with Home Assistant. Originally, I used it for various smart home automations, and I still find new ways to benefit from its reliability and long battery life. Today, I want to share my latest use case: tracking chores around the house.

I’ve set up an automation where my boy uses the button to log when he completes household tasks – such as clearing the dishwasher. Each time he presses the button, a helper counter increases and the nearest Alexa device announces both the number of completed tasks and the corresponding allowance. In my example, every task is worth $2. When it’s time to reset (after payment), he simply long-presses the button.

The Automation Explained

The automation works in two parts:

  • Short Press: Increments a task counter (input_number.boy_task_counter) and then announces the updated count along with the dollar amount (calculated as the number of tasks multiplied by 2). This is where you can customize the “cost” per chore by changing the multiplication factor from 2 to any other value.
  • Long Press: Resets the task counter back to zero, so your boy can start fresh the next time.

You can easily adapt this automation to suit your home’s needs. For example, you might change the entity IDs, adjust the announcement message, or alter the cost per chore. Just locate the multiplication factor in the announcement message and update it if you want each task to be worth a different amount.

Updated Automation Code

alias: Button for boy's tasks
description: ""
triggers:
  - device_id: ecdb8ef27705ca6a07c367c5d8e59763
    domain: zha
    type: remote_button_short_press
    subtype: button_1
    id: plusone
    trigger: device
  - device_id: ecdb8ef27705ca6a07c367c5d8e59763
    domain: zha
    type: remote_button_long_press
    subtype: button_1
    trigger: device
    id: pause
conditions: []
actions:
  - choose:
      - conditions:
          - condition: trigger
            id:
              - plusone
        sequence:
          - action: input_number.increment
            metadata: {}
            data:
              amount: 1
            target:
              entity_id: input_number.boy_task_counter
          - variables:
              tasksnum: "{{ int(states('input_number.boy_task_counter')) }}"
          - data:
              data:
                type: announce
              target: media_player.kitchen_echo
              message: >-
                {{ 'You completed ' + (tasksnum | string) + ' tasks, and you should get ' + (int(tasksnum * 2) | string) + ' dollars' }}
            enabled: true
            action: notify.alexa_media_kitchen_echo
      - conditions:
          - condition: trigger
            id:
              - pause
        sequence:
          - action: input_number.set_value
            metadata: {}
            data:
              value: 0
            target:
              entity_id: input_number.boy_task_counter
          - data:
              data:
                type: announce
              target: media_player.kitchen_echo
              message: Task counter was reset
            enabled: true
            action: notify.alexa_media_kitchen_echo
  - delay:
      hours: 0
      minutes: 0
      seconds: 3
      milliseconds: 0
mode: single

Customization Options

Here are a few areas you can tailor:

  • Entity Names: Change input_number.boy_task_counter to any name that fits your setup.
  • Cost per Task: Modify the multiplication factor (* 2) in the announcement message to adjust how much each chore is worth.
  • Announcement Messages: Tweak the text in the message field to match your preferred style or language.
  • Trigger Devices: If you have more than one Zigbee button or different device IDs, update the device_id values accordingly.

With these simple adjustments, you can have a tailored automation that not only keeps your home running smoothly but also motivates your little helper with a fun and interactive way to track chores.

Happy automating!


Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply