Compensate for incorrect time in Tesla browser?

When I open Lovelace from the browser in my Tesla, the times are wrong.

E.g. sunrise shows as 9 pm and graphs with electricity prices also shift heavily. I realize this is a Tesla issue, but perhaps there is a way to work around this?

My hunch is that the browser reports Pacific time, even though the car is in Central European time (and shows the correct time on the clock). Any JavaScript relying on the time reported from the browser is then off by many hours.

Any ideas as to how I could work around this?

Thanks in advance.

P.S. Lovelace works great in the car - allows me to check the locks, etc. when we have left the house. But it is a little painful, that I cannot see what the cheapest time to charge is, when arriving home, as the graphs are off.

1 Like

Change the timezone of the Tesla?

Do you know how? I haven’t come across it as a setting, and it is not in the manual.

lol no, I don’t own a Tesla :slight_smile:
Google it…

According to the information I received today from Tesla Switzerland, this is a bug in the firmware and work is being done to fix it…

1 Like

They took note of it when I spoke to them. But I would actually rather have them fix the insanity of phantom braking first.

Phantom braking due to timezone… Tesla thinks it’s in a school zone… :sweat_smile:

1 Like

@run Did you ever figure out a solution?

Assuming the problem is with energy prices graph in HA Lovelace used in tesla browser, here is a solution to offset the apexcharts-card graph.

In the data_generator of the apexcharts-card you can change the time offset.
I live in Denmark and mine are set to nine “(9 * 60 * 60 * 1000);” to compensate.

Sharing my code below, but be aware that I also added an option to change Tariff prices in the Data_generator section.
Mine are set to ad 0.6 but between 17:00 and 20:00 (9 and 12 in tesla browser) else it is adding 0.9.
Change both to 0 if you already have tariff set in the pricesensor.

NB: Sorry, but have no idea how to post the code without he format breaking. So sorry, please repost if you know how.


type: custom:apexcharts-card
experimental:
color_threshold: true
now:
show: true
color: rgb(244,160,0)
locale: en
header:
show: true
show_states: true
colorize_states: true
graph_span: 2d
yaxis:

  • min: ~0
    apex_config:
    forceNiceScale: true
    span:
    start: day
    apex_config:
    yaxis: null
    chart:
    type: area
    height: 350
    legend:
    show: false
    xaxis:
    labels:
    show: true
    format: HH:ss
    rotate: -45
    rotateAlways: true
    hideOverlappingLabels: true
    style:
    fontSize: 18
    fontWeight: 18
    series:
  • entity: sensor.elpriser_danmark_vest
    color: rgb(72, 133, 237)
    show:
    in_header: true
    extremas: false
    type: line
    data_generator: |
    return (entity.attributes.raw_today.map((start, index) => {
    let hour = new Date(start[“start”]).getHours();
    let additionalCost = 0.6;
    if (hour >= 9 && hour < 12) {
    additionalCost = 0.9;
    }
    let timestamp = new Date(start[“start”]).getTime() + (9 * 60 * 60 * 1000);
    return [timestamp, entity.attributes.raw_today[index][“value”] + additionalCost];
    })).concat(entity.attributes.raw_tomorrow.map((start, index) => {
    let hour = new Date(start[“start”]).getHours();
    let additionalCost = 0.6;
    if (hour >= 9 && hour < 12) {
    additionalCost = 0.9;
    }
    let timestamp = new Date(start[“start”]).getTime() + (9 * 60 * 60 * 1000);
    return [timestamp, entity.attributes.raw_tomorrow[index][“value”] + additionalCost];
    }));
    color_threshold:
    • value: 0
      color: rgb(60, 186, 84)
    • value: 1
      color: rgb(60, 186, 84)
    • value: 1
      color: rgb(72, 133, 237)
    • value: 2
      color: rgb(72, 133, 237)
    • value: 2
      color: rgb(219, 50, 54)
    • value: 4
      color: rgb(219, 50, 54)
    • value: 5
      color: rgb(219, 50, 54)
    • value: 6
      color: rgb(219, 50, 54)
    • value: 7
      color: rgb(219, 50, 54)
    • value: 8
      color: rgb(219, 50, 54)
    • value: 9
      color: rgb(219, 50, 54)
    • value: 10
      color: rgb(219, 50, 54)

Blockquote

Timing- offset issue is global and not just a single card in HA when accessed through the Tesla browser. For Scandinavia it’s 9 hours.

1 Like

there is no solution until now for this incorrect time displaying Caloifornia Time in each graph?

2 Likes

Same issue here and reported several times in the Tesla app that the browser internal time is set to US instead of de vehicle local GPS time.
All the data gets shifted in time!
Tesla says the browser time cannot be fixed for now :frowning:

1 Like

Solution is to create a new user and use that when logging in via the car browser. Then in user settings change timezone from LA to your own timezone. Fixed the energy dashboard for me.