I have read a number of threads in here and trialled a number of json formula’s before posting. I have a temperature sensor that outputs Fahrenheit and I want to convert it to Celsius… simple right.
You will note the value_template is commented out… that’s because I have been trialling with and without.
Here’s what I see in the dshboard… note the celcius icon but the temperature is in Fahrenheit.
Embarrassed to ask, as obviously I am doing something wrong in the json area… I have tried a number of formulas to try and convert from Fahrenheit to Celsius but no success.
You can set the precision in the UI, or in your template. My guess would be that you were only rounding the number 1.8 as filters preceed all other operations. You need some brackets like this:
Fair enough, I agree my post didn’t explain it well.
After adding the suggested code you provided I went to the screen below and clicked on the ALL YAML (red circle) and it gave me a red square error… when I normally get a green box with a tick.
I’ve restarted the yellow instead of clicking on the ALL YAML option, and it now appears to be working. Apology for any confusion, or if I’ve done something I shouldn’t have.