ApexCharts - update_interval - need help

I designed a Dashboard containing several ApexCharts, all with dynamic x-axis (from sunrise to sunset), why I had to use card-templater.
Finally everything works fine, data is being displayed as desired, but the chart is refreshing nearly every second. Ok, seven inverters push data to HomeAssistant and make it quite busy with frequently updating inverter power values. So I tried to use “update_interval” and set it to 30 seconds. No change, no matter where I tried and no matter how often I put the parameter in the code. Could find some example, but in my case, it didn’t work. Probably because it is used “inside” the card-templater?

type: custom:card-templater
card:
  type: custom:apexcharts-card
  apex_config:
    update_interval: 30sec
    yaxis:
      - id: first
        forceNiceScale: true
        decimalsInFloat: 0
    legend:
      show: true
      showForZeroSeries: true
      position: top
      horizontalAlign: left
      floating: false
      fontSize: 9px
    graph_span_template: "{{ states('input_text.graph_span_heute') }}"
  span:
    start: day
    offset_template: +{{ states('input_text.offset') }}
  all_series_config:
    curve: smooth
    type: line
    opacity: 1
    stroke_width: 1
    float_precision: 0
    group_by:
      func: avg
      duration: 10min
  header:
    show: true
    title: PV-Auslastung alle
    show_states: false
    colorize_states: true
  series:
    - entity: sensor.prozent_hoege6alt_pv_leistung
      color: orange
      name: 6alt
      stroke_width: 1
      extend_to: false
      float_precision: 0
    - entity: sensor.prozent_sensor_gen24_pv_leistung
      name: 8D
      color: blue
      curve: smooth
      type: line
      extend_to: false
      float_precision: 0
    - entity: sensor.prozent_sensor_solax_sxuqbjt8wj_gelander_24kwp_ac_power
      name: Gel
      color: magenta
      curve: smooth
      type: line
      extend_to: false
      float_precision: 0
    - entity: sensor.prozent_solax_sxm6ccalpa_fassade_12_kwp_ac_power
      name: F12
      color: white
      curve: smooth
      type: line
      stroke_width: 1
      extend_to: false
    - entity: sensor.prozent_solax_sxmygywxqj_fassade_05_kwp_ac_power
      name: F05
      color: red
      curve: smooth
      type: line
      extend_to: false
    - entity: sensor.prozent_kaco_inverter_watts
      name: 6neu10
      color: red
      curve: smooth
      type: line
      extend_to: false
    - entity: sensor.prozent_symo_4_5_3_m_1_leistung_ac
      name: 6neu4
      color: black
      curve: smooth
      type: line
      extend_to: false
update_interval: 30sec
entities:
  - entity: sensor.prozent_hoege6alt_pv_leistung
    update_interval: 30sec
  - entity: sensor.prozent_gen24_pv_leistung
    update_interval: 30sec
  - entity: sensor.prozent_solax_sxuqbjt8wj_gelander_24kwp_ac_power
    update_interval: 30sec
  - entity: sensor.prozent_solax_sxm6ccalpa_fassade_12_kwp_ac_power
    update_interval: 30sec
  - entity: sensor.prozent_solax_sxmygywxqj_fassade_05_kwp_ac_power
    update_interval: 30sec
  - entity: sensor.prozent_kaco_inverter_watts
    update_interval: 30sec
  - entity: sensor.prozent_symo_4_5_3_m_1_leistung_ac
    update_interval: 30sec


Can anybody give me a hint, how to use “update_interval” in combination with card-templater? Or any better ideas…?
Thanks in advance…

update_interval is on card level and you have it everywhere. tbh I have no clue if it works for your setup but flooding the (combined) card may affect its effectiveness.
I use the same attribute in a few cards and it works fine for me but if your custom-driven sensors update more often then this may be the cause, you need to dive deeper a bit. My first recommendation would be to remove the custom part and see if that helps, bring it down to 1 entity and gradually add…

1 Like

Good idea - and I found the reason.
Suspected functions like “avg”, “smooth”… to cause this, but the reason ist the card templater / custom:card-templater!
Even a simple chart with only one entity and static x-axis (I use custom:card-templater for dynamic-x-axis) does refresh the whole chart every approx. 5 seconds. Sometimes faster, sometimes slower as long as the card is defined within custom:card-templater - and causes remarkable processor load.
If you use a dashoard with 10 charts, some of them with up to seven entities, each of these being fed by live inverter power values, coming in continuously, my Raspberrry4 ist at excessive processor load and HomeAssistant is lagging extremely.

Without custom:card-templater update_interval runs as it is supposed to do.

So, obviously custom:card-templater overrides or ignores update_interval and probably sets it to its default of five seconds.

When I run the same (overloaded) dashboard with static X-axis (without custom:card-templater) it works perfect - even on my slow Raspberry4.

Using dynamic x-axis (from sunrise to sunset, some from sunrise to now() is essential for me, as it cuts off the non-sun times on the x-axis and makes the charts much better readable.

Do you or somebody else here have any idea how to do this, maybe with an alternative to custom:card-templater?

Try the other template-card… not sure if that will help but one can try
iantrich/config-template-card: :memo: Templatable Lovelace Configurations