this post was submitted on 20 Jul 2026
1 points (100.0% liked)

Home Assistant

281 readers
3 users here now

Home Assistant is open source home automation that puts local control and privacy first. Powered by a worldwide community of tinkerers and DIY...

founded 3 years ago
MODERATORS
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/homeassistant by /u/Double_Ad9555 on 2026-07-20 08:31:16+00:00.


So this kept happening to me: restart HA (update, whatever), glance at a dashboard afterward, and do a double-take ? everything says "2 seconds ago" even though nothing's actually touched those devices in days. I know it's just how HA handles last_changed on restart, but it bugged me every single time, especially when I'd actually go check history thinking something triggered.

Turns out the recorder already has the real answer ? HA just resets last_changed to the restart time internally. So I wrote an integration that fixes it right at startup: it looks up the true last-change timestamp from the recorder and writes it back onto the entity itself. No extra sensors, nothing to change in your automations or dashboards.

Quick rundown:

Runs on startup, basically no overhead the rest of the time

Also catches Zigbee/Z-Wave devices that take a bit to come back online (rechecks at +30/90/180s)

You pick what it touches ? domains, specific entities, labels, areas, an exclude list, plus a grace window

restore_now service if you want to trigger it manually

Been running clean on my own instance for weeks now, figured it's worth putting out there.

GitHub: https://github.com/hiSweid/last_changed_keeper

Not in the HACS default store yet (PR's open), so add it via that button or manually as a custom repository for now. Happy to hear feedback, bug reports, or just "yep works for me too."

no comments (yet)
sorted by: hot top controversial new old
there doesn't seem to be anything here