Help with temperature variable output


#1

1) Give a description of the problem
The virtual temp sensor is not displaying the average temperature. Its just saying True

2) What is the expected behavior?
Should be displaying average temp.

3) What is happening/not happening?
(PUT YOUR INFO HERE)


#2

I’ll bet the four IF conditions at the bottom of the piston don’t evaluate to True. But you honestly should not need them anyway. If the temp changes you’re already running the piston in the highlighted section…and if they don’t change, well, the answer is going to be the same, so you don’t need those either.

Try this, just eliminate all the lines I’ve drawn through so that the bottom portion of the piston executes every time the piston runs.


#3

Thanks for the advice. I’ve modified the piston. This is what it looks like now.

Makes complete sense why you suggested those edits. However, the virtual temp sensor is still reporting true instead of the average temp.


#4

Sorry I should have been more clear. I think you want the set variable commands to happen every time, rather than be tucked away inside of an IF condition. So move those out to the end as I’ve shown below. Also I added a debug statement for the log file so that you can Test this and see what it looks like there. Lastly I’ve changed the avg_temp variable to a decimal instead of a dynamic. That might make a difference as well. Try it and see.


#5

YES! That fixed it! Thank you so much. Ive been looking at this all day.