Device tracker -- Help please! lol

Ok, so I have tried this with both state and zone… I could get it to work for awhile when I left. However, it would never work for my daughter’s phone. Now it just never triggers… At the moment I am an hour late to work, so I am calling it until later tonight…

######################################################################
## Everyone is gone          
######################################################################
- alias: 'Everyone is gone'
  trigger:
    platform: zone
    event: leave
    zone: zone.home
    entity_id: device_tracker.logan_pixel
  
  condition:
    - condition: state
      entity_id: device_tracker.samsiphone
      state: 'not_home'
    - condition: state
      entity_id: input_boolean.disable_home_away
      state: 'off'
 
  action:
    - service: script.good_bye
    - service: notify.nma
      data:
        message: "Everyone has left the home"

######################################################################
## Just Dad gone Sam Home
######################################################################
- alias: 'Rule 2 - Just Dad leaves'
  trigger:
    platform: zone
    event: leave
    zone: zone.home
    entity_id: device_tracker.logan_pixel
  
  condition:
    - condition: state
      entity_id: device_tracker.samsiphone
      state: 'home'
    - condition: state
      entity_id: input_boolean.disable_home_away
      state: 'off'
    
  action:
      - service: lock.lock
        entity_id: group.all_locks
        

######################################################################
## Just Sam Leaves
######################################################################
- alias: 'Rule 3 - Just Sam Leaves'
  trigger:
    platform: zone
    event: leave
    zone: zone.home
    entity_id: device_tracker.samsiphone
    
  condition:
    - condition: state
      entity_id: device_tracker.logan_pixel
      state: 'home'
    - condition: state
      entity_id: input_boolean.disable_home_away
      state: 'off'
     
  action:
   - service: lock.lock
     entity_id: group.all_locks
   - service: notify.nma
     data:
        message: "Sam has left the house"

I checked the states and input.boolean is in ‘off’ position so I don’t think it is that…

Have you got iCloud or Owntracks running on both phones (with gps running)?

Yep! And I can see the phones enter and leave the zones and track them without a problem. For some reason, however, the automation will not fire…

Have you tested the action by triggering it from the FE?

I’m not tracking. I can trigger the automation by itself and it runs. However, changing states on the dev panel get’s me nothing… So I’m screwing something up somewhere.

Changing states in the dev panel doesn’t affect the hardware so it won’t trigger I think, you can change the software parts like input_booleans or state of objects not connected to hardware.

What I did to test mine was create a mqtt json device tracker and published a json gps update from another phone or in my case via the command line ssh) while having the phones you are trackings wifi switched off (so it can’t interfere).

For e.g.

mosquitto_pub -h 192.168.xxx.xxx -i zanzito -P password -u username -t zanzito/Phone/location -m ‘{“longitude”:-0.9701xxx,“latitude”:51.4344xxx,“altitude”:0,“gps_accuracy”:30,“battery_level”:50.9,“tst”:1512059950}’

Ahh that makes sense. So there is no way to test the device’s triggering the automation or not outside leaving my home? What is funny is the arrival automation built nearly identically works flawlessly for my phone.

Oh ok, then once that is confirmed to work switch back to the original devices?

Nope unless you can spoof an update msg :stuck_out_tongue:

At least I don’t know of any other way :), I just used google for the nearest B&Q and then clicked on the map and in the browser http box the long and lat are given I just copied them into my msg :slight_smile:

Damn it lol. Ok, so off to MQTT it is. Talking right now is making me think my daughter’s phone is the damn culprit. I am going to remove her phone, and when I go to get her from soccer practice, I can see if it trips.

Yeah if it doesn’t work with just my phone tracked im doing that for sure. Too old and fat to keep walking down the street lol.

1 Like

lol same here :smiley:

lol thanks for the input I will give it try and report back!

Here’s my config - I use zanzito on my samsung but owntracks will do the same thing, so now I can push a msg via the shell and the map will show me in morrisons or b&q or where ever and then I can also push a msg from my phone over data via either owntracks or zanzito to put me back at home :slight_smile: (both have either a heatbeat (zanzito) or a forced msg (owntracks), which will push a msg of your current location - provided you have a gps fix)

device_tracker 6:
  - platform: mqtt_json
    devices:
      MyPhone: zanzito/Phone/location

zone:
  - name: 'B&Q'
    latitude: 51.4242192
    longitude: -0.9816402
    radius: 100
    icon: mdi:worker

Awesome thank you! This process will continue in an hour lol for now it’s back to the christmas lights.