v1.1.1
Changelog
1 — orphaned_timestamp (completely new)
Reads the official HA field in the registry entry. When HA restarts and integration doesn't "recognize" the entity, HA automatically sets this field. The old code completely ignored it.
2 — Dead config entry (performance improvement)
Built-in active_entry_ids as a one-time set before the loop, O(1) lookup. The old code called async_get_entry() separately for each entity.
3 — Unavailable state (most important fix)
Uses entry.modified_at from the entity registry instead of state.last_changed. Reason: state.last_changed resets to 0 every time HA restarts, so an entity unavailable for 6 months looks like it's only been 0 seconds. modified_at in the registry doesn't reset.
4 — Stale recorder (SQL query fix)
The old SQL MAX(last_updated_ts) made the spam entity unavailable every 30 seconds look very "fresh". The new SQL separates the state into two columns: last_any (all states, including unavailable) and last_valid (only the actual state). Stale checks using last_valid → entities like UniFi RX/TX are correctly detected.
3-tier fallback for last_changed display
Recorder DB → state.last_changed RAM → entry.created_at registry. Ensure the "Last Changed" column always has a value and is never empty.
Fix _scan_scripts
Added load recorder history for domain scripts (previously missing). Added 3-tier fallback for last_dt similar to automation.
Fix _scan_automations
Added 3-tier fallback for last_dt when last_triggered = None.