How do I display sensor values in multiple units on a dashboard?

Hello everyone:

The TPMS sensor shows output in kPa, while I would like to have them shown in Psi as well:

The same applies to other units - F/C, hPa/millibars, etc.

Ideally, I would like to see something like:

Temperature 85F
Temperature 29.5C

So both units one per line.

I tried to add unit_of_measurement in the dashboard section:

type: entities
entities:
  - entity: sensor.master_bedroom_temp_sensor_temperature
    unit_of_measurement: °C
  - entity: sensor.master_bedroom_temp_sensor_temperature
    unit_of_measurement: °F
title: ZB Outdoor temp sensor - porch, on a tree
state_color: true
show_header_toggle: false

But it didn’t work, only F is displayed in both lines, plus I see the following message displayed

Visual editor is not supported for this configuration:

  • Key ‘entities.0.unit_of_measurement’ is not expected or not supported by the visual editor.
  • The provided value for ‘entities.0’ is not supported by the visual editor. We support (string) but received ({“entity”:“sensor.master_bedroom_temp_sensor_temperature”,“unit_of_measurement”:“°C”}).

You can still edit your config in YAML.

Your help and guidance would be greatly appriciated.

I do not believe that one entity can have more than one unit_of_measurement

If you really need this, make a template sensor sensor.master_bedroom_temp_sensor_temperature_f and get the template to do the maths.

So if I have 50 temp sensors I have to create 50 templates?
This is not a very convenient way to do it, is not it?

Is there a way to define a formula (C to F; F to C; psi to hPa; etc) and call that formula instead of defining new templates?

By the way, you will not see the term unit of measurement n the docs for the entities card Entities Card - Home Assistant

There might be custom cards that will do what you want.

The Template Entity Row will enable you to do the following:

type: entities
entities:
 
  - entity: sensor.kitchen_sensor_temperature
  - type: custom:template-entity-row
    state: '{{states("sensor.kitchen_sensor_temperature")|float*9/5+32}} °F'
    name: '{{state_attr("sensor.kitchen_sensor_temperature", "friendly_name")}}'
    icon: mdi:thermometer

image

It is still a bit manual, but easier than setting up a new template entity.

1 Like

Hello, coming back to this topic.

Where do you define 'custom:template-entity-row' in your example? In configurations.yaml of somewhere else? When I tried to enter as above, I am getting message

  • Custom element not found: template-entity-row

Have you installed template entity row? GitHub - thomasloven/lovelace-template-entity-row: 🔹 Display whatever you want in an entities card row.

1 Like

Perfect, worked as in your example.