Zones - not firing : soooo frustrated

I have read loads of threads here on similar issues and would so welcome any thoughts from people on how I can make simple leaving and coming back home automation using zones to work… They are not firing at all…

I have HA and my network linked so am using WIFI status as the trigger…

See my code below, I am wondering if there is something going on with the device IDs morphing somehow?

alias: Leaving the House
description: When both Neil & Tanya Away
trigger:
  - platform: device
    device_id: b3db4a52e21c72e52c6de19198a6194b
    domain: device_tracker
    entity_id: c2110e77f8e57422b39c20c85d90aced
    type: leaves
    zone: zone.home
condition:
  - condition: device
    device_id: e6c0f12b715413fe2c247b7465b2ee8f
    domain: device_tracker
    entity_id: 8f7ef4a76b4ef54636a21d9e2c59b071
    type: is_not_home
  - condition: not
    conditions:
      - condition: zone
        entity_id: person.tana
        zone: zone.home
action:
  - type: turn_off
    device_id: 42b58284c7887b31b82308af9dbab0d5
    entity_id: dbead8d0944cc46ae9981dce5f3a34e0
    domain: switch
  - type: turn_off
    device_id: eb0c762bf585c20e87aa37324c343022
    entity_id: 8fbada8a5decb4e4e7ac4a78d729dd46
    domain: switch
  - type: turn_off
    device_id: f0572961e3e0ff91f128f1d5b2d5f30e
    entity_id: d953331b839390adf205eff54f7fcce1
    domain: switch
mode: single

Device_trackers without GPS coordinates will not trigger a zone trigger. You have to use a state trigger.

Zone triggers are for any entity/device_tracker that has a latitude and longitude associated with them.

I.e. Things created by your router will not work with a zone trigger because your router is not going to provide GPS locations.

1 Like

thanks for the input… I moved from geo to zone and devices as person updates were not firing either

HA seeing location changes though to the HOME zone for the device

Use the device tracker with a state trigger. Which I already said, and you just admitted to not trying. So please, take the advice given previously.

1 Like

Have i configured the state correctly ? Still not working…

alias: Neil Leaving the House
description: When both Neil & Tanya Away
trigger:
  - platform: device
    device_id: b3db4a52e21c72e52c6de19198a6194b
    domain: device_tracker
    entity_id: device_tracker.neil_personal_orca
    type: leaves
    zone: zone.home
  - platform: state
    entity_id:
      - device_tracker.neil_personal_orca
    attribute: source_type
    from: router
condition:
  - condition: device
    device_id: e6c0f12b715413fe2c247b7465b2ee8f
    domain: device_tracker
    entity_id: device_tracker.tanya_iphone12max
    type: is_not_home
  - condition: not
    conditions:
      - condition: zone
        entity_id: person.tana
        zone: zone.home
    enabled: false
  - condition: device
    device_id: 055ca1fa9bdc03eaca738cc319536eec
    domain: device_tracker
    entity_id: 65092aa425c160d5120f265e9b171c49
    type: is_not_home
    enabled: false
  - condition: device
    device_id: ae95b20f7447e096f691bd0d3a08d823
    domain: device_tracker
    entity_id: 347d7c015ff4b0b0951b37abadc022bb
    type: is_not_home
    enabled: false
  - condition: device
    device_id: a575adfbe1a0372178bc2c719f911632
    domain: device_tracker
    entity_id: 28972da1d41bdd091fbde871aba6380a
    type: is_not_home
    enabled: false
action:
  - type: turn_off
    device_id: eb0c762bf585c20e87aa37324c343022
    entity_id: switch.cctv_tv
    domain: switch
  - type: turn_off
    device_id: f0572961e3e0ff91f128f1d5b2d5f30e
    entity_id: d953331b839390adf205eff54f7fcce1
    domain: switch
mode: single

No, the state of the device_tracker will be home or not_home. So, the from field should be home, and to should be not_home. And you filled out attribute, which shouldn’t be used.

Thanks for the steer Petro and understand now what you are sayign to do, but cant seem to find which attribute from the device tracker is storing home or away…

Appreciate your continued input as i try to work this out

ignore, I don’t think i need to define an attribute for it.

Thanks for all the help Petro : have it working via state changes.

That’s correct, you do not define an attribute. It’s the main state, which is not an attribute. I.e. leave attribute blank.

1 Like

Thanks again Petro, your inout was so appreciated and have the automations working using state.

To simplify management of members of the automation, i setup a switch group in helpers. In order to swap out individual devices in my automation actions, I was hoping to use the switch group. Tried adding the switch group via a device but not showing up as the group doesn’t have a device ID…

Is there a recommended way to use switch groups in automations?

Don’t use device triggers, conditions, or actions. They are bound to devices. Use any of the other triggers, conditions, or actions.

Was thinking that wasnt the best way to do it… Thanks for confirming…

Is there another way you would recommend to save on updating a group or some collection once and then applying it to all of my automations for the same actions being applied? Eg of my current acitons below in one of my autoations

possibly using a scene for turning ON and another scene for turning OFF?

Appreciate all your input and recommendaiton.