iantrich / config-template-card

📝 Templatable Lovelace Configurations
MIT License
425 stars 55 forks source link

No update - with apexcharts #113

Closed uowis closed 1 year ago

uowis commented 1 year ago

Release with the issue: 1.3.6 Last working release (if known):

Browser and Operating System: Chrome Win11

I want use config-template-card to change day of apexcharts-card :

type: custom:config-template-card
entities:
  - entity: input_number.day_before
variables:
  DAYS: states['input_number.day_before'].state+'d'
card:
  type: custom:apexcharts-card
  apex_config:
    chart:
      height: 250px
  header:
    show: true
    show_states: true
    colorize_states: true
  series:
    - entity: sensor.general_power_base
      type: column
      group_by:
        duration: 1h
        func: diff
      show:
        in_header: false
    - entity: sensor.general_power_base
      show:
        in_header: true
        name_in_header: false
        in_chart: false
      group_by:
        duration: 1d
        func: diff
    - entity: sensor.general_instant_cost_power
      show:
        in_header: true
        name_in_header: false
        in_chart: false
      group_by:
        duration: 1d
        func: diff
  graph_span: 24h
  span:
    start: day
    offset: ${DAYS}

Description of problem:

When i change input_number.day_before the card will not update.

Javascript errors shown in the web inspector (if applicable):

config-template-card.js?hacstag=172177543136:883 Uncaught (in promise) TypeError: template.includes is not a function
    at ConfigTemplateCard._evaluateTemplate (config-template-card.js?hacstag=172177543136:883:23)
    at ConfigTemplateCard.shouldUpdate (config-template-card.js?hacstag=172177543136:774:52)
    at ConfigTemplateCard.performUpdate (config-template-card.js?hacstag=172177543136:252:4635)
    at ConfigTemplateCard.scheduleUpdate (config-template-card.js?hacstag=172177543136:252:4443)
    at ConfigTemplateCard._$EC (config-template-card.js?hacstag=172177543136:252:4351)

Additional information: The card have the good day when i refresh browser

uowis commented 1 year ago

sorry the error is in my code :

entities:
  - **entity:** input_number.day_before

"entity:" was too much

uowis commented 1 year ago

sorry the error is in my code :

entities:
  - **entity:** input_number.day_before

"entity:" was too much