gadgetchnnel / lovelace-card-templater

Custom Lovelace card which allows Jinja2 templates to be applied to other cards
121 stars 6 forks source link

When ApexChart wrapped in Card-Templater, the graph constantly redraws. #37

Open wigster opened 3 years ago

wigster commented 3 years ago

Hi,

Use case:

I am using an ApexChart card to plot the output of a sensor. The sensor is down sometimes, so I would like to use card-templater to swap the sensor for a backup one. This works fine.

Problem

However, the moment that I wrap an ApexChart in card-templater, even without any templates, the graph begins to redraw every few seconds and the viewport of the browser keeps moving around (the cards even get rearranged). I've reported it to ApexCharts, but I've been sent here

https://github.com/RomRider/apexcharts-card/issues/124

type: 'custom:card-templater'
entities:
  - wu_dejvice_status
  - wu_podbaba_status
card:
  type: 'custom:apexcharts-card'
  series:
    - entity: sensor.wu_dejvice_temperature
      type: area
  graph_span: 24h

The two status trackers get updated once every 15 minutes, so should not be causing a redraw.

gadgetchnnel commented 2 years ago

Sorry for the delay, but can you please try this in the latest alpha version of the card, 0.1.0-alpha2, to see if that helps? The new version includes refectored template handling.

zanna-37 commented 2 years ago

Yes, it happens in 0.1.0-alpha3 too.