What's the best way to tell home assistant that I'm home?

I am using google location to tell home assistant where I am, but it doesn’t update fast enough. It might take 5+ minutes for home assistant to know I’m home. I’m looking for something that can turn my front lights on when I’m 200 yards from home. Does something like this exist?

I prefer not to use a trigger when my phone connects to my home wifi since I sometimes have the wifi off on my phone.

I’m not opposed to using something other than my phone, like something I would keep in my car.

Any ideas?

you can use the Bluetooth detection … it works great

https://www.home-assistant.io/components/device_tracker.bluetooth_tracker/

I have tested a bunch of location tracking/geofencing apps on my iPhone, specifically:
iCloud, OwnTracks, Locative, IFTTT and Stringify.

OwnTracks was a clear winner in almost all situations. But i’m sure YMMV depending on your phone, your country, mobile reception, etc.

EDIT: But I agree with the above, that bluetooth is far more reliable than any geofencing app. BLE iBeacon with Owntracks is even more reliable.

Owntracks in combination with Bluetooth iBeacons is pretty damn good. The beacons make sure that entering your home zone updates immediately every time.

I use Life360. Recently I tried Google Location Sharing as well. For the same phone Life360 always updates more quickly than Google Location Sharing. I have my home zone’s radius set to 300 meters, and the Life360 platform update period set to 10 seconds, and HA always knows we’re home by the time we pull into the driveway.

It is a cloud-based service, so it’s not perfect, but it suits our needs. But if you’re looking for something that isn’t cloud based, or is more precise, then the previous suggestions are probably the way to go.

1 Like

There was someone (i can’t find the post) that was using 3 methods to tell if they were home, and then using some templating so if more than two say home, then it sets them to home.

I think they were using, OwnTracks, BLE and wifi (from a router)

I tried Owntracks but had some trouble setting up Mosquitto MQTT to work with Owntracks, I’m using the standard MQTT that comes with HA, which doesn’t seem to play well with Owntracks.

The Bluetooth method intrigues me.

  1. Does my phone need to connect to the Bluetooth that HA is tracking? My Bluetooth is always connected to my truck while I’m driving. So, If it needs to connect to the HA Bluetooth that won’t work.

  2. The Bluetooth ibeacon, what exactly is that? Is it something I put in my car that HA finds? Or is it something that is in my home, connected to HA that extends the range to find my phone? If I keep it in my car does it need power?

  3. Do I need to add hardware to my HASSIO system on Rasberry Pi to find the Bluetooth signal? Or is that what the Bluetooth ibeacon is for?

I don’t think bluetooth will help in your case for detection 200 yards from home.

FYI, I use Automatic Pro in my 2 vehicles together with an automation to turn the lights on when arriving home.

automation:
  - alias: Bruce Arriving Home
    hide_entity: true
    initial_state: true
    trigger:
      platform: state
      to: 'home'
      entity_id: device_tracker.bruce
    action:
      - service: notify.telegram
        data:
          message: Bruce has arrived home.
          title: Bruce Arrive
      - service_template: >
          {% if is_state('script.bruce_porch_light', 'off') %}
            script.turn_on
          {% else %}
          {% endif %}
        entity_id: script.bruce_porch_light
      - condition: state
        entity_id: 'group.family'
        state: 'home'
      - delay: '00:00:30'
      - service: script.turn_on
        entity_id: script.sonos_tts
        data_template:
          variables:
            where: "living_room"
            what: >
              {% if is_state('sun.sun', 'below_horizon') %}
                Bruce, has arrived, and the Porch light has been turned {{ states.switch.vision_zl7432_inwall_switch_dual_relay_switch_2.state }}.
              {% else %}
                Bruce, has arrived.
              {% endif %}

Script:

alias: Bruce Porch Light
sequence:
  - condition: template
    value_template: '{{ states.sun.sun.attributes.elevation < -5 }}'
  - service: switch.turn_on
    data:
      entity_id: switch.porch_light
  - delay: '00:05:00'
  - service: switch.turn_off
    data:
      entity_id: switch.porch_light

No it doesn’t need to connect, it is detecting a live BT signal, so no connection is needed.

The ibeacon is a little chip you can add to your keychain. It provides a BT signal which can be detected by HA to know your home (instead of using your phone).

Not sure what the hardware requirements are.

