Automations - conditions

hi guys,

I have a problem that I would love to get some help with, if anyone can assist me for a minuet or 2?!

Goal: Whenever my wife or I leave the house and the other is also gone, I would like to turn of the house heating. Very easy. I’ve got it almost working…

The problem is my ‘condition’ that the other person also needs to be ‘gone’ in order to turn off the heating. Today my wife left the house and I would have assumed the condition check:

entity_id: device_tracker.miphone
    type: is_not_home

would have prevented this trigger from actually turning off the heating. But instead, whilst I was home (miphone) the heating was turned off…

any suggestions? thanks in advance!!

The automation:

- id: '1633854328696'
  alias: 'No body home, heating off - Trigger:  Joanne'
  description: ''
  trigger:
  - platform: device
    device_id: 0a8042b156493b1ca60f1b2673a9ef4b
    domain: device_tracker
    entity_id: device_tracker.iphone_van_joanne
    type: leaves
    zone: zone.verwarming_schakel_zone
  condition:
  - condition: device
    device_id: 4ed629d53661604cf5482702d4da9dbe
    domain: device_tracker
    entity_id: device_tracker.miphone
    type: is_not_home
  action:
  - device_id: 0a8042b156493b1ca60f1b2673a9ef4b
    domain: mobile_app
    type: notify
    message: Niemand thuis, kachel word automatisch uitgezet
    title: Niemand Thuis
  - service: script.kachel_laag_even_weg

I have never heard of this type.

What you should have done is used a template condition, or even easier, created a group with the two device trackers.
This group will now have the state “home” if one or more people is home.

I still suggest a template condition, since zones can cause issues.

{{ states('group.family') != "home" }}

Then action turn off heating.