Yoda-x / ha-zha-new

update of the zha component
56 stars 10 forks source link

Xiaomi temperature sensor appears in celsius? #78

Closed kevinduong closed 5 years ago

kevinduong commented 5 years ago

It appears that my temperature sensor is appearing in celsius. There's no possible way it's currently 14.3C but 57F makes more sense.

image

Yoda-x commented 5 years ago

Hi, do you set your HA to Fahrenheit? The sensor provides Temperatur in celsius. So this would need to add a convert function.

kevinduongcalabrio commented 5 years ago

My unit_system is set to imperial and the unit_of_measurement is Fahrenheit.

If the sensor reports Fahrenheit as the unit_of_measurement, shouldn't it be Fahrenheit?

Yoda-x commented 5 years ago

Thanks for your feedback. I have some ideas where to tweak the code. Please stay tuned. EDT: the sensor reports Celsius, but this seems to be overruled by the system settings.

Adminiuga commented 5 years ago

@Yoda-x make temperature sensor Entity always return celsius for unit of measurement and then just use celsius for the state. Front end will convert temperature automatically to the system's unit of temp measurement.

Yoda-x commented 5 years ago

yepp, already in my dev tree and tested. I was unsure if there are sensors reporting in F. But the cluster library only mentions C. So that's an easy one.

Yoda-x commented 5 years ago

now on master