How To Implement 'After X o'clock' Condition?

I have a rule that is triggered on a temperature change, and if several environmental conditions are satisfied, I am notified to do something.

I want to add an 'OR time is after 8:30 AM'

Using 'Between two times' isn't terribly elegant:
image
Is there a better way?

There is no other way to do it. What does "after 8:30 AM" mean all by itself? For eternity? Until tomorrow? That's why you have to give it a time window.

1 Like

Is it possible to do Time Since on a variable and if that time hasn't been reached, the value would be negative, zero if exactly that time, and positive if after that time?

No, Time Since Event only works with devices.

Feature request please:

Time since (always current day)

If specified time hasn't yet been reached, return the number of (negative) seconds until specified time
If specified time is exactly (1 minute percision) the specified time, return zero
If specified time has passed, return the number of (positive) seconds since specified time

You are effectively using "between 2 times" when you do this, the end time being midnight.

4 Likes

I think you're correct; I'll try that, thanks.

1 Like

You can do time arithmetic with variables. For example, you can set a DateTime variable to current time, or a specific time. You can them set a Number variable to the difference between them in minutes.

There you go, exactly what you want: negative number of minutes, zero when the same, positive number of minutes.

But, using Between Two Times is a vastly simpler way to go.... :sunglasses:

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.