Multiple "states" in condition automation?

In short, I’m trying to make both Ecobee thermostats set to away IF 2 devices in the house are not set to 'Home".
My automation has an AND condition that says that both devices states must be ‘away’ before the automation kicks in.

My issue is that when using zones and nmap, our devices show that we’re at a work zone and not in a ‘home’ or ‘not_home’ state.

How would I incorporate those without having 12 conditions to make sure that it triggers when we’re NOT home?

Specific automation:
- alias: US Ecobee Away trigger: platform: state state: 'home' entity_id: sensor.select_mode_up condition: condition: and conditions: - condition: state entity_id: 'device_tracker.pixel_andrew' state: 'not_home' - condition: state entity_id: 'device_tracker.galaxy_bri' state: 'not_home' action: - service: notify.notify data: message: "Thermostats set to Away" - service: climate.set_away_mode data: entity_id: climate.upstairs away_mode: true - service: climate.set_away_mode data: entity_id: climate.upstairs away_mode: false

You can use a template: condition :

...
conditions:
  - condition: template
    value_template: '{{ states.device_tracker.pixel_andrew.state != "home" }}' 
...
1 Like

couldn’t you put both devices in a group and then use the from: to: to trigger the state change - before you get to another zone, you’ll be not_home I guess…

if not, you could just use the from: home as the trigger…

Thanks a bunch for your recommendation! I’m still trying to learn the code and didn’t realize that you could put “not” in a template like that. Trying it now.

Thanks guys, the template condition saved me!