Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Server time instead of Browser time #469

Open
RoterRaecher opened this issue Oct 5, 2024 · 11 comments
Open

Use Server time instead of Browser time #469

RoterRaecher opened this issue Oct 5, 2024 · 11 comments
Labels
bug Something isn't working

Comments

@RoterRaecher
Copy link

I have the problem that on my tablet the clock-weather-card always shows the time from the browser on the tablet. Is it possible to use the HA server time? I have already set in the profile that the server time should be used instead of the local time, but unfortunately, it doesn’t work. Does anyone have an idea how I can solve this?

@pkissling
Copy link
Owner

pkissling commented Oct 6, 2024

hi,
clock-weather-card already comes with support for browser / server time out of the box.
as described here, the card uses by default the time zone configured in your HA instance. To make the card pick up the time from your browser, you can set use_browser_time: true
Screenshot 2024-10-06 at 12 27 48

can you please elaborate why this is not working for you?

@RoterRaecher
Copy link
Author

Hello,

thanks for your response. Yes, I chosse this option (use_browser_time: false).
I use an Amazon Fire Tablet, and when I access my Home Assistant website through a browser, if the time on the tablet is incorrect, it will also not be displayed correctly in the Clock-Weather card. The Clock-Weather card always uses the time from the tablet. If I additionally display a card with the sensor.time identity on the website, this time matches the server time. The Clock-Weather card, however, only shows the time from the tablet.
The time-zone ist correct, but not the time.

Best regards

@pkissling
Copy link
Owner

i just ran some tests with my local HA instance. The time/zone settings of clock-weather-card work fine.
When i set use_browser_time: true, clock-weather-card shows the time of my browser. If i set it to use_browser_time: false, clock-weather-card uses the time zone configured in HA.

can you confirm that you did set the correct time zone in

  1. on a global HA level: Settings -> System -> General -> Time Zone
  2. user-specific User -> Time Zone -> Use server time zone?

@pkissling
Copy link
Owner

and another question: can you please provide your full clock-weather-card yaml config?

@RoterRaecher
Copy link
Author

RoterRaecher commented Oct 6, 2024

Yes, here is my config:

show_current: true
show_forecast: true
type: custom:clock-weather-card
entity: weather.openweathermap
sun_entity: sun.sun
weather_icon_type: fill
animated_icon: true
forecast_rows: 7
time_format: 24
time_pattern: HH:mm 'Uhr
date_pattern: cccc, dd.MM.yy
use_browser_time: false
time_zone: null
hide_today_section: false
hide_forecast_section: false
hide_clock: true
hide_date: false

@pkissling
Copy link
Owner

i just ran some tests with my local HA instance. The time/zone settings of clock-weather-card work fine. When i set use_browser_time: true, clock-weather-card shows the time of my browser. If i set it to use_browser_time: false, clock-weather-card uses the time zone configured in HA.

can you confirm that you did set the correct time zone in

  1. on a global HA level: Settings -> System -> General -> Time Zone
  2. user-specific User -> Time Zone -> Use server time zone?

i am still not able to reproduce the problem. could you please confirm the two points above?

@RoterRaecher
Copy link
Author

Hello,
thanks for your response. My Time Zone settings on HA is set in my configuration.yaml

homeassistant:
  unit_system: metric
  time_zone: Europe/Berlin
  country: DE`

image
image

Or is something wrong with these settings?

Best regards

@pkissling
Copy link
Owner

pkissling commented Oct 27, 2024

hey,
config looks good. i am still not able to reproduce the problem.
what is the time zone shown in the card? expected would be berlin i assume.

another question: when you change any other attributes of the card (e.g. time_format: 12), are those changes reflected on the card?

@pkissling pkissling added the bug Something isn't working label Oct 27, 2024
@RoterRaecher
Copy link
Author

Hey,

yes, the time zone is displayed correctly. I also changed it as a test to see if the adjustments would also be displayed on the tablet, and everything worked perfectly. Even when I switch the format to 12-hour, the display is still correct. Only the time is taken from the tablet instead of from the server.
As an example, I added an additional card to the dashboard. For this card, I am using the entity 'sensor.time'. This is displayed correctly, and it uses the server time. You can see the difference in the image below:

IMG_E63641

image

@RoterRaecher
Copy link
Author

Hello Patrick,

do you have some news for me, for fixing this issue with browser time?

Best regards
Jens

@pkissling
Copy link
Owner

hi,
sorry i was not yet able to reproduce the problem on my side

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants