Or Automation help

I’m new to this or but trying to make a simple OR automation where if motion is detected and either my phone or my partners is showing home then it will call the heating however my automation is getting stuck at the first variable which is my phone not being home. I stared out the devices ID’s just in case :smiley:

  alias: Heating boost from motion
  description: ''
  trigger:
  - type: motion
    platform: device
    device_id: *****
    entity_id: binary_sensor.hivehome_com_mot003_ias_zone
    domain: binary_sensor
    for:
      hours: 0
      minutes: 0
      seconds: 0
  condition:
  - condition: or
    conditions:
    - condition: device
      device_id: ******
      domain: device_tracker
      entity_id: device_tracker.adams_iphone_2
      type: is_home
  - condition: device
    device_id: *******
    domain: device_tracker
    entity_id: device_tracker.hannahs_iphone_2
    type: is_home
  - condition: time
    after: 08:30
    before: '16:30'
  action:
  - service: hive.boost_heating_on
    target:
      device_id: *******
    data:
      time_period: 00:15:00
      temperature: 20
  mode: single

there’s no reason to block out your device_id. There’s no security related to it.

As for your question, your second device condition is not inside the or

2 Likes

Cool. I didn’t think there would be but wasn’t 100%!

Also that fixed it. Looked at it numerous times and didn’t spot that any of the times. Working perfectly now.

1 Like