How can I use a climate attribute in a lovelace card?

I am trying to display the heat curve from my ground source heat pump in a dashboard.

When I try and use the attributes from a climate entity, I get an error instead of the value. I can’t work out the correct way to access the attribute in the YAML file.

My configuration looks like this:

type: custom:plotly-graph
hours_to_show: current_day
layout:
  xaxis:
    type: number
    showlegend: false
    autorange: reversed
  yaxis:
    fixedrange: true
    range:
      - 10
      - 65
entities:
  - entity: ''
    x:
      - 20
      - -35
    'y':
      - 25 # should be a climate value
      - 65 # should be another climate value
    line:
      shape: spline

Which produces the following graph.

When I use state_attr I get an error:

{{ state_attr('climate.heat_set_1_curvel', 'current_temperature') }}

returns

Configuration errors detected:
missed comma between flow collection entries (19:73)

 16 |  ... 
 17 |  ... 
 18 |  ... 
 19 |  ... curvel', 'current_temperature') }}
-----------------------------------------^

Heat pump uses the H60 mqtt connector

The climate entity has the following attributes:

hvac_modes:
  - ''
min_temp: 10
max_temp: 60
target_temp_step: 0.1
current_temperature: 25
temperature: 25
friendly_name: Heat set 1, CurveL
supported_features: 1

Try this as the entity entry:

entities:
  - entity: climate.heat_set_1_curvel
    attribute: current_temperature

It says it’s not supported by the visual editor but it seems to work for me i a very simple setup like this:

type: custom:plotly-graph
entities:
  - entity: sensor.argon_one_addon_fan_speed
    attribute: Temperature F
hours_to_show: 24
refresh_interval: 10
title: Temp from Argon Fan

Your templating is correct, can you share your full config when you add in your template?

Ok, a little progress but this only works when I remove the y properties. I don’t want to show history or statistics, I want a fixed state based on the current values.

With your suggestion I now have this:

type: custom:plotly-graph
hours_to_show: current_day
layout:
  xaxis:
    type: temperature
    showlegend: false
    autorange: reversed
  yaxis:
    fixedrange: true
    range:
      - 0
      - 80
entities:
  - entity: climate.heat_set_1_curvel
    attribute: current_temperature
    x:
      - 20
      - -35
  - entity: climate.heat_set_2_curver
    attribute: current_temperature
    x:
      - 20
      - -35
    # 'y':
      # - 25 # should be a climate value
    #   - 65 # should be another climate value
    line:
      shape: spline

What I really want is one line that starts at the climate.heat_set_1_curvel.current_temperature and ends at the climate.heat_set_2_curver.current_temperature value.

I am open to other suggestions to explore.

I’m not quite sure what you mean by ‘full template’. The code posted is the full config for the lovelace card. The entities are auto-populated by HA from the H60. And their contents are also shown as they appear in the dev states display in HA.