config-template-card: apexcharts-card: can't template axis min/max

Checklist:

  • I updated to the latest version available
  • I cleared the cache of my browser

Release with the issue: 1.3.6

Last working release (if known): n/a

Browser and Operating System: MacOS, iOS with Safari/Firefox/Brave - all up to date

Description of problem: I am trying to template the min and max of my chart using inout_number I get a ‘bad format’ when I do this. If I replicate that format literally (without using a variable), it works

with this code:

    - type: custom:config-template-card
      entities:
        - input_number.hive_heating_graph_span
        - input_number.hive_heating_graph_max
        - input_number.hive_heating_graph_min
      variables:
        days: "states['input_number.hive_heating_graph_span'].state+'d'"
        max: "states['input_number.hive_heating_graph_max'].state"
        min: "states['input_number.hive_heating_graph_min'].state"
      card:
        type: custom:apexcharts-card
        yaxis:
          - id: temp
            min: ${min}
            max: ~21

The error in the UI is: //apexcharts-card version 2.0.4 /// Bad taxis min/max format: 15.0

type: custom:apexcharts-card
yaxis:
  - id: temp
    min: '15.0'
    max: ~21

If I change the code to to reflect the error:

    - type: custom:config-template-card
      entities:
        - input_number.hive_heating_graph_span
        - input_number.hive_heating_graph_max
        - input_number.hive_heating_graph_min
      variables:
        days: "states['input_number.hive_heating_graph_span'].state+'d'"
        max: "states['input_number.hive_heating_graph_max'].state"
        min: "states['input_number.hive_heating_graph_min'].state"
      card:
        type: custom:apexcharts-card
        yaxis:
          - id: temp
            min: '15.0'
            max: ~21

…it works fine.

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

[Error] card – "custom:apexcharts-card" – Error: /// apexcharts-card version 2.0.4 /// Bad yaxis min/max format: 15.0 — apexcharts-card.js:835:83169
Error: /// apexcharts-card version 2.0.4 /// Bad yaxis min/max format: 15.0 — apexcharts-card.js:835:83169setConfig — apexcharts-card.js:835:83169r — create-element-base.ts:95c — create-element-base.ts:171render — config-template-card.js:812update — config-template-card.js:265:328performUpdate — config-template-card.js:252:4803(anonymous function) — config-template-card.js:252:4366
	c (43509.b0a42RGB-Fg.js:7:162851)
	render (config-template-card.js:812)
	update (config-template-card.js:265:328)
	performUpdate (config-template-card.js:252:4803)
	(anonymous function) (config-template-card.js:252:4366)

Additional information:

About this issue

  • Original URL
  • State: closed
  • Created 6 months ago
  • Comments: 19

Most upvoted comments

…and thank you for your perseverance with this! 👍 🥇