Why wont this work? now().date() > strptime(states('input_datetime.saveddate'), '%Y-%m-%d %H:%M:%S.%f')
Is it at all possible to compare 2 dates and ignore the time portion?
I have an automation that i want to trigger once, every day when i get home from work after 4 pm.
I have the trigger configured, but it triggers everytime i leave the house, and come back after 4 pm.
I only want it to trigger once every day.
When my automation triggers i save the current date to input_datetime.saveddate.
Next time it triggers i want it to check if todays date is greater than the date stored in input_datetime.saveddate
I have 10 years of coding experince in C#, java, SQL and so on. But for the life of me i cant figure out the syntax of this
The idea here is if the automation hasn’t triggered in the last 24 hours then it is allowed to trigger now. All subsequent attempts to trigger are blocked for 24 hours.
Easy peasy. Use this in the automation’s condition. If the automation’s last_triggered date is the same as today, the automation’s action won’t be executed.
It’s an easy fix but you appear to be steadfastly determined to use a helper (to store the trigger datetime) so I won’t keep trying to convince you otherwise.