ApexCharts with config-template-card and data_generator fails

Hi,

I use apex-card to display my EV-charging statistics:
Using Home Assistant and NodeRed to control EV Charging - Share your Projects! - Home Assistant Community (home-assistant.io)

Now I try to make the time span selectable with the config-card-template. Therefore I added this

type: vertical-stack
cards:
  - type: entities
    entities:
      - entity: input_select.wallbox_apex_filter
  - type: 'custom:config-template-card'
    variables:
      - 'states[''input_select.wallbox_apex_filter''].state'
    entities:
      - input_select.wallbox_apex_filter
    card:
 type: custom:apexcharts-card
  stacked: true
  .....

Now the JS seems to broken:
1.) It cuts the first two letters of my data_generator script:
image
The simple workaround is to add two extra letters → vavar = myInit…
2.) The data_generator ends with: return request();
But now I get this error:
image

Any ideas how to fix this?

Ok,
I found the issue myself. My data_generator function included this:

console.log(Error code ${res.status});

And the config_template_card is looking for “${”
I removed this and now it works fine.

Br
walzing