How to reliably tell HA I'm Home, without a phone?

Hi everyone,

I currently have a fairly simple home automation where it checks the number of people in the Home zone, and based on the result it turns lights on/off and sets various other things; basically just a simple thing for turning the lights off when no one is home, and turning them on when I get back home. The location is simply based on the HA companion app on my Android phone.

Now this works well 99% of the time, but I have two problematic cases:

  1. Sometimes the location doesn’t update in time, so I step into a completely dark apartment. I can usually work around this by manually opening the app or something like Google Maps to trigger a location update; so this is more just an inconvenience.
  2. The worst case scenario: what if my phone runs out of battery? In this case there would be no way to update my location.

I would like to ask advice on what the best solution to this issue might be! Something like installing a smart button near the entrance, pressing which would forcefully set myself to be Home, would solve the issue, but I’m not sure how to implement that. Or is there maybe a better solution?

Hello Marconius6,

Maybe a simple IR presence sensor could be a backup. or something with a voice control…
Hey Nabu, I’m home!

Some random ideas:

  1. For the battery issue, check if you have a sensor that tells HA the state of your battery. If so, perhaps some low threshold (e.g. 5%?) can be used to trigger an automation that assumes you’re home. On the assumption that lights-on when the place is vacant is preferable to walking in to a lights-off space when you return.
  2. How do you control the lights? If you use any smart switches, you can write automations that assume someone is home as soon as any switch is toggled.
  3. Consider a cheap contact sensor. I use Aqara sensors on my doors. One of the use cases is turning on the light in a closet when it’s opened—it works shockingly well. You could write an automation that assumes someone is home as soon as the door contact sensor changes states.
1 Like

A light switch near the door?

But seriously, the first thing which comes to mind is a Bluetooth NFC tag of some kind.

Of course you should have “normal” light switches, too. But I get it; automating stuff is more fun.

Smart watch, ring or band that emits BLE and an ESP to detect thosi broadcasts, configured as a BLE device tracker.

How do you control the lights? If you use any smart switches, you can write automations that assume someone is home as soon as any switch is toggled.

How would I do this? Currently the automation is checking if the Home zone has at least 1 person in it; how do I combine a switch being toggled with that?

For the iOS app you can also just put a BLE iBeacon near the front door and configure the zone to use that for zone entry.

That works really reliably. See Location | Home Assistant Companion Docs

wait what? tell me more!

edit: oh no

It will then begin using iBeacons instead of your location for enter (but not exit) triggers around your zones. To add an iBeacon to zone.home add the above under your customize.

yeah that sucks. no exit triggers. I’m very happy with Wi-Fi and the current settings we got, it’s almost immediate that zone.home goes to 0 when we leave.

Of course I’m not actually using zone.home directly — I have a separate binary presence sensor (templated) called Someone home, which flips to unavailable when our Wi-Fi network is having trouble.

# ...
      - binary_sensor:
        - name: Someone home
          unique_id: someone_home
          state: >-
            {%
              if
              is_state("input_select.home_occupancy_mode", "guest at home")
            %}True{%
              elif
              is_state("input_select.home_occupancy_mode", "ignore occupants")
            %}False{%
              else
            %}{{ (states("zone.home") | int) > 0}}{%
              endif
            %}
          device_class: occupancy
          availability: >-
            {{ is_state("input_select.home_occupancy_mode", "guest at home")
               or is_state("input_select.home_occupancy_mode", "ignore occupants")
               or is_state("binary_sensor.wi_fi_operational", "on") }}
          icon: >-
            {%
              if
              is_state("input_select.home_occupancy_mode", "guest at home")
            %}mdi:home-floor-g{%
              elif
              is_state("input_select.home_occupancy_mode", "ignore occupants")
            %}mdi:home-export-outline{%
              else
            %}mdi:home-floor-{{ states("zone.home") | int }}{%
              endif
            %}
          # With this + consider_home 10s + 1 minute timeout on Wi-Fi
          # station connectivity, total 1m15s until absence is detected
          # by the Someone home sensor using this configuration.
          # The iBeacon sensor complicates things because it takes
          # 3 minutes (in parallel to Wi-Fi) to consider me away.
          delay_off: "0:00:05"

Useful! That way I can force my home to pretend I’m not there, or to pretend someone is there when we’re not in it.

In addition to the above, motion sensor by the front door. A presence sensor like mm wave would work great but also overkill if your door is in a porch where you don’t hang around in.

Camera based detection is another option.

I did say:

You don’t want it for exit as the beacons have a limited range.

It is true that beacons have a limited range, albeit multiple ESP32s BLE proxies solve that issue. I would be more concerned that beacons’ exit events have a 3 minute timeout in the HA codebase, hard coded, that cannot be reconfigured. I know that because I tried.

Not for this application. The beacon is stationary. Your receiver (the phone app) is what is moving.