How can I trigger on ANY state other than home?

I’m setting up a thermostat in hassio and I want presence detection so that it switches off when no one is home. I have set this in automation, with the trigger as not_home, but there are other states other than home which take precedence over not_home, i.e. driving, places, moving etc. How can I get the automation to trigger on anything that is not home?

  trigger:
  - entity_id: device_tracker.life360_me
    for: 00:15:00
    platform: state
    to: not_home
  condition:
  - condition: and
    conditions:
    - condition: state
      entity_id: device_tracker.life360_wife
      state: not_home
    - condition: state
      entity_id: device_tracker.life360_kid1
      state: not_home
    - condition: state
      entity_id: device_tracker.life360_kid2
      state: not_home
  action:
  - service: climate.turn_off
    from: home

instead of:

    to: not_home

For the conditions you will have to use templates, e.g.

    - condition: template
      value_template: "{{ not is_state('device_tracker.life360_wife', 'home')  }}"
1 Like

Thanks. How do I format that in the conditions?

Too quick. I just edited my post. Refresh the page.

Then add your vote to this:

1 Like

Vote added and thanks for the solution :+1:

1 Like