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

Get time door closed after it was opened

$
0
0

I use a Google home to play rain sounds for my daughter’s nap. I’d like to set up an automation so that when I get her up from a nap the Google home stops playing the rain sounds automagically. The thing that is making this tricky, is I only want it to turn off if the door has been closed for more than 45 minutes. This is because I have to go in there sometimes a few times while she is falling asleep to put her stuffed animal back in her bed or whatever, and I don’t want it turning off when I go in there for that.

I have a contact sensor on her door. I tried adding this condition to my automation, but it is always false because the last_changed value is showing up as when the door was opened, not when I closed it.
{{ (now() | as_timestamp) - (states.binary_sensor.baby_door.last_changed | as_timestamp) > 2700}}

Is there a template variable or something I could get when the door was last closed?

2 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 103432

Trending Articles



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