Astro time is wrong

Hi all

I’ve been going through the forum trying to figure out why my astro events is misfiring. (1 h)

The localtime on my openhabian system is correct, the time inside openhab-cli console is also correct.

But the astro is off by 1 h.

Thing astro:sun:local [ geolocation="REDACTED", interval=60 ] {
	Channels:
        Type rangeEvent : civilDusk#start [
            earliest="16:30",
            offset="60",
            latest="22:00"
        ]
        Type rangeEvent : civilDawn#start [
            earliest="06:00",
            offset="-20",
            latest="10:00"
        ]
}

If i hover over the civilDusk i see the time to be 16:40, however in the eventlog it is firing 1 hour before, as if it is using the system UTC time.

2024-12-09 15:40:00.003 [INFO ] [openhab.event.ChannelTriggeredEvent ] - astro:sun:local:civilDusk#event triggered START`
 timedatectl -->
           Local time: Mon 2024-12-09 16:12:04 CET
           Universal time: Mon 2024-12-09 15:12:04 UTC
openhab> date
Dec Mon 9 16:18:14 2024

how can i correct this?
(removing the offsets have no effects)

NB VERSION: 4.2.2 (Build)

You have to set your timezone in the JAVAEXTRAOPs - I don’t have the details here at work but google will show yo.

Thanks but already did that unless i need more?

EXTRA_JAVA_OPTS="-Xms192m -Xmx768m -XX:-TieredCompilation -XX:+ExitOnOutOfMemoryError -Dxtext.qn.interning=true -Duser.timezone=Europe/Copenhagen"

Did you restart the openhab service after modifying EXTRA_JAVA_OPTS ?
From command line “ps -ef |grep timezone” should show the correct timezone as part of the running process.

Yes, there - I am assuming you did restart of OpenHAB after?

yes i did restart openhab after, several times :slight_smile:

Confirmed, it is there.

Did a full reinstall, confirmed everything is there, and have restarted several times.

It is still going off 1 hour before it should.

i do not see any solution, so i will still assume it is using the system UTC time and not the localtime.

Could you try

Type rangeEvent : set#event

instead of

Type rangeEvent : civilDusk#start

My settings in a text based things file are

astro:sun:home [ geolocation="XX.xxxxxx, X.xxxxxx,xx", interval=60 ] {
    Channels:
        Type rangeEvent : set#event [
            offset=-0,
            latest="21:59"
        ]
}

It do not seem to work, the time-stamp is not updating correctly with that command, however if i do it as posted and specific set the civilDisk#start - The event updates when i change something:

like:
2025-01-03 17:04:27.483 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item ‘civilDawn’ changed from 2025-01-03T08:10:00.000+0100 to 2025-01-03T07:50:00.000+0100
2025-01-03 17:04:27.486 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item ‘civilDusk’ changed from 2025-01-03T15:52:00.000+0100 to 2025-01-03T17:30:00.000+0100

But it still will fire at 16:30 not 17:30 im suspecting it is maybe because of DST because i think it would work correctly when we are on “summertime”

btw upgraded to 4.3.0

Just upgraded to the latest available stable 4.3. version which is : 4.3.1-1
this morning 04.0.1.2025 09:55 CET.

Did a test and I see this information for my location

2025-01-04 09:55:47.070 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'astro:sun:home' changed from UNINITIALIZED to INITIALIZING
2025-01-04 09:55:47.083 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'astro:sun:home' changed from INITIALIZING to ONLINE
2025-01-04 09:55:47.255 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Sunrise_Time' changed from NULL to 2025-01-04T08:36:00.000+0100
2025-01-04 09:55:47.263 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Sunset_Time' changed from NULL to 2025-01-04T16:12:00.000+0100
2025-01-04 09:55:47.268 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'CivilDuskStart_Time' changed from NULL to 2025-01-04T16:17:00.000+0100

These are entries in yesterdays eventlog of a 3.X system:

2025-01-03 16:11:00.002 [INFO ] [openhab.event.ChannelTriggeredEvent ] - astro:sun:home:set#event triggered START
2025-01-03 16:11:00.028 [INFO ] [openhab.event.ChannelTriggeredEvent ] - astro:sun:home:daylight#event triggered END
2025-01-03 16:16:00.002 [INFO ] [openhab.event.ChannelTriggeredEvent ] - astro:sun:home:civilDusk#event triggered START
2025-01-03 16:16:00.004 [INFO ] [openhab.event.ChannelTriggeredEvent ] - astro:sun:home:set#event triggered END
2025-01-03 16:58:00.003 [INFO ] [openhab.event.ChannelTriggeredEvent ] - astro:sun:home:civilDusk#event triggered END
2025-01-03 16:58:00.005 [INFO ] [openhab.event.ChannelTriggeredEvent ] - astro:sun:home:nauticDusk#event triggered START
2025-01-03 17:43:00.002 [INFO ] [openhab.event.ChannelTriggeredEvent ] - astro:sun:home:astroDusk#event triggered START
2025-01-03 17:43:00.004 [INFO ] [openhab.event.ChannelTriggeredEvent ] - astro:sun:home:nauticDusk#event triggered END
2025-01-03 18:25:00.002 [INFO ] [openhab.event.ChannelTriggeredEvent ] - astro:sun:home:eveningNight#event triggered START
2025-01-03 18:25:00.004 [INFO ] [openhab.event.ChannelTriggeredEvent ] - astro:sun:home:astroDusk#event triggered END

So this looks correct …

Your timezone is also shown correct in
http:///settings/services/org.openhab.i18n ?