Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 106634

If device tracker changes from not home to home within last hour

$
0
0

I have an automation that says “welcome home” whenever the front door opens, but I only want it to trigger when my wife or I actually leave the house and return home, as opposed to just checking the mail. I tried a condition like the below, but for some reason, it seems to always execute:

      - condition: template
        value_template: >-
          {{ (as_timestamp(now()) -
          as_timestamp((states.device_tracker.wife_person.last_updated))|int
          < 3600 )}}

Any input as to why that doesn’t work would be greatly appreciated!

2 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 106634

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>