How to get Prometheus to capture Fahrenheit instead of Celsius

I’ve searched for sometime and do not understand the current state of the issue. When I view the Github issues it says they are resolved but I do not see any solutions.

My temperature sensors are being written into Prometheus in Celsius instead of Fahrenheit. I have tried changing the unit_system in the global config to imperial and us_customary. I have also tried to use the override_metric in the Prometheus config which only changes the name.

I don’t know if that’s good enough but you could map the real value to a new entity which modifies the original value.

the unit will not change but you can operate based on the value.

similar to the workaround for my smart plugs power value being 15.000w instead of 15w

Thanks for the suggestion @senna1992.

My solution was to keep the existing values in c and convert them in my Grafana graphs.

(ha_temperature_c * (9/5)) + 32

Unrelated but led to this post – I’ve always had Influxdb installed for a few years but never understood it. Yesterday I tried out Prometheus and VictoriaMetrics and ended up on VictoriaMetrics.

I prefer the pulling from the Prometheus scraper and not the Influx pushing from Home Assistant. In Grafana I can map all necessary Temperature Values in one query using the override metric - temperature_c.

I would have liked to use Prometheus but its Docker instance does not support Environment Variables and there were too many Commandline arguments to keep track of in my Unraid config (Post Argument textbox is small). I believe VictoriaMetrics has the ability to delete and change data (by exporting and importing). So this has me covered if I need to add more metrics but the names are wrong. I have OCD and don’t want to sift through unused metrics.

1 Like