dbuezas / lovelace-plotly-graph-card

Highly customisable Lovelace card to plot interactive graphs. Brings scrolling, zooming, and much more!
376 stars 16 forks source link

Resample is not timezone aware #384

Open paradox460 opened 6 months ago

paradox460 commented 6 months ago

Describe the bug If using an offset timezone, say, -0700, and running resample on daily binned values, the values will display with an offset of 7 hours before the bin should start.

Ex: a bin for March 5th would show as March 4 @ 17:00

dbuezas commented 6 months ago

For the record, this is about using home assistant in a non gmt-0 time zone (not using time offset)

deltamelter commented 5 months ago

Plotly graph certainly looks nicer than Apexchart version, but one of the data series is not being interpreted correctly. Coloured bars are from source in UTC with "Z" notation, the grey bars that they overlay are from an adjusted source (+1:00). Plotly isn't respecting the timezone. Everything else in config looks the same.

- start_time: '2024-04-03T16:00:00+01:00'
  end_time: '2024-04-03T17:00:00+01:00'
  price_pence_per_kwh: 6.604500000000001
- start: '2024-04-03T15:00:00+00:00'
  end: '2024-04-03T15:30:00+00:00'
  value_inc_vat: 0.247485
- start: '2024-04-03T15:30:00+00:00'
  end: '2024-04-03T16:00:00+00:00'
  value_inc_vat: 0.26271

image image