Have a rule that looks at a date/time coming from a Amazon JSON string. It uses the alarm value from it and then calculates the difference in minutes before it goes off to control a HUE light.
In OH 3, this DST value changed based on Spring forward an hour and Fall back an hour. This wasn’t the case with OH 2.
var setAlarmTime = ZonedDateTime.parse(alarmdate + "T" + alarmtime + "000-05:00[America/Chicago]") // have to change to 06:00 in fall
Is there a way to detect when DST happens within OH and then set the variable offset from -05:00 to -06:00 and visa versa?
you need to play around with the awk arguments to e.g. add the hour/minute/second when the change exactly will take place.
Without piping zdumps output into awk the output looks like:
America/Chicago -9223372036854775808 = NULL
America/Chicago -9223372036854689408 = NULL
America/Chicago Sun Mar 13 07:59:59 2022 UT = Sun Mar 13 01:59:59 2022 CST isdst=0 gmtoff=-21600
America/Chicago Sun Mar 13 08:00:00 2022 UT = Sun Mar 13 03:00:00 2022 CDT isdst=1 gmtoff=-18000
America/Chicago Sun Nov 6 06:59:59 2022 UT = Sun Nov 6 01:59:59 2022 CDT isdst=1 gmtoff=-18000
America/Chicago Sun Nov 6 07:00:00 2022 UT = Sun Nov 6 01:00:00 2022 CST isdst=0 gmtoff=-21600
America/Chicago 9223372036854689407 = NULL
America/Chicago 9223372036854775807 = NULL