How to show a sensor device's attributes in lovelace (using Sensor Card?)

Hi,

I have a bunch of Z-Wave Multilevel-Sensors installed and integrated into HA via the ISY994i integration. I would like to display the current temp and humidity (and history) from these sensors in Lovelace. The Sensor Card seems to be the most apt way to do it, but I can’t seem to figure out how to get the Sensor card to read the particular attributes I want to display.

The entity contains the following data from the Developer Tools -> States lookup:
State: Unknown
State Attributes:

seismic_intensity: 0 mercalli
uv_light: 0 uv index
luminance: 0 lux
humidity: 64%
temperature: 54.8°f
battery_level: 100%
friendly_name: Wine Room Multilevel Sensor

How can I get the Sensor Card to pick out the temperature (or humidity, or both) attributes instead of the “state” attribute? Must I create a fake sensor that tracks the underlying entity?

Thanks!

The sensor card does not support displaying entity attributes, only entity state. So yes you will have to create template sensors.

Thanks @tom_l. I was hoping to avoid that, but I guess not.

I wish there were a way to build a generic template that could then be parameterized. There are places where I have half a dozen (or more) entities that are exactly alike and need to be translated in exactly the same way I.e.,:

template_sensor_temp:
  value: <parameter>.attatributes.temperature

template_sensor_1:
  value: {{ template_sensor_temp(sensor.multilevel_1) }}

template_sensor_2:
  value: {{ template_sensor_temp(sensor.multilevel_2) }}
...

For the record, this is what I did (with an equivalent one for humidity), and it seems to be working (generally). However the sensor card is reporting “no history”. But honestly just using the default badge and the pop-up is good enough for what I want.

sensor:
  - platform: template
    sensors:
      machine_room_temp:
        friendly_name: 'Machine Room Temperature'
        entity_id: sensor.basement_multilevel_sensor
        unique_id: sensor.machine_room_temp
        device_class: temperature
        value_template: "{{ state_attr('sensor.basement_multilevel_sensor', 'temperature') }}"