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

Triggering an automation when a state has been *from* (not "to") for X time

$
0
0

@mikeage wrote:

Hi,
I want to trigger an automation whenever my device_tracker has been not home for a certain amount of time. The following does not work, because from: apparently doesn’t work with for:

automation:
  trigger:
    platform: state
    entity_id: device_tracker.foo
    from: "home"
    for: "00:10:00"

I can’t use to: "not_home" (which does work with for:), because I have device trackers that report zones, and I’d rather not list all of my zones in the to: field (and in any case, if they’re moving between two zones, or between a zone and the generic not_home, I’d like to combine the times when counting how long they’ve been away from home).

Any advice?

Posts: 4

Participants: 3

Read full topic


Viewing all articles
Browse latest Browse all 95919

Trending Articles



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