Apex Chart not updating after midnight

EDIT: moved to frontend.

Hi

I run the companion app on a semi-old android tablet I have mounted in my kitchen.

I use apexcharts to display electricity data overlayed with weather data.
I use met.no for the weather data, BUT have gone through fire and water (almost :slight_smile:) to retain data for the current day.

A while ago, the graph stopped updating weather when it passed midnight. When I checked on my mobile companion app, everything looked just right.

So I restarted the companion app on the tablet and the graph loaded correctly.
So for a while I restarted the app daily, but got more and more “support tickets” from my wife, the days I had forgotten to restart the app.
I ended up making the same graph with identical yaml code 7 times and named them mon-sun.
Monday I use the monday dashboard, tuesday morning i switch dashboard to tuesday and the graph displays the graph correctly, even though its running the same code as the monday graph.

any thoughts / pointers would be greatly appreciated.

BR Palle

type: custom:apexcharts-card
cache: false
experimental:
  color_threshold: true
hours_12: false
header:
  show: true
  title: Elpriser -> 48 timer [kr/kWh]
  show_states: true
  colorize_states: true
now:
  show: true
  color: '#ff0000'
  label: Nu
graph_span: 2d
span:
  start: day
apex_config:
  chart:
    height: 600
  plotOptions:
    bar:
      columnWidth: 85%
  legend:
    show: false
  annotations:
    position: back
    yaxis:
      - 'y': 44.5
        strokeDashArray: 5
        borderColor: '#962626'
        borderWidth: 2
yaxis:
  - id: chance
    opposite: true
    show: false
    min: -11
    max: 100
    decimals: 0
  - id: power
    opposite: false
    show: true
    min: -1
    max: 9
    decimals: 1
  - id: temperature
    opposite: true
    show: true
    min: -5
    max: 25
    decimals: 0
  - id: nedbor
    opposite: false
    show: false
    min: -1
    max: 9
    decimals: 1
  - id: vind
    opposite: false
    show: false
    min: -40
    max: 40
    decimals: 0
series:
  - entity: sensor.vejret
    yaxis_id: chance
    name: nedbør chance
    unit: ´%
    data_generator: |
      return entity.attributes.forecast.map((entry) => {
            return [new Date(entry.datetime).getTime(), entry.precipitation_probability];
          });
    type: line
    color: green
    show:
      legend_value: false
      in_header: false
      in_chart: true
    extend_to: false
  - entity: sensor.nordpool_kwh_dk1_dkk_3_095_025
    yaxis_id: power
    name: Elpris
    unit: kr/kWh
    data_generator: |
      return entity.attributes.raw_today.map((entry) => {
        return [new Date(entry.start), entry.value];
      }).concat(entity.attributes.raw_tomorrow.map((entry) => {
        return [new Date(entry.start), entry.value];
      }));
    type: column
    float_precision: 2
    time_delta: +30min
    show:
      legend_value: false
      in_header: false
      in_chart: true
      header_color_threshold: true
    extend_to: end
    color_threshold:
      - value: 0
        color: lightgreen
      - value: 1
        color: lightblue
      - value: 3
        color: grey
      - value: 5
        color: darkred
      - value: 7
        color: black
  - entity: sensor.vejret
    yaxis_id: temperature
    name: temperatur
    unit: °C
    data_generator: |
      return entity.attributes.forecast.map((entry) => {
            return [new Date(entry.datetime).getTime(), entry.temperature];
          });
    type: line
    color: midnightblue
    show:
      legend_value: false
      in_header: false
      in_chart: true
    extend_to: false
  - entity: sensor.vejret
    yaxis_id: nedbor
    name: nedbør
    unit: mm
    data_generator: |
      return entity.attributes.forecast.map((entry) => {
            return [new Date(entry.datetime).getTime(), entry.precipitation];
          });
    type: line
    color: red
    show:
      legend_value: false
      in_header: false
      in_chart: true
    extend_to: false
  - entity: sensor.vejret
    yaxis_id: vind
    name: vind hastighed
    unit: km/t
    data_generator: |
      return entity.attributes.forecast.map((entry) => {
            return [new Date(entry.datetime).getTime(), entry.wind_speed];
          });
    type: line
    color: yellow
    show:
      legend_value: false
      in_header: false
      in_chart: true
    extend_to: false
  - entity: sensor.vejret
    yaxis_id: vind
    name: vindstød hastighed
    unit: km/t
    data_generator: |
      return entity.attributes.forecast.map((entry) => {
            return [new Date(entry.datetime).getTime(), entry.wind_gust_speed];
          });
    type: line
    color: yellow
    show:
      legend_value: false
      in_header: false
      in_chart: true
    extend_to: false
  - entity: sensor.nordpool_kwh_dk1_dkk_3_095_025
    yaxis_id: power
    name: Pris lige nu
    type: column
    float_precision: 2
    show:
      legend_value: false
      in_header: true
      in_chart: false
      header_color_threshold: true
    color_threshold:
      - value: 0
        color: lightgreen
      - value: 1
        color: lightblue
      - value: 3
        color: grey
      - value: 5
        color: darkred
      - value: 7
        color: black
  - entity: sensor.pollen_graes
    yaxis_id: temperature
    name: Græspollen
    unit: ppm
    type: column
    float_precision: 2
    show:
      legend_value: false
      in_header: true
      in_chart: false
      header_color_threshold: true
    color_threshold:
      - value: 0
        color: lightgreen
      - value: 25
        color: yellow
      - value: 50
        color: red
  - entity: sensor.netatmo_temperatur_sensor_cykelskur_temperature
    yaxis_id: temperature
    name: Temperatur lige nu
    unit: °C
    type: column
    float_precision: 2
    show:
      legend_value: false
      in_header: true
      in_chart: false
      header_color_threshold: true
    color_threshold:
      - value: -50
        color: red
      - value: 10
        color: lightblue
      - value: 20
        color: lightgreen

the HA app respects the caching level set by the HA frontend. If you only see this issue with this custom card then you should file an issue with the custom card author

Good idea :slight_smile:
I’ll make another dashboard with a smaller data size and with different graphs and see which fails.
Thanks :+1: