Ecobee Automation Control Problem

Hi Community…

I need some help verifying this automation. I cannot get it to control my Ecobee. I am at a loss as I have tried everything I can come up with but nothing works so far.

alias: Ecobee - GeoFence Set Away Mode
description: Turn ECOBEE Thermostat to away Mode when everyone leaves home
trigger:
  - platform: zone
    entity_id: device_tracker.sm_s928u
    zone: zone.home
    event: leave
  - platform: zone
    entity_id: device_tracker.yamilizas_iphone
    zone: zone.home
    event: leave
condition:
  - alias: Javier and Yami have left home
    condition: and
    conditions:
      - condition: state
        entity_id: device_tracker.sm_s928u
        state: not_home
      - condition: state
        entity_id: device_tracker.yamilizas_iphone
        state: not_home
action:
  - service: climate.set_preset_mode
    target:
      entity_id:
        - climate.ecobee_plus
      device_id: ba8ba0d027158055e8d2987370674d01
    data:
      preset_mode: away
mode: single

could have several things go wrong that isn’t evident in just the automation. e.g. if there’s a zone created around the home zone, you can leave the home zone, but your condition may fail b/c instead of being not_home, you’re in another zone.

but this sort of thing is usually pretty straight forward to figure out with tracing. what does the trace say? does it trigger? if it bails out, what’s the entity states at trigger point?

btw… why specify the device_id? you already have the entity_id. just curious.

I’d simplify my trigger to

trigger:
  - platform: numeric_state
    entity_id:
      - zone.home
    below: 1

Trace should reveal what is happening.
You can go the the Developers Tools > STATES tab and pull up zone.home and set the state to 0, 1, 2…etc. to test the automation trigger.

I was just trying different things and when I pasted the code, that just happen to be what I had tried last.

After posting the thread I did went to the "Developer Tools and was able to find what the problem was with the automation.