I have one automation that behaves very strangely in my opinion and I cannot really understand why.
In the first step I want to compare the current time against a input_datetime. It should trig if the current time is before the input_datetime. However, it seem to not follow the pattern I expect. When the automation runs, the input_datetime is approx 13 h before the current time, but the automation any way consider the opposite. What am I doing wrong?
Yes, the time condition passed, but I would expect it to not pass? Or am I thinking incorrectly here?
My thought is that the condition is “if time is before X”. That is time < X. Meaning now (2024-11-09 09:11:00) < 2024-11-08 19:43:52. In my opinion the current datetime should be larger than (not smaller than) the previous? Or is the “time before” actually only comparing the time component, not datetime?
Thank you for the answer. This explains it fully - I made a too strong assumption that it compares both time+date and not just time. I couldn’t find any premade function similar to the time trigger but with datetime consideration instead of just time. I handled it now in a template within the automation, but it decreases the readibility.
I have another issue in the same automation. I have few conditions similar to the following:
At some points, but not always, when I have edited the automation and save it, it changes |int(default=99) to |int(default(99)). Afterwards, the automation fails due to incorrect syntax. What could cause that?