github noiwid/HAFamilySafety v2.0.2
v2.0.2 - Fix silent timeouts and undetected session expiry

latest release: v2.0.3
2 hours ago

Fixes a failure mode where the Family web API stopped answering after a while, showing up as unknown screen-time entities, 120 s timeouts on /family/api/st, and a lock switch that refused with "current schedule unreadable".

Fixed

  • Akamai bot-manager cookies are no longer stored or replayed. The native sign-in captured bm_sv and ak_bmsc along with the Microsoft session cookies. Those two are bound to the browser that obtained them; when the integration replayed them from Home Assistant, Microsoft answered with silence until the read timeout, then reset the connection. That hid a plain expired session behind timeouts and 30 minute backoffs. They are now dropped when cookies are captured, loaded and re-exported, so an expired session shows up as an expired session and triggers reauthentication instead of hanging.
  • Lock and unlock stop early when Microsoft is not answering. Each weekday is two writes that can each wait out the full timeout. Once a write fails for a network reason, the remaining days are skipped and the saved schedule is kept for a later retry, instead of blocking the integration for up to fourteen minutes.
  • An expired web session is detected and reauthentication is offered. A rejected Family request used to leave the captured Family context marked as ready, which skipped the account-session probe on every later poll. The session could expire and nobody would be told; the entities just stayed unknown. A rejection now invalidates that context and forgets the rejected token (in memory, in the runtime store and against the sign-in copy), so the next poll probes the account session and, if it is gone, starts the reauthentication flow and raises the notification. If it is only a rotated antiforgery token, a fresh one is scraped and nothing is asked of you.
  • The lock guard now says what is actually wrong. "Reauthenticate" is only suggested when the web session is really expired. A timeout, a network error or an active backoff now says so, so nobody redoes the whole sign-in during a transient outage.

Note

If your screen-time entities are unknown after updating and the connection sensor reports an expired web session, run the reauthentication once. That is expected: the previous versions could not tell you the session had expired.

Don't miss a new HAFamilySafety release

NewReleases is sending notifications on new releases.