Triggering events off a negative temperature


#1

1) Give a description of the problem
I’m trying to create a piston that will turn on and off my freezer based on temperature. This is a deep freezer and in Celsius runs from -18C to -22C, in F it runs 0 to -4f. In Smartthings I see the temperature listed and shown as -22C. In Webcore I cannot utilize the “-” (negative) value and thus would be limited to values 0 and above.

2) What is the expected behaviour?
Ability to enter in a negative value

3) What is happening/not happening?
In Global variables the negative becomes an underscore. In the rules there is no option to enter a negative value

**4) Post a Green Snapshot of the piston![image|45x37] Version:1.0
only when
(
Temp_Freezer (temperature1)'s temperature is greater than 0°F
)
execute
with Grid freezer power do
Turn on;
if
Temp_Freezer (temperature1)'s temperature is less than 4°F (s/b -4F)
then
with Grid freezer power do
Turn off;

5) Attach logs after turning logging level to Full
(PASTE YOUR LOGS HERE THEN HIGHLIGHT ALL OF THE LOGS AND CLICK ON THE </> ICON TO FORMAT THEM CORRECTLY)

REMOVE BELOW AFTER READING
If a solution is found for your question then please mark the post as the solution.


#2

If the global is a string, integer or a decimal, then negatives will definitely work.

This piston:

temp

Successfully changed this global variable:

temp


Underscores automatically replace illegal characters. I suspect the device handler is sending an extra character in there somewhere.


#3

Thanks for the quick response. Answer was exactly what I needed. Toying with the idea to power cycle my freezer to conserve power. Might end up being negligible savings but if nothing I’m learning more about webcore.

define
integer lowtemp = -4;
integer hightemp = 0;
only when
(
Temp_Freezer (temperature1)'s temperature is greater than {hightemp}°F
and
Griddy Wholesale Energy Price’s power is less than 8W
)
execute
with Grid freezer powerdo
Turn on;
taskend with;

if
Temp_Freezer (temperature1)'s temperature is less than {lowtemp}°F
then
with Grid freezer powerdo
Turn off;
taskend