Repository navigation
Phone off the home Wi-Fi for 30 minutes counts as not home - #120
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Root cause
The phone app's own Wi-Fi report (
wifi_home) was only ever used as "home". With phone location off or no home spot saved, a person who left for days stayed "unknown": their empty side still pre-conditioned every evening, and the "you're not home" question (Wait an hour / Off tonight / Start anyway) never came. A Home Assistant Wi-Fi tracker already counts as away after a while off the network; the phone's own report didn't.Fix
phone_context: tracks since when the phone has said it's off the home Wi-Fi (wifi_off_since; a report after a silence longer than the Wi-Fi staleness starts afresh, switching Wi-Fi sharing off forgets it). After 30 min off, with a fresh report, and only when nothing else says where the person is (location, devices, the bedside dial), the person counts as not home, with the reason in plain words.wifi_off_away(default on) and a switch in Settings → Watch, ring and pets: "Off the home Wi-Fi means away".Verification
tests/test_phone_wifi_away.py(9 tests, incl. a full evening: off the Wi-Fi 31 min at pre-cool time → state "away", side off) and updatedtest_phone_context.py(with the setting on and off).npx tsc --noEmit -p .clean.Release note
When your phone has been off your home Wi-Fi for 30 minutes and nothing else says you're home, your side now waits at pre-cool time and asks you (Wait an hour, Off tonight, Start anyway) instead of cooling an empty bed. Turn it off under Settings → "Off the home Wi-Fi means away".