I have an automation that populates some todo lists. How would i setup my trigger in a template sensor to run after the automation has finished? Currently using timing to update the sensor but it runs into issues where the lists are half updated so the template sensor doesn't populate correctly because the automation is running at the same time.
#Template sensor trigger from automation run
1 messages · Page 1 of 1 (latest)
You could trigger on the current attribute of the automation going to a value of 0. Alternatively, you could fire an event that you could trigger on at the end.
looking at 'current' didnt seem to work when i tested, let me try again..
- trigger:
- platform: state
entity_id:
- automation.sync_calendar_to_todo_list
attribute: current
to:
- "0"
yes?
not sure.. the only trigger that seems to work is time_pattern
eh nvm idk now it's just suddenly working on event 🤷
ty
what if you use the homeassistant.update_entity command at the end of your automation?
This should force the sensor to reevaluate I think
Or eventually, use custom event and trigger tempalte sensor on this event. Fire the event from the automation.
that's what I ended up doing was just firing an event for it
and the sensor trigger watches it
I think it should even be to: 0
An attribute can be a list
So if an attribute is used in a state trigger, it might check for a list with the specified value
Not sure though
Yeah, that is interesting, wonder if that's how it's handled. Might be the case since OP seemed to imply they couldn't get it working