I want to play applause on my smart speaker whenever I completed an item on my todo list. You somehow need to motivate yourself, right?
How can I trigger such an automation?
Thank you for your assistance!
I want to play applause on my smart speaker whenever I completed an item on my todo list. You somehow need to motivate yourself, right?
How can I trigger such an automation?
Thank you for your assistance!
I donāt use this myself, but you have a lot of information on how to do it in the documentation To-do list - Home Assistant
Well, I did read the documentation before posting here. I could not find the answer to my question in it.
Have you looked at the entities that the integration provides and what status they give?
Every Todo list has the number of open tasks as its state. I need to trigger an automation whenever this number decreases by one. But how can I do this?
You could use a counter decrease trigger in your automation You might need to create a counter helper (I use this to trigger my secondary robo vacuum when my primary has cleaned three times).
This works in your robo vacuum use case since in your example you trigger an automation when the counter reaches a certain number. But this could not be used to trigger an automation upon any decrease independent of the current value. Am I wrong?
Try looking into template sensors, I believe that should solve it. Iām not an expert on template sensors so someone else could probably help you out if needed.
The basic way is to use a template condition:
trigger:
- platform: state
entity_id: todo.example
not_from:
- unavailable
not_to:
- unavailable
condition:
- alias: Check if the new state is less than the old state
condition: template
value_template: "{{ trigger.to_state.state | int < trigger.from_state.state | int }}"
action:
# Your Notification Actions
Just be aware that the example above will also fire if someone deletes an item that has the status āneeds_actionā. The other way to do it is with an Event trigger, but the way the ToDo-related events work leaves weird edge cases that would also falsely trigger your automationā¦ so I donāt know if itās worth the complication.
Thank you, this works! I didnāt know about template conditions until now.