Allow unit_system to be overridden on a per-sensor basis

This topic has come up in the Community a bit – some people who want different unit systems for temperature vs. distance (UK), and some people (like me) live in the US but want to use Celsius for certain things, like 3D printer control and server temperature monitoring.

I’m using mqtt sensors to get my server monitoring data into HASS, and despite declaring the temperature sensors as Celsius, they get converted automatically and displayed in the front end as Fahrenheit. I know I could use a template sensor and change it back, but that’s not the optimum solution.

It would be nice, when declaring a sensor in the yaml file, to have an option like “preserve_units: [yes]/[no]” with the default being “no,” so everything gets converted appropriately for convenience. And if you want to override the conversion, specify “yes.”