Script "last_triggered" attribute as secondary info inlovelace

Hello everyone,

I’m struggling with the following: I’ve set up a dashboard from where I can run various scripts, and it’d be nice to have the possibility to display the previous execution date of each script.

I’ve tried experimenting with the secondary_info parameter, but no luck so far. Note that I like the way it looks using last-updated, and I’d rather not create new sensors to display the attribute in a new line on the card.

image

Any kind of help would be appreciated !

Cheers

Secondary_info should work. Maybe you are formatting it wrong
Here is an example:

- type: entities
  show_header_toggle: false
  entities:
    - entity: alarm_control_panel.house
      secondary_info: last-changed

To use extra options for entities, you must specify them as objects. This can be done by adding entity: before the actual entity.

1 Like

Thanks for your help !

To be clear: secondary_info is indeed working, but last-changed does not return the last time the script was run. For now, it’s only displaying the time since the last restart of HA (when the script entity was initialize I think).

Scripts have a last_triggered attribute, this is what I want to display here.

Just found this thread, realized that the feature was not there yet, and gave it my best [minimalistic] shot:

Not extremely flexible, but should get the job done.

1 Like

Thanks for your help ! Silly question, but if I apply the changes you made, they’ll be overwritten during the next HA update, right ?

If you want to try it because you can’t wait or want to improve things or whatever, then follow instructions here:

https://developers.home-assistant.io/docs/en/frontend_development.html

Specifically the #configuring-home-assistant section.

Otherwise, just wait and we will see the opinion from other developers and the hass community in general.

All right, I guess it’s better to wait then. Thanks very much for your help !