#Which Event is emitted when deleting/marking a local todo

1 messages · Page 1 of 1 (latest)

uneven anchor
#

what event is registered when dismissing a local todo?
I need to trigger based on that, but cant see any related event in the events page when listening to all events...

Automation triggers doesnt list it specifically .
the local todo only lists actions, but tbh, I am not sure which action I would be executing there...

usecase: a todo is auto created based on another event. along with several other whistles and bells in the frontend. I can dismiss all of those by clicking a button, or dismissing a persistent notification, at the same time removing the todo.

I now also want to dismiss those by marking this todo as completed, or removed, not even sure which I need there.
So I'd need the event for action: todo.remove_item I guess

Home Assistant

All the different ways how automations can be triggered.

Home Assistant

Instructions on how to use to-do lists within Home Assistant.

#

I did find this now listening for call_service:

event_type: call_service
data:
  domain: todo
  service: remove_item
  service_data:
    item:
      - 3f1e0146-5181-11f0-ab9a-00ce39d11846
    entity_id:
      - todo.huishouden
#

but also

event_type: call_service
data:
  domain: todo
  service: update_item
  service_data:
    item: 3f1e0146-5181-11f0-ab9a-00ce39d11846
    rename: Gft
    status: completed
    entity_id:
      - todo.huishouden

and

event_type: call_service
data:
  domain: todo
  service: get_items
  service_data:
    status: needs_action
    entity_id:
      - todo.huishouden
haughty fox
#

Listening to all event and dismissing a todo I got:

event_type: call_service
data:
  domain: todo
  service: update_item
  service_data:
    item: 0183b38a-8144-11ee-b346-dca6320b1030
    rename: foo
    status: completed
    entity_id:
      - todo.test
origin: LOCAL
time_fired: "2025-06-25T07:57:29.753057+00:00"
context:
  id: 01JYK1F28RCXAW0MKESVFJGDCG
  parent_id: null
  user_id: b398c328dfd34191bce873bfafde769a

And un-check it:

event_type: call_service
data:
  domain: todo
  service: update_item
  service_data:
    item: fb71bca8-8143-11ee-b346-dca6320b1030
    rename: foo
    status: needs_action
    entity_id:
      - todo.test
origin: LOCAL
time_fired: "2025-06-25T07:57:22.133124+00:00"
context:
  id: 01JYK1ETTNX9PAXKY2TYD6QJ8H
  parent_id: null
  user_id: b398c328dfd34191bce873bfafde769a
uneven anchor
#

thanks! yes, I just posted that too. So its not true todo 'event', but a regular call_service.

#

seems most appropriate I trigger based on the remove_item then, as that is the most definitive 😉

haughty fox
#

Yeah, but should be able to filter it 🙂 And indeed I missed remove_item

Example trigger:

trigger: event
event_type: call_service
event_data:
  domain: todo
  service: update_item
  service_data:
    status: completed
    entity_id:
      - todo.test
uneven anchor
#

which would probably translate to:

trigger: event
event_type: call_service
event_data:
  domain: todo
  service: remove_item
  service_data:
    entity_id:
      - todo.huishouden
#

now I only need a condition to test if a todo list item exists with the status: needs_action...

haughty fox
#

separate you mean? As after this event the item is gone.

uneven anchor
#

yeah, well I have a few actions in a single script that should only fire if an actual item exists. I guess I can handle it with a global:

      - condition: numeric_state
        entity_id: todo.huishouden
        above: 0
``` and not focus on the item itself