[SOLVED] Change Temp from C to F

Maybe I missed it but is there documentation to change the display from C to F?

Thanks!

Sorry I didn’t reply to your other post. I’m on holidays right now and I don’t have access to my HestiaPi. Will make a sticky post on a new “How To” section with instructions. Till then the steps needed should be:

  • Change thing and/or sitemap to cover the number range you want (right now covers the C range like from 0 to 35 or something. Adjust around 70 degrees range)
  • Modify the script called by the item that gets the temp reading from the sensor (its one of the files in the ~/scripts to return the value in F rather than C. Its a simple mathematical instruction T(°F) = T(°C) Ă— 9/5 + 32 )

If you manage to do it successfully, document it here and I’ll make a script to switch from C to F and vice versa (or simply a button in the LCD :wink: ).

I know you are but I was hoping someone else would jump in there :slight_smile: ENJOY your HOLIDAY and quit answering me LOL I will talk to you when you get back… this can wait! And, Thank you!

I think I just finished testing it. Fairly simple change (yet no one contributed it :frowning: ). Will polish it tomorrow and release a new image and/or instructions to update directly from GitHub.

1 Like

Decided to not include it on the LCD UI as it is something to be used only once.
Here are the commands to run over SSH in your HestiaPi Touch once you install the v3 image from the downloads section. Alternatively you can simply install v4:

sudo chmod 777 /etc/openhab2/rules /etc/openhab2/sitemaps;
sudo chmod 777 /etc/openhab2/rules/default.rules /etc/openhab2/sitemaps/default.sitemap;
cd /home/pi/scripts;
rm ./bme280.py;
wget https://github.com/HestiaPi/hestia-touch-openhab/raw/master/home/pi/scripts/F2C.sh;
wget https://github.com/HestiaPi/hestia-touch-openhab/raw/master/home/pi/scripts/C2F.sh;
wget https://github.com/HestiaPi/hestia-touch-openhab/raw/master/home/pi/scripts/bme280.py;
wget https://github.com/HestiaPi/hestia-touch-openhab/raw/master/home/pi/scripts/bme280C.py;
wget https://github.com/HestiaPi/hestia-touch-openhab/raw/master/home/pi/scripts/bme280F.py;
wget https://github.com/HestiaPi/hestia-touch-openhab/raw/master/home/pi/scripts/defaultC.rules;
wget https://github.com/HestiaPi/hestia-touch-openhab/raw/master/home/pi/scripts/defaultF.rules;
wget https://github.com/HestiaPi/hestia-touch-openhab/raw/master/home/pi/scripts/defaultC.sitemap;
wget https://github.com/HestiaPi/hestia-touch-openhab/raw/master/home/pi/scripts/defaultF.sitemap;
sudo chmod 777 F2C.sh C2F.sh bme280.py bme280C.py bme280F.py defaultC.rules defaultF.rules defaultC.sitemap defaultF.sitemap;

Then navigate to scripts dir:

cd ~/scripts

and run:

./C2F.sh

or to go back to Celsius

./F2C.sh

Within seconds the temperature displayed on the left of the LCD will change to F values and after a few seconds (once the rules file gets processed) the setpoint value on the right will update too.
Please test and report back so that I can publish it properly and let people know.

HUGE Thank you! Worked perfectly!