Sensor Attribute in Lovelace Card

Hi,
i have a sensor: [climate.kuche_heizung] with this attributes:


hvac_modes: off, auto, heat
min_temp: 5
max_temp: 25
target_temp_step: 0.5
preset_modes: away, home
current_temperature: 16.5
temperature: 5
current_humidity: 49.4
hvac_action: off
preset_mode: home
offset_celsius: 0
offset_fahrenheit: 0
default_overlay_type: MANUAL
default_overlay_seconds: null
friendly_name: Küche Heizung
supported_features: 401

How can I get temperature and humidity out to a Lovelace card?

Have you tried an entity card? That should allow you to select an attribute to display.

or with a custom buttom card

type: custom:button-card
show_state: false
show_name: true
show_label: false
name:  |
   [[[
      return state[climate.kuche_heizung'].attributes.friendy_name; 
   ]]]
custom_fields:
  temperature: |
    [[[
      return states['climate.kuche_heizung'].attributes.temperature + " °C";
    ]]]
  humidity: |
    [[[
      return states['climate.kuche_heizung'].attributes.current_humidity + " %rel";
    ]]]
styles:
  custom_fields:
    temperature:
      - position: absolute
      - left: 50px
      - bottom: 10px
    humidity:
      - position: absolute
      - right: 50px
      - bottom: 10px

you simply define 1 custom field per attribute you want to show and return it’s value stored in the attributes
and you define it’s location on the card in the styles: section

the example makes use if 2 custom fields + mapping the friendly_name to the normal name field. You could add more custom_fields if you want to. Means you could freely create the card content. And not just with states/attributes but also with icons. You could even put another custom button_card being sort of a child card into the main one using custom_fields.

But you need to install the custom button-card using HACS first.