Not home and not not_home

Hi, so I have an automation that kicks at times if you’re not home but I can’t use ‘not_home’ because of configured zones (I think). In Condition, for ‘state’, can I have state: not home or state: !home instead of state: not_home to catch all cases where presences is not ‘home’?

Thanks

could you post your automation here?

use condition: template instead of state

Here’s one example of such situation:

Basically kids have a webhook to start the heating in advance in their room but if they’re not home 30 minutes after they turned the heat on, it dials it back to 15C.

- id: '1578349139030'
  alias: Timer expiré - Chauffage Catherine
  description: ''
  trigger:
  - event_data:
      entity_id: timer.chauffage_catherine
    event_type: timer.finished
    platform: event
  condition:
  - condition: state
    entity_id: person.catherine
    state: not_home
  action:
  - data:
      temperature: 15
    entity_id: climate.neviweb130_climate_catherine
    service: climate.set_temperature
  - data:
      temperature: 15
    entity_id: climate.neviweb130_climate_cath_toilette
    service: climate.set_temperature

So should it become?

- id: '1578349139030'
  alias: Timer expiré - Chauffage Catherine
  description: ''
  trigger:
  - event_data:
      entity_id: timer.chauffage_catherine
    event_type: timer.finished
    platform: event
  condition:
  - condition: template
    value_template: "{{ not is_state('person.catherine', 'home') }}"
  action:
  - data:
      temperature: 15
    entity_id: climate.neviweb130_climate_catherine
    service: climate.set_temperature
  - data:
      temperature: 15
    entity_id: climate.neviweb130_climate_cath_toilette
    service: climate.set_temperature

Yep. Every other trigger or condition can ultimately be expressed as a template…they’re very flexible.

If you prefer state conditions, you can create a template binary sensor with the same value_template and test its state in condition (should be on).

Ok, thank you both.