Automation with consider home less then 1 minute


I use an automation that when I open the door turn on an scene using a condition ‘not home’.

This is the automation:

  • alias: “Chegar casa”
    platform: state
    entity_id: binary_sensor.porta
    to: ‘on’
    condition: state
    entity_id: group.tracker
    state: ‘not_home’
    service: scene.turn_on
    entity_id: scene.chegar_casa

But it replace my old USB bluetooth and the new bluetooth detects my phone even when I am outside home.

I want a condition that consider at home less than 1 minute, I think is enough, and I could not find any example.

The condition I want to use is possible?

Sorry for my english.




I’m looking for the exact same thing!

Did you find anything?

I din´t find :frowning:

Probably not the most elegant solution but you could probably make an input_boolean that acts as your condition. Replace your current condition with the state of this boolean. Then make an automation something like:

  platform: state 
  entity_id: group.tracker
  from: 'not_home'
  to: 'home'
  - service: input_boolean.turn_on
    entity_id: your_boolean
  - delay:
      minutes: 1
  - service: input_boolean.turn_off
    entity_id: your_boolean

Hopefully that makes sense and is actually what your looking for.

Thanks for sharing.

When I have time I will try this option.

Not entirely sure about the logic, help me out:

if sensor is triggered (PIR? Wifi? BT?) >> if noone (??) is home >> then run scene ?

Is the ‘not_home’ because with previous adapter your phone would not be detected yet ?
The issue is that your 'home' or 'not_home' state will depends on what is your device.tracker, what are you using (can you post the configuration please)?

I guess I would create binary sensor to know if its the first arrival or subsequent one. (But again that depends on the logic and behavior of device tracker).
Then you can give that binary sensor some values, for example “a chegar” would be when device tracker is still not home AND at the same time the device you are tracking (mobile phone?) is already connected to your wifi or visible to your Bluetooth tracker and “chegou” when the device tracker already assumed your are home (depending on the settings) …