To-do list trigger

Hi

I’m trying to build an automation that’ll trigger when an item on a To-do list is completed. I just can’t seem to find such trigger. Can anyone guide me in the right direction?

Context:
Using Unifi integration, I would like to unblock a device when a to-do list item is updated to complete. I would like my childrens devices to be blocked every night and then when they return home, they need to do chores before it is unblocked. I’ll track the chores using a to-do list :slight_smile: That way, I create kind of a sign-off (“clean your room”, “ensure your jacket has been hung on the coat-hanger”, etc)

Thanks in advacne

3 Likes

I see this question was from quite a while back, with no response. I too am trying to figure this out.

As best I can tell, we can’t exactly list a to-do item being marked as complete as a trigger alone. What we would need to do is:

  1. Set a periodic trigger.
  2. The trigger would cause an automation to run where the current list of to-do items could be obtained and saved to a variable. As best I can tell, this can be performed using by calling the service “To-do list: Get to-do list items”.
  3. A check would need to be performed to search the list for a specific item name, effectively checking to see if the variable from 2 contains a matching string for the to-do item you’re checking.
  4. If a match is found, no further action is taken. At the next period trigger (maybe in an hour, or day?), steps 2 and 3 are performed again. If the task has been completed, there would not be a match found.
  5. Per the outcome of step 4, a lack of a match means the task is assumed to be completed, triggering further custom actions.

For myself, it’s a multi-part use case to note usage of things. For example, let’s say I want to change my toothbrush every 30 days of use (bristles lose effectiveness). However, I travel a lot at which point my usual toothbrush isn’t used on some days. I set a counter variable to increment every day at a certain time provided my security system isn’t armed. When the incremental counter reaches 30, a helper switch triggers to add a to-do task and with that helper switch set to “on”, the counter no longer increments. I want to set the switch back to “off”, which will reset the counter to zero and resume daily incrementing of the counter from there, within a day of marking my to-do task to replace the toothbrush as complete.

Yes, it’s a lot to do for what seems like a simple reminder, but getting the how-to worked through will open up a lot of other possibilities for me.