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

How to calculate a constant time of a given date (yesterday)?

$
0
0

@jegember wrote:

Hi guys, I’m stuck a bit with a date calculation. I’ve got a hot water circulation script, that circulatest the water in the morning (before wake up). I wanted to add a condition that checks if there was somebody in the house after 8:00PM Yesterday or e.g. left for vacation and no circulation is needed in the morning.

So I wanted to do something like: “If there was a movement after 8:00PM Yesterday then circulate, else don’t”.
I’m struggling with getting the time for 8:00PM Yesterday. I managed to extract the day for yesterday, but I do not really know how to build up (concatenate?) the whole date&time from this:

{{ (as_timestamp(now()) - (24*3600)) | timestamp_custom('%d', True) }}

Thank you very much in advance!

Posts: 3

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 96121

Trending Articles



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