Help with my device tracker used as condition

i need help with home/no_home switch

im using this as a switch/detection

- platform: template
  sensors:
    people_home:
      entity_id:
        - device_tracker.WIFE
        - device_tracker.KIDS
        - device_tracker.HUSBAND
      value_template: >-
        {{ is_state('device_tracker.WIFE', 'home')
           or is_state('device_tracker.KIDS', 'home')
           or is_state('device_tracker.HUSBAND', 'home') }}

I need this binary switch used as my condition so that i can make an automation that will turn off all my lights when no one is home ALL DEVICE IS DISCONNECTED and turn on my light if ATLEAST ONE OF THE DEVICE IS CONNECTED/HOME; my binary switch only stays on … doesn’t turn off even if all the devices are disconnected

- alias: SHUT DOWN EVERYTHING - no one is home
  trigger:
    platform: state
    entity_id: binary_sensor.people_home
    from: 'on'
    to: 'off'
  action:
    - service: homeassistant.turn_off
      entity_id: switch.switch_5
    - service: homeassistant.turn_off
      entity_id: switch.switch_1

and

- alias: light (Turn on) 
  trigger:
    platform: time
    at: '19:59:59'
  condition:
    - condition: state
        platform: state
        entity_id: binary_sensor.people_home
        state: 'on'
  action:
    - service: homeassistant.turn_on
      entity_id: switch.switch_5
    - service: homeassistant.turn_on
      entity_id: switch.switch_1

You should remove the entity_id list from your sensor and only include the value template.
Also, I’m pretty sure that the value of your sensor will be true/false not on/off.

See samples here:

I think this is overkill for what you’re trying to achieve.

Simply put the device trackers into a group, and use the state of the group for your first automation trigger and second automation condition.

hahaha true that… what the heck am i thinking… thank you thank gotta keep it simple

1 Like