Hello,
I’m new to home assistant the forum, so apologies for everything I am doing wrong.
I have set up home assistant so far but I am looking for a nice way to display date and time, like the title and temperature are displayed in the weather component, this is my first try:
However I cannot display the temperature with two decimals to have the time as a temperature. Are two decimals for a temperature generally not possible or am I missing the file where this gets defined? My attempt was to edit prec and temp in/srv/homeassistant/lib/python3.4/site-packages/homeassistant/helpers/entity.py
at line 251:
# Convert temperature if we detect one
try:
unit_of_measure = attr.get(ATTR_UNIT_OF_MEASUREMENT)
units = self.hass.config.units
if (unit_of_measure in (TEMP_CELSIUS, TEMP_FAHRENHEIT) and
unit_of_measure != units.temperature_unit):
prec = 6 #len(state) - state.index('.') - 1 if '.' in state else 0
temp = units.temperature(float(45.96), unit_of_measure)
state = "44.87" #str(round(temp) if prec == 0 else round(temp, prec))
attr[ATTR_UNIT_OF_MEASUREMENT] = units.temperature_unit
except ValueError:
# Could not convert state to float
pass
So my question is if this is not possible or if there is a better way to achieve this. I also could not find a documentation for the background of the weather component so I am thankful for every help.
Lukas