Device tracker automation

Hi, I am new in Home Assistant. My first goal is to track when my kids get home. I have this working and I can see it in the dashboard. What I cannot figure out is how it can send me an email when the kids arrive home.

Can please someone help ?

Thank you.

Look at the notify component


Can help you to setup smtp notifications via smtp email.

I am having trouble getting device tracker automations to work. I have two automations that are very similar. One works and one doesn’t and I can’t figure out why.

This automation detects when I arrive and it works fine:

  # Any device can indicate that I am home.  If any device can see me, I should be here.
  - alias: Jeremy Detected Live
    initial_state: True
    hide_entity: False
    trigger:
      - platform: state
        entity_id: device_tracker.jeremy_phone_bt, device_tracker.jeremy_phone_ip
        from: 'not_home'
        to: 'home'
    action:
      - service: input_boolean.turn_on
        entity_id: 
          - input_boolean.jeremy_home_live
          - input_boolean.jeremy_home

This automation should detect when I leave. It never updates.

  # All devices need to agree that I am not home.  Any device can trigger the checking of whether all devices indicate I am gone.
  - alias: Jeremy Gone Live
    initial_state: False
    hide_entity: False
    trigger:
      - platform: state
        entity_id: device_tracker.jeremy_phone_bt, device_tracker.jeremy_phone_ip
        from: 'home'
        to: 'not_home'
    condition:
      condition: and
      conditions:
        - condition: state
          entity_id: device_tracker.jeremy_phone_bt
          state: 'not_home'
        - condition: state
          entity_id: device_tracker.jeremy_phone_ip
          state: 'not_home'
    action:
      - service: input_boolean.turn_off
        entity_id: 
          - input_boolean.jeremy_home_live
          - input_boolean.jeremy_home

Any ideas on what is wrong?

I figured it out. I had the initial_state of the non-working automation set to False which made it so the automation never ran.

@RonJ103, this is exactly the approach I’ve been gravitating toward, so it’s awesome to see this example of it working as intended. Did you try with any other tracking components? I don’t keep my BT on but I like the idea of using ping or nmap to verify that a device is gone, as long as I won’t get false negatives.

My problem with now with router tracking through AsusWRT is that one phone constantly goes into sleep mode and gives false negatives on presence, which triggers a bunch of unintended consequences…

I currently use this approach with bluetooth, wifi (nmap) and GPS with zanzito (was using owntracks). If any source says I’m home, my status will indicate home. In order for my status to change to away, all sources must indicate that I am away. This seems to help avoid false triggers and has been working quite well for me.

I see all these examples with ‘value’ in quotes. I put the values in quotes but it keeps removing them. Here’s the automation I’ve got. It runs when triggered manually, so I know the triggers are the problem.

- id: '1527986882929'

alias: Front Light - Arrival
trigger:

  • entity_id: device_tracker.b4f7a1e3bdad
    from: not_home
    platform: state
    to: home
  • entity_id: device_tracker.b4f1daefb5c7
    from: not_home
    platform: state
    to: home
    condition:
  • after: sunset
    before: sunrise
    condition: sun
    action:
  • data:
    entity_id:
    • light.front_entryway_light_7
      service: light.turn_on

Any thoughts? If it’s the quotes, how do I get it to stop deleting them? I can do this easily with PLEG on the Vera, but I’m working towards using it for little more than the device radios…

Hi,

Can anyone let me know why this boolean isn’t turning on?

 - alias: Enable Richard arives home Trigger
   trigger:
     - platform: time
       at: '13:00:00'
   condition:
     condition: or
     conditions:
       - condition: state
         entity_id: device_tracker.richard_pretious
         state: 'away'
       - condition: state
         entity_id: device_tracker.richard_pretious
         state: 'work'
   action: 
     - service: homeassistant.turn_on
       entity_id: input_boolean.trigger_richard_home

The boolean turned on at 19:56 for 28 minutes, but I arrived home at 18:12 and I want it to turn on at 13:00.

Any idea why the input_boolean never updates?

Both of the device trackers work fine and update their status correctly.

- alias: everyone at home
  initial_state: true
  trigger:
    - platform: state
      entity_id:
        - device_tracker.XX_XX_XX_X1
        - device_tracker.XX_XX_XX_X2
      from: 'not_home'
      to: 'home'
  condition:
      condition: and
      conditions:
        - condition: state
          entity_id: device_tracker.XX_XX_XX_X1
          state: 'home'
        - condition: state
          entity_id: device_tracker.XX_XX_XX_X2
          state: 'home'
  action:
    - service: input_boolean.turn_on
      data:
        entity_id: input_boolean.all_home

Thanks in advance

I think that the only state values that the device_tracker has are ‘home’ and ‘not_home’

It does not recognize ‘away’ and ‘work’