Simple css style question (sensor)

I have recently setup a sensor to display my next Google Calendar event on my dashboard but for some reason I can’t resize the displayed text. I have tried all style arguments as explained here using font-size: ## and no luck.

46 PM

What am I doing wrong?

It should be the text style arg - what are you setting it to?

I’ve tried nearly everything here making adjustments to the size but no luck.

please give a not working dashboard, to see what you are doing wrong.

I made a mistake when creating my sensor widget but it is now fixed and working. It was indeed the text style arg.

Thanks all!

1 Like

I have a similar problem, but I cannot get it to work. My temperature sensor absolutely does not want to change its color. I got the size to change with widget_style but the color-attribute does not seem to work there. I got the Unit to change its color, just not the measurement/sensor state. I already tried a lot of different things that I found around to foum/documentation, nothing seems to work. I still ahve the standard blue color for the actual temperature, just the °C is in green with the following configuration:

flower_temperature_drachenbaum:
    widget_type: sensor
    title: Drachenbaum Temperature
    widget_style: "font-size: 100%; color: $green"
    unit_style: "color: $green"
    main_style: "color: orange"
    sub_style: "color: orange"
    level_style: "color: $green"
    icon_style: "color: $green"
    state_text_style: "color: orange"
    units: "°C"
    precision: 1
    entity: sensor.drachenbaum_temperature

reading the docs helps you trying the right style settings instead off the wrong ones :wink:

from the docs:

sensor
A widget to report on values for any sensor in Home Assistant

The widget will detect whether or not it is showing a numeric value, and if so, it will use the numeric style. If it is showing text it will use the text style, which among other things makes the text size smaller.

Mandatory Arguments:
entity - the entity_id of the sensor to be monitored
Optional Arguments:
title - the title displayed on the tile
title2 - a second line of title text
units - the unit symbol to be displayed, if not specified HAs unit will be used, specify “” for no units
precision - the number of decimal places
shorten - if set to one, the widget will abbreviate the readout for high numbers, e.g. 1.1K instead of 1100
use_comma - if set to one`, a comma will be used as the decimal separator
state_map
sub_entity - second entity to be displayed in the state text area
sub_entity_map - state map for the sub_entity
Style Arguments:
widget_style
title_style
title2_style
value_style
text_style
unit_style

so text or value

1 Like

value_style did the trick, thanks a lot!

I also just implemented your iconsensor, great work!

1 Like