automation:
- alias: "Just arrived home"
trigger:
- platform: state
entity_id: device_tracker.your_phone
to: 'home'
condition:
- condition: not
conditions:
- condition: state
entity_id: binary_sensor.door_vibration
state: 'off'
for: '00:05:00'
action:
...
When your phone is detected as arriving home it will check to see if the door sensor has been off for no more than 5 minutes. The state will either have to be on or it will have been off for less than 00:05:00.
Wouldn‘t that mean that the sensor needs to be triggered before the state of the tracker changes to home? The phone connects to the wifi way sooner that I can trigger the vibration sensor
So I figured something out now. It isn‘t the best solution but it works. I tried yours but for some reason it didn‘t really work.
I created one Automation, which starts a script when my phone gets detected. The script sets a inlit boolean to true for 5 Minutes and than turn it back off again.
Another Automation will trigger by the sensor but only if the input boolean is on
Nice, this is what I was looking for, I’m making an automation to trigger an Alexa Actionable Notification when get home and open the door to ask me if I want to turn some lights on. As I’m using the new zone entities number value with gps location to determine who is at home, when I open the door I’m already “at home” so the automation won’t trigger. Could you show me your automation and script to set the boolean?