Hi,
In a script I added a time check to stop a fan in the evening so that it would not bother anyone sleeping. Some time later I noticed that the time check stopped in the middle of the day thinking it was midnight. Looking at the log file you can s ee that at 14:55 local swedish time the script thought it was 23:59 and turned off the fan.
app:8462024-07-24 14:55:56.275debugThe time is 2024-07-24T23:59:00.000+0200 which means the restriction for keeping the fan on has been readched. Turning fan off
I am fairly new to Groovy so I may have done something unintentionally but I don't think so. As far as I can see I have not used any intentional altering of the time zone. These are the two methods that control the time restriction:
// ----------------- Time limit for the App to be active ------------------------------------------------
def isActiveTimeApp() {
// log.info "Evaluating isActiveTimeApp()"
def now = new Date()
def startTime = timeToday(settings.appActive_startTime_v)
def endTime = timeToday(settings.appActive_endTime_v)
timeWindowCheckV = now.after(startTime) && now.before(endTime)
log.debug "isActiveTimeApp: App Roof fan start time window checked: ${timeWindowCheckV}"
return now.after(startTime) && now.before(endTime)
}
// ----------------- Time limits for forced ventilation -------------------------------------------------
def isActiveTimeForcedVent() {
// log.info "Evaluating isActiveTimeForcedVent()"
def now = new Date()
def startTime = timeToday(settings.autoForcedVentilation_startTime_v)
def endTime = timeToday(settings.autoForcedVentilation_endTime_v)
timeWindowCheckVentV = now.after(startTime) && now.before(endTime)
// log.debug "isActiveTimeForcedVent: Forced ventilation start time window checked: ${timeWindowCheckVentV}"
return now.after(startTime) && now.before(endTime)
}
Looking at the hub details the time zone seems to be correct set up.

I have altered the code now to compensate for this situation but I saved the original app script if you want to reproduce the situation.
Cheers,