Issue of the topic: please be detailed explaining your issue
Please post configurations (if applicable):
Items configuration related to the issue
Sitemap configuration related to the issue
Rules code related to the issue
Services configuration related to the issue
If logs where generated please post these here using code fences
Hi. I created a new installation of openhabian 5.0.1 and copied my configuration over from 4.3. However, I noticed time based rules are not running at their scheduled time. For example:
This did not run at all at 1p.m.. The same is true for my CRON jobs which I normally use cron as it’s easier to configure. What I check raspi-config, I see US and Central time configured properly. My time stamps in the Log Viewer match the current time as well. What can I check or look for to see what might be misconfigured?
Nowhere above talks about /etc/localtime. Why are you trying to open that file?
There are only two files you need to look at and one seeing in MainUI: /etc/timezone, /etc/default/openhab.
You must have root to edit these files. I don’t know how to do that in filezilla. It should ask for your password. From the command line you’d use sudo before the command to open the file for editing.
Thanks. I am not very good at software. I did find another thread that directed me to use SSH and update Duser time zone. That seems to have worked. Thanks again for all your help.
I can confirm this problem for openHAB 5.1.0 - Release Build. Time in Logs was one hour behind what “date” showed, and time based rules fired one hour too late. In my case, /etc/timezone was Europe/London. I used timedatectl to correct it to Europe/Berlin, now everything works as expected.
I can tell you that the problem is solved and had, in my case, nothing to do with Openhab. There were no errors in the log to be found. The fundamental problem was in my Linux-server and the NTP-service. After repairing that, the time issues were solved and all is working fine now.
Don’t know it’s the right thread but let me address my issues.
Can you share a link to this issue?
I ran OH since 2020 and now I setup a completely new installation (OH5.x) without any legacy.
Installed on raspi via Raspberry Pi Imager. Everything smoothe but after some time I recognized
logs
cron
and persistence (rrd4j & jdbc)
are showing diffrent timestamps!
Main UI - Regional Settings - Europe/Berlin - doesn’t help
changing /etc/timezone via linux commands - doesn’t help
changing /etc/default/openhab will help till the next update!
It will be overridden!
Coming to the point:
I don’t want to maintain extra linux parameters in a self maintained file just to have my configured timezone ready all over the place!
But I’m still curious regarding the problem. Is it well known that after OH setup you need to edit some /etc/whatever files, restart again and after that you regional settings are fine?
You’re in the US so if you’re setting up a new system from scratch do you also have default timezone Europe/London?
It’s fairly well known. I can’t say how well, but there are many threads discussing it including the release discussion threads.
I run in Docker which doesn’t have this problem. There is no /etc/default/openhab file in the Docker container. It’s a “manual” install inside the container, not apt or yum or openHABian. To set the EXTRA_JAVA_OPS one passes that as an environment variable, which I do every time I start/create a container.
I have the same problem, upgraded to 5.1.3 on a 64 Raz. Pi. I went to check the 3 places for the correct time zone. The 2nd one doesn’t even exist, I tried to edit the 3rd. one using winSCP but it says I don’t have permission. So here I go down that rabbit hole!!!..lol.
Since this was posted I think we found the culprit. If you did not edit /boot/openhabian.conf before the first time you booted as the instructions describe, you didn’t set the timezones for openHABian. Consequently the default timezones was used. And that file gets copied to /etc/openhabian.conf. Every time openhabian-config runs it resets everything based on /etc/openhabian.conf.
To prevent/etc/default/openHAB from being changed in the future, set the timezone in /etc/openhabian.conf too.
I assume you installed openHABian. openHABian runs on a Linux operating system, not Windows. When you use PuTTY to ssh to the machine, you have left Windows world. That text pane is a terminal running on a Linux machine. Nothing on your Windows machine is going to be available. Nothing you run on a Linux machine is likely to start with “Win”. And WinSCP is a file copying tool, not a text editor. So the command over all makes no sense on a bunch of levels.
Even though openHABian frees you from needing to be a Linux expert, it cannot replace some basic Linux knowledge. Any time you connect to the machine over PuTTY, you need to know file structures. You need to know basic commands like sudo, cd, ls, cp, mv etc. And you need to know how to edit files. I believe the text editor nano comes installed by default but if not pico should be there.
There are tons and tons of “getting started with Linux” tutorials out there. You would do well to go through them to learn some basic Linux commands and tecniques. Again, you don’t need to be na expert, but you need some basics.
You cannot edit any of these files except on the machine itself. These are considered system files and their permissions will not allow it. So neither VSCode nore WinSCP type tools will help you here, not to mention again that WinSCP doesn’t edit files as far as I know.