HA + Nabu Casa GPS not good to know if i'm home

Hi there! My first post here so please let me know if i can add some info or anything else!

I’ve tried looking around the topics and googling in general but i haven’t found exactly my question.

My situation is, i’m using Nabu Casa to know when the people in my house are home to run certain automations or not.

The first problem, the default zone for home is too wide, i dont want HA to think im home when im 100m away? I have some stores and shops that close (i’m in an apartment).

The 2nd problem, i created a 2nd zone that i use for Home, which is around 35m in diameter, but the problem is that it seems that nabu casa relies only on GPS to detect if im home or not, and both my phone and my wife’s GPS put us right on the edge of the 35m area. So, simple automation liek turning some lights on and off while im at home are not working because HA thinks im outside.

How come HA can’t detect im home by just checking that my phone is on the same network as the server?

Is there anythin i can do to fix this?

Bonus question, suddenly my macbook air is also showing up in the map, i dont need that so how do i disable that?

Some images for help (couldn’t add my 2nd image where i test my “am i home” step and it fails, while sitting at home)

EDIT: I’m feeling more puzzled now because the Device page for the IPhone shows “Home” and i even see the log “was deteced at home 5min ago” but when i test the automation it doesn’t pass. Here’s the YAML for it.

alias: Luz de noche - Javi
description: "" 
trigger:
- platform: time 
  at: "22:30:00"
condition:
- condition: device
  device_id: 27d772b6176d34df3f629ad1000c5992
  domain: device_tracker
  entity_id: 7ade941e867799a604a6c1fc748e8346
  type: is_home action:
- type: turn_on
  device_id: 18715655904fa05d0769dd58bad55084
  entity_id: ba8e223e28ca20c45f64f300bf774b32
  domain: light
  brightness_pct: 30
mode: single

EDIT2: I tried expanding the home zone to envelop what i shows as teh area for my phone, but the automation still says “condition did not pass” for the “is_home” value.
Also tried removing the server from the phone, and removing the device from the Mobile App Service to set it again from scratch, still showing “home” in the Diagnostic but not passing for the automation condition :confused: im clueless

EDIT3: I Went into the mobile app devices list, and hit reload on my iphone and now it detects correctly at home, i will come back and let you know if i see that this happens again and maybe get some help on how to handle this issue.
But for now, thanks for the help and the nice ideas for other approaches :slight_smile:

Is this a copy and paste error?

They should be on seperate lines.

  type: is_home 
action:

to make wifi ssid set home, here’s a way (maybe someone will school me with a better way though!)

if you go to settings->companion app->manage sensors
way down the scroll in network sensors, there’s a “wifi connections” sensor. turn that on. then that will give you a sensor reporting what wifi network the device is connected to. you can create a binary sensor around that reports “on” if it == your home ssid.

then do this:

trigger:
  - platform: state
    entity_id:
      - sensor.my_phone_wifi_connection
condition: []
action:
  - service: device_tracker.see
    data:
      location_name: >
        {{ 'home' if (states('sensor.my_phone_wifi_connection') ==
        'my_home_wifi_ssid') else 'not_home' }}
1 Like

Yeah sorry, since i can’t copy and paste from HA for some reason i had to copy from a screenshot and its not perfect :sweat_smile:

I thought about this but i have a few access points repeating the same wifi name, but with different SSIDs which seems cumbersome to configure :confused: maybe i will try this if nothing else works though. Also it would stop working if i need to switch off my WiFi for some reason which is not great

wrt switching off wifi: true.
checking mutliple ssid’s not hard:
{% set at_home = 'my_ssid2' in ['my_ssid1', 'my_ssid2', 'my_ssid3'] %}

2 Likes

I like it!

I will keep this just in case, honestly i want Nabu Casa to work fine because i want to support HA and it if it makes my life easier then good, but if it keeps flunking out like this i might just switch to your solution to know if im home or not, thanks!

you could use it one way… to assert home but not assert not_home… since you are unlikely to get a false positive

1 Like

Nabu Casa has nothing to do with your GPS positioning. GPS positioning occurs locally on your devices. The main thing Nabu Casa provides is a method to access your HA instance remotely and for the mobile app to be able to send collected device data back to your HA instance. Even if you go with @armedad’s solution of checking the SSID, that still requires a way to connect to HA remotely.

What you are encountering is GPS drift. It’s not uncommon in large buildings and densely populated areas and also not uncommon with some iPhones in general. There’s really not a lot that can be done to solve that aside from trying to leverage other forms of tracking (again, as @armedad stated). Case in point, I leverage both GPS and SSID checking for my own detection on my 15 Pro Max simply because my phone tends to drift 50m-75m daily. Then it corrects itself again after a short period of time.

1 Like

Yeah i feared as much, and honestly i still want to support HA’s devs so i will probably keep my sub to also access things from outside if i need to see cameras or something.

But i really need a better home presence system because it already happened many times that my iphone GPS drifts away and triggers automations that should only happen when no one is home… this morning my vacuum started it’s plane engine noise because my wife left and for some reason my phone was detecting just outside the range of my home :/.

Do you know if i can make a reliable tracking system with matt? I can’t find any guides on how to set that up for any phones, i have already installed MQTT to get data from my PS5 status, but even readin the official docs on MQTT and device tracking my brain hurts and i cant figure it out…

I’m going to try first with the wifi ssid first and then maybe some OwnTracks app i read about

The wifi SSID way is not great because the sensor takes really long to update, i came home and it’s been like 10m and it still detects me as away due to that :confused:

Im gonna use the WIFI system for now and see how annoying it is for some of my automations, especially the ones that trigger when i get home. But for now it seems ok-ish.