Disable browser timezone detection in Main UI graphs/analyze

I’m seeing the following behavior:

  • In the main UI (at least, that’s what I think I’m looking at, it’s what runs on port 8080 with openhabian), I can analyze the history of items, which produces a nice graph.
  • On my laptop (using Firefox), this shows the horizontal axis in my local timezone (GMT+2) as expected.
  • On my mobile phone (using Firefox mobile), this shows the horizontal axis in the GMT/UTC timezone instead, which is unexpected.

Furthermore:

In any case, I wonder if I can fix this on the OpenHAB side, without having to disable all fingerprinting protection in my browser. One perfectly acceptable way for me would be to simply disable browser timezone entirely and just always use the configured timezone (since that’s where my house is, anyway). However, I could not find any way to do this.

A slightly nicer solution would be to use the browser timezone when it is meaningful and use the the configured timezone when the browser spoofs it, but I’m afraid that it might be hard to detect whether or not the timezone is accurate or not. A rough measure would be to assume that UTC/GMT means it is spoofed, but that could be annoying for users in that timezone (accessing an OpenHAB setup configured for another timezone).

I also found this related topic, which suggests that simply configuring a timezone is sufficient to fix this problem. However, I do have a timezone configured already (under Settings → System Services → Regional Settings → Time Zone), so I suspect that that other post might be applicable only to PaperUI, which I think was OpenHAB2 and I’m not using right now.

  • Platform information:
    • Hardware: rpi
    • OS: OpenHABian
    • openHAB version: 3.0.2

Could you check which timezone is set in OH:

  • login to karaf console ( /usr/share/openhab/runtime/bin/client -p habopen )
  • enter: set | grep -i zone

Ah, nice, didn’t know about that console yet.

Seems like the timezone is set ok in my installation:

openhab> set | grep -i zone                                                                                                                                    
String          user.timezone   Europe/Berlin