Add "last_triggered" to all entites by /config/customize_glob.yaml

Hi there, i wanna add to all entities an attribute “last_triggered” cause with that i can trigger and pre-check some paramaters i wanna use in my automations.

normally for that i use the /config/customize_glob.yaml but i dont see any kind of syntax how i can realize that, cause i think i need to combine an “initial” empty attribute with an automation.

help :slight_smile: thx berni

What would “last_triggered” mean in context of a non-automation entity?

An entity has the properties listed in the link below and includes last_changed and last_updated.

Automations and scripts have last_triggered.

@Taras thx but what i mean is , to find an automated way to add “last_updated” or similar to any kind of entity cause most dont have this attribute

valid Q… most entities in HA dont have an last_updated, last_triggererd or similar which is sometimes helpful in automations

e.g. i created an helper toggle to trigger an flush of my water filter… with last_trigger i can change color_icon when last_triggered over 2d in past

@Taras thx for link to documentation but this is only working when an entity has an attribute last_changed and similar which e.g. an helper by creation dont have

I see. You want an entity to have a custom attribute that reports the last time the entity’s state value was changed.

If that’s correct, then be advised that you can’t use Manual Customization for this purpose. It can only be used to create attributes with static, not dynamic, values. To support dynamic values it would need to support templates, but it doesn’t.

If you can explain why you want an attribute that records the last time the entity’s state value changed, perhaps we can suggest a substitute.

Is it just this or is there more?

i created an helper toggle to trigger an flush of my water filter… with last_trigger i can change color_icon when last_triggered over 2d in past


Copy-paste the following template into the Template Editor and replace “example” with the name of your Input Boolean helper. The templates should display the last time the Input Boolean was changed/updated.

{{ states.input_boolean.example.last_changed }}
{{ states.input_boolean.example.last_updated }}