Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95295

Unit of measurement for a template sensor

$
0
0

@Matt_Barnes wrote:

So I have speedtest giving me a download speed, but I wanted it to round to 0 decimal points so it displays without wrapping in the example below but the template version is not displaying a unit of measurement.

The guage is the speedtest download speed.
The sensor card is the rounded version.

I have put “unit of measurement” everywhere I can think but still just displays 30.

Code for template:

  - platform: template
    sensors:
      speedtest_download_rounded:
        value_template: "{{ states('sensor.speedtest_download') | float | round(0) }}"
        unit_of_measurement: 'Mbit/s'  

Code for sensor card:

    
    - type: horizontal-stack
      cards:

          - type: sensor
            name: Download
            unit_of_measurement: 'Mbit/s'
            entity: sensor.speedtest_download_rounded
            severity:
              red: 10
              yellow: 18
              green: 25

Display of card:
image

Display of guage showing Mbits/S
image

All I want is to be able to see 30 Mbit/s in the sensor card

Posts: 3

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 95295

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>