I use a combo of things put into a Bayesian Sensor which then triggers a Boolean Input based whether or not the Sensor is ON or OFF. Also, it’s nice to have the Boolean Input so if needed, I can quickly toggle presence.

  - platform: bayesian
    name: Jake's Home
    prior: '0.1'
    probability_threshold: '0.75'
    observations:
      - entity_id: 'device_tracker.jake_pixel_xl'
        prob_given_true: '0.9'
        prob_given_false: '0.2'
        platform: 'state'
        to_state: 'home'
      - entity_id: 'device_tracker.jakes_ping'
        prob_given_true: '0.9'
        prob_given_false: '0.2'
        platform: 'state'
        to_state: 'home'
      - entity_id: 'device_tracker.jakes_2nd_ping'
        prob_given_true: '0.9'
        prob_given_false: '0.2'
        platform: 'state'
        to_state: 'on'
      - entity_id: 'binary_sensor.jake_arrival'
        prob_given_true: '0.9'
        prob_given_false: '0.2'
        platform: 'state'
        to_state: 'on'
      - entity_id: sensor.jake_ble_presence
        prob_given_true: '0.95'
        prob_given_false: '0.5'
        platform: 'numeric_state'
        above: '50'
      - entity_id: 'binary_sensor.jake_tasker'
        prob_given_true: '0.9'
        prob_given_false: '0.2'
        platform: 'state'
        to_state: 'on'
      - entity_id: 'device_tracker.tile_wallet'
        prob_given_true: '0.9'
        prob_given_false: '0.2'
        platform: 'state'
        to_state: 'home'

I use Owntracks HTTP along with MAC Address, a variety of Pings from NMAP, Tile Trackers, Arrival Sensor from SmartThings and use Presence. Works great. Just need to adjust the threshold for your needs.

1 Like

@oakbrad do you have an ibeacon that you recommend using?

Any generic one will work, only difference I can see between the ones I have is battery type.

I also do the Bayesian Sensor thing as well, here’s my config example

I use this
https://community.home-assistant.io/t/reliable-multi-user-distributed-bluetooth-occupancy-presence-detection/50674/491

2 Likes

I use this, works like a charm:

How do you send location data from Life360 to Home Assistant? I don’t see Life360 listed as a component. Have you noticed any significant decrease in your phone’s battery life using it?

I created a custom Life360 Device Tracker Platform. I know of at least a few other people that are using it successfully. I hope to submit it as a standard platform someday, but that hasn’t happened yet.

Life360 is all about providing accurate location at minimal battery usage. I’ve been using it for years and haven’t found it to be a noticeable battery drain. Sure, it uses some, but nothing that I’ve found unreasonable. We use it on both Android phones and iPhones.

If you are mostly focused on arriving home by car, this might do it.
@DrZzs has a video: https://www.youtube.com/watch?v=1DyblwsjfU8
and @luma has a tutorial https://github.com/aderusha/MQTTCarPresence

this is only tracking the car is on/off and connected to your wifi.

1 Like

Another option if you have an iPhone and appletv/home iPad/HomePod- I use the HA home kit integration and the home app to toggle presence. Home app uses Bluetooth low energy from the Apple TV/iPad/HomePod so it’s the same underlying tech, but for me it was way simpler to set up than getting own beacons, OwnTracks, etc and it’s been working for a few months 100% reliable.

There’s instructions from a user on the forums somewhere…

Also looking forward to the Apple shortcuts app and how that will work with home assistant.

Thanks for all the replies, guys. I ordered a couple BLE beacons and the D1 mini to do some testing. I’m not sure i want to use it to open my garage door for security reasons, but I would like it to turn on my front porch lights. The front porch lights use MyQ (so we can hit the homelink garage door button in our cars to turn them on) and HA doesn’t have a MyQ component for lights yet.

For now, I’d just like HA to sense our car in the garage/driveway and possibly disarm the alarm when we open the door.

Opengarage might work for you. There is native support in HA. The beauty of opengarage, because it has a distance sensor, is it’ll sense 3 states.

  1. Door open (this will assume you are home
  2. Door closed with car (this will assume you are home)
  3. Door closed without car (this will assume you are not home)

So you can setup so if it goes from door closed w/o car -> door open, you are coming home and initiate a series of events.

Edit: the other thing I liked about opengarage was, MQTT support and native HA support. So you do not need the ‘cloud’ or the app it comes with. It even has a web browser you can hit to manage it. I have nothing accessible remotely. So I can simply VPN in and do stuff.