FEATURE ENHANCEMENT: add time offsets to Time Variables in Rule Machine

In IF THEN and ELSE IF statements using Time Range please give the option for Time Variables to have offsets in minutes. This would be similar to the Sunrise and Sunset offsets in minutes.
To simplify my logic when adding or deleting a time range in a cascade of IF THEN and ELSE IF statements please add the capability to do a logical time comparison like >Sunset, <=Sunrise-30 or =Variable.

2 Likes

Welcome to the Community @coralcovect2005 .

Do you have an example of a situation where this would be useful, perhaps even a screenshot of an example rule? If you can't post an image let us know, there is a quick process to get that sorted out.

2 Likes

This is the longest rule

Sorry to get off on a tangent but you have a malformed ELSE-IF dealing with the K Lamp

ELSE-IF ( AND NOT K Lamp switch off) THEN

If you turn K Lamp switch to on, does the ELSE-IF evaluate as true? If so, it should be okay but I'd still fix it.

2 Likes

Thanks, got it fixed and also updated all of the evaluations to use the variable plus an offset.

When you set a variable, all of these options are available to you. Sometimes you may need to do that first. See here the variety of choices for setting a DateTime variable:

Now, if I select Sunrise, the option to add an offset shows up:

Later, if I want a Condition of <=Sunrise-30, I could pick that variable:

In the case of Between Two Times with Sunrise or Sunset, the offset can be added right there.

If you want to have an offset from a variable, you could add that when you set the DateTime variable, or use another one:

1 Like

Now I realze that I should have stated that my request is for an offset in minutes when using Between Two Times. For one of my ELSE IF sections I need to use specific times of day, not related to sunrise or sunset. I'd like to have a time offset instead of creating a second variable.

1 Like

I understand. But the downside is more and more complexity for the app, that is already very complex.

I will look at it. Can I assume you are only talking about a variable start or end time of the range?

@coralcovect2005 - In this case at least, what does the offset represent compared to the times you already capture in the variable(s)? i.e. what is it you wanting to adjust and why are you wanting to adjust it?

The option for an offset from a Variable time will be added in the next release. Looks like this:

4 Likes

thanks for the quick fix

2 Likes

In latest release.

1 Like

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