core: script last_triggered not recorded/restored
The problem
While the automation last_triggered is recorded and read from history perfectly, the last_triggered for scripts isn’t.
I only noticed this because we can now set the secondary_info: last-triggered on entities of the domain automation and script.
Automations show last_triggered from weeks ago (if applicable of course) script always start with Never triggered after a restart…
Environment
- Home Assistant release with the issue: 105.5
- Last working Home Assistant release (if known): not known
- Operating environment (Hass.io/Docker/Windows/etc.): Hass.io
- Integration causing this issue: script
- Link to integration documentation on our website: https://www.home-assistant.io/integrations/script/
Problem-relevant configuration.yaml
- type: entities
title: Tradfri automations & scripts
show_header_toggle: true
entities:
- entity: automation.tradfri_parking_light_shows_unavailable
secondary_info: last-triggered
- type: custom:toggle-lock-entity-row
entity: script.reset_ikea_hub
secondary_info: last-triggered
- type: custom:toggle-lock-entity-row
entity: switch.sw_everspring_no_template
secondary_info: last-changed
automation shows correctly, script shows
Traceback/Error logs
no logged errors as far as I can see
Additional information
https://www.home-assistant.io/lovelace/entities/#secondary_info
before restart:

after restart:

just to be complete: yes, I have included both automation and script in the recorder and logbook settings.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 20 (13 by maintainers)
I don’t believe this can be classified as an issue. Scripts do not, and have not (to my knowledge), saved & restored state. To do so would be a new feature. I will leave this open, however, because it’s not my call.