Improving my Task Tracker in Home Assistant
It’s been a few years since I wrote a brief “how-to” guide to create a task tracker in Home Assistant. At the time I positioned it as a chore tracker for my kids. And not surprisingly, despite my efforts to make it more appealing, they never got into it. I get it, no one likes doing chores! Until recently, that was it, nobody used it. I was even debating whether to pull it out entirely when I concluded that having such a feature in Home Assistant made much more sense for certain recurring tasks than tracking them somewhere else. Using existing infrastructure for state tracking, notifications, alerts, and dashboards are good reasons to include recurring tasks in Home Assistant, but I didn’t enough consideration before to more nuanced downstream automation opportunities. Sure there’s automatically start a process once a task is completed like picking up the house before the vacuum bot is run, think enough about the automation potential before.
Chores are still a good use case, but this can be extended to include ANY recurring task, espeically those in and around the home. in and ar Mostly these are recurring tasks, chores are still a good example, but really this can be for any task around the home
Two quick examples:
- Completing a task can be a method to count inventory.
- Between periodically changing the filters on my furnace and refrigerator, I often forget how many of each filter I might already have on hand. Keeping track of that would be as easy as setting an initial count per filter and then decrementing the count after each task is completed.
- Not all tasks need to be manually completed.
- We try to run our robovac every couple days but frequently there are things that need to be picked off the floor first. A task to pickup can be can be automatically completed simply by turing the robo vaccum on. Similarly, my son’s school has a half day every Wednesday, a task to pick him up can be completed if my phone enters his school zone.
So instead of ripping it out, I decided to make it better.
There’s
I recently updated the task tracker I built in my Home Assistant environment. I posted about it here way back in 2021. At the time, I had framed it as a “chore checker” for my kids, and, not surprisingly, their enthusiasm for it didn’t last long (despite my post title). Between then and now, not much happened with it. They didn’t use it, nor did I, since all of my task management was done in a different environment. A little while ago I decided I had arrived at the “improve it or remove it” moment for the feature. At first, I did consider removing it, but the more I thought about different use cases and considered what Home Assistant is—a state machine!—the more I became convinced that “improving it” had the higher potential value. There were even knock-on benefits for certain task types. For example, consider a reminder to change your refrigerator water filter. If you mark the task as complete, and if you happen to have a small inventory of filters on hand, you might as well have Home Assistant decrement a count so you always know how many you have. For that matter, you could even get a notification to buy more filters before the task is due if you didn’t have any. That, along with a few other benefits, seemed pretty compelling to me.
Before changing anything, I wrote a high-level requirements doc here. My main concern was that I wanted usability to be super simple. Beyond the initial task setup, I didn’t want any additional task-level overhead or maintenance. Just mark a task as complete and let the system determine the next due date and self-activate when the date has been reached. That sounds simple at first, but I quickly realized it’s a little more than a basic +x days calculation. For example, most people will likely want to do home maintenance tasks on weekends. That could be a Saturday or Sunday, but stuff happens, and it may not actually get done until Monday or Tuesday. If the task recurred weekly, you’d still want it to be due again on the following weekend, so fixed +x day adjustments wouldn’t be very useful in most of these cases. For my son, he has a daily task to show us his homework every school day. On the surface, that may sound easier to do, but if I really didn’t want to manage due dates (and I didn’t), that meant the next due date calculation would have to account for holidays that fell on a weekday and also other weekdays that were scheduled as non-school days. That’s obviously more work than just a simple “if date = weekday, then task due” calculation. There are, of course, many more examples like these of how a recurring task could be set up. To support all that flexibility, I decided to embed a “timing rule” as an attribute to each task entity. This way, each task has its own timing cadence driven by a phrase like “Every 3 months on the 1st Saturday,” “Every school day,” or any number of phrases in between. These are the inputs to determine the next due date. Tasks are set up as trigger-based sensors and self-activate when their due date has been reached. Custom macros are then used to perform all entity updates and associated time calculations. With the lone exception of one automation to reset completion toggles, no other automation is needed. The frontend uses Jinja templating to dynamically update displayed data.
Here is a short gif showing the final product. It shows the following:
- Various tasks in the Upcoming, Due, Done, and Overdue states.
- How to mark tasks complete.
- How to view task detail such as:
- Note: the task pop-ups show the timing rule, along with the last completion date and the next due date. The gif demonstrates how those dates change as tasks are completed.