Do something at a defined UTC time, ignoring BST / DST


#1

1) Give a description of the problem
I want to have my solar blinds close at an absolute time, regardless of daylight savings, so I need to know whether to subtract an hour off the time the hub is using.

Currently I’m using “every day, at 13:00:00”
I want to use an expression in place of the 13:00 that evaluates to 12:00 UTC during the summer, by subtracting 1, and to 12:00 UTC in the winter by subtracting zero.
Or a completely different approach where I can specify a time trigger in UTC, not local time.

Put more simply, is there an expression that evaluates to the current UTC offset?

Thanks

James


#2

The expression:
round((($localNow-$utc) / 3600000.0),0)
returns an integer based on offset.
(Note the point zero is required for accuracy)

It goes up (or down) a single number twice a year.

IE: New York returns -4 now, and -5 later in the year.


#3

Thanks - that’s perfect - I did not think of deriving it!


#4

What I do is, I have a single piston that grabs the offset daily, and stores it in a global integer variable.

This lets dozens of pistons refer to that global, without inserting the previous code in multiple pistons.

Here is a snippet, with certain elements hidden in red for privacy.

Normally, XXẊ and YYY are the three capitalized characters for time zone
(spelled differently depending on the time of year)

X and Y are the integer offsets.


Perhaps you can solution one of my posts above to help others?