Can this code be shortened using variables?

Many thanks, alto777. You have been extremely helpful.
I just now had a chance to review your suggestions and they are spot on, however, I have a problem...
I am about to use this code on a Nano and put it on the Arduino IoT.
I don't know how much experience you've had with their IoT coding, but I have found that when I set up my device and use their IoT procedures ( creating a "Thing" and a "Dashboard"), their software sets up the variables automatically (sensors and other variables are named there and inserted into your sketch automatically based on the type and other parameters). So, for example, where you correctly suggested to use the variable "output" in place of oATemp, unless I can figure out how to correctly modify my coding to reflect that variable's 3 different possible values in this case, I don't know if this particular approach will work.
I will continue to noodle the solution. It is quite a challenge to a noob such as myself.
Thank you again.