I want to have my lights turn on when no one is home. And NOT turn one when one person is home.
I made the following automation but it is not working: (I am using Bluetooth and a PI3B+)
alias: Home mode
trigger:
- entity_id: device_tracker.iphone1
platform: state
to: home
trigger:
- entity_id: device_tracker.iphone2
platform: state
to: home
condition:
condition: or
conditions:
- condition: state
entity_id: 'device_tracker.iphone1'
state: 'home'
- condition: state
entity_id: 'device_tracker.iphone2'
state: 'home'
action:
- entity_id: scene.normaal
service: scene.turn_on
but for some reason this is not working. It is not firing when one of us arrives home when the other is not home and it is firing when one of us IS home and the other comes home…
I also tried to split them like so but no succes either…
alias: Home mode - 1
trigger:
- entity_id: device_tracker.iphone1
platform: state
to: home
condition:
- condition: state
entity_id: device_tracker.iphone2
state: away
action:
- entity_id: scene.normaal
service: scene.turn_on
_
alias: Home mode - 2
trigger:
- entity_id: device_tracker.iphone2
platform: state
to: home
condition:
- condition: state
entity_id: device_tracker.iphone1
state: away
action:
- entity_id: scene.normaal
service: scene.turn_on
people:
name: People & Devices
entities:
- device_tracker.device_1
- device_tracker.device_2
This group will only show not_home when both devices are not home; if either or both of them are home it will show home, i.e. the first one coming home will trigger the automation the second one won’t.
Your automation would then look like this:
- alias: Home mode
trigger:
- platform: state
entity_id: group.people
to: 'home'
action:
- entity_id: scene.normaal
service: scene.turn_on