Java Runtime Environment: openjdk version “17.0.15” 2025-04-15
openHAB version: 4.3.5
This is not so much an ongoing issue as a gripe about something I think I just solved myself. I just set up a new OpenHABian server as a beginner, and I made sure that the timezone in openhabian.conf was set to my local time (America/Denver). This set /etc/localtime correctly, and the OpenHAB timezone and all time stamps in the web UI looked correct, but /etc/timezone was set to Europe/London, and EXTRA_JAVA_OPTS in /etc/default/openhab contained -Duser.timezone=Europe/London. I didn’t notice this until I tried to schedule some rules for my HVAC setup and found out that all time-of-day and cron triggers went off at completely the wrong times.
After finding the issue here, I figured out that I needed to fix the timezone in the above places, but I never saw anything in the documentation that says this is necessary. Normally I would file a bug report for something like this, but I honestly don’t know which of the following three possibilities is the case:
This is only a bug in OpenHABian for using Europe/London in /etc/timezone regardless of the openhabian.conf setting, and OpenHAB uses this value to set EXTRA_JAVA_OPTS on installation.
There is also a bug in OpenHAB, which for some reason sets EXTRA_JAVA_OPTS incorrectly on installation regardless of any other timezone setting.
For some obscure reason, /etc/timezone cannot be easily changed on first boot, and it is expected that the user will fix it, in which case there is effectively a bug in the OpenHABian documentation for not mentioning that /etc/timezone and EXTRA_JAVA_OPTS need to be changed for all new installations outside of the Europe/London timezone.
Since I don’t know where the real issue is, I decided to just make a post here in case some developer knows what should be changed.
I should mention that it was actually more confusing to see that /etc/localtime and the OpenHAB timezone setting were correct than if they had also been wrong! I didn’t expect /etc/timezone to be incorrect when /etc/localtime was fine (and thus timedatectl gave the expected output). Nor did I expect OpenHAB to be using a different timezone setting in EXTRA_JAVA_OPTS from the one visible in the web UI and openhab-config settings.
I think both 1 and 2 are openHABian related. I didn’t think a standard install of oh sets the java-opts for timezones at all. But there are cases where not setting the java-opts fails so I’m sure openHABian sets it just in case.
I’m wondering if there might have been a typo or something in the openhabian.conf file that prevented it from picking up that seeing. Do you happen to have any openHABian logs still from that initial install? If there was an error they should appear there.
I first booted openHABian a few weeks ago, and I don’t know where any logs from that process are, if I still have them. But I do have the openhabian.conf file itself, which contains this section, which seems fine to me:
I should note that the locales, as well as the hostname/username information above this section and the WiFi information below this section all seemed to work. Plus, this is the only place where I can recall giving openHABian the timezone information at all, and it set /etc/localtime correctly from this. So I don’t see how the conf file could be the issue.
(I also set the timezone in the web UI later, but I’m pretty sure that doesn’t set /etc/localtime; TBH I don’t know what the web UI setting does affect, other than timestamps shown in the web UI itself. I noticed that it used my local time in the web UI log viewer even when events.log itself was outputting times in the other time zone, which I still find faintly baffling.)
I could see if I have the means to reproduce the issue (e.g. maybe I have a spare SD card setting around that I could stick a second copy of openHABian on, to try to reproduce with exactly the same .conf and hardware), but it could be a while before I have the time to do so.
Yeah the timezone stuff is a highly complex mess with many levels.
I guess the easiest solution for you is to move over to Europe
I’ve changed the install procedure so it should now copy what you entered in openhabian.conf to /etc/timezone before proceeding.
You can simply change /etc/timezone and EXTRA_JAVA_OPTS in /etc/default/openhab manually.
Nice, hopefully that will make things easier for other newbies.
P.S.: You may have been joking about moving to Europe, but given that I’m a scientist currently funded by the U.S. government, a move to Europe is definitely looking more likely if certain agencies’ budgets keep being cut…
As an aside, I know America/Denver covers a lot of area, but we are at least near neighbors. I’m in Colorado Springs and also facing a lot of the same issues you are. Good luck!
Cool, I’m in Arvada myself, and head down to the Springs sometimes to meet up with friends. I work remotely for a lab in Washington state, though I used to work for NCAR in Boulder. Good luck with the issues you’re facing as well.