Reading Weather for Thermostats


#1

Ok sorry again if it’s me, i’m slowly learning and i’m a visual guy so just reading text without seeing it in action does nothing for me.

On that I appreciate the help you guys give me and i’m sorry to bug you all again.

My next next step I need to do is outside weather, in the wiki i’ve found this command

$weather.conditions.current_observation.temp_c

Which should get my local temperature based on my smarththings hub.

What my question is tho is how do i apply that line in a piston?

My goal is to do something like this

Each 10 minutes to check $weather.conditions.current_observation.temp_c

Then if temperature reported by $weather.conditions.current_observation.temp_c is between -1 and -30 to set my thermostat setpoint to 20 degree

Thanks again


#2

Maybe something like this?

“temp” is a dynamic variable, and I chose “expression” to populate that variable.

Then a timer every 10 minutes… add an “IF” condition to see if $temp is between two numbers, then add your action to set your thermostat (I didn’t add that part in this example cause I don’t have one locally).

edit: spelling…


#3

That could work, I have big problems with variables lol

Also about that Dynamic temp = the text

Is there a command I can use just to display the result? So i can compare with stuff like weather nextwork and etc

Thanks


#4

When editing the piston, there’s a button at the top left which gives the option to toggle the “evaluation console” on/off… When “on” it’ll appear at the bottom.
In the eval console, just past in “$weather.conditions.current_observation.temp_c” and choose “expression” in the left hand drop-down… it’ll return the current value.


#5

Updated the piston, changed the var to a type decimal.
“is inside of range” works, just tested it, returns true and logs the temp to the logging console.


#6

It worked! Thanks!

I tried for fun if temps is between instead of is inside of, and it seems that 3,3 is not between 3 and 10

lol


#7

The comma might be screwing it up. Try 3.3 (3 period 3) instead


#8

3,3 was the value returned by the var


#9

Someone please correct me if I am wrong, but I believe the comma is usually reserved to separate elements in webCoRE. So for example, 3 comma 5 is read as two different numbers.

It is strange though, because when I test:
$weather.conditions.current_observation.temp_c
it comes back as a decimal (period) instead of a comma


#10

Here we use the coma to separate numbers

Exemple for $$

In USA you guys do 1,300.50
In Canada it,s 1 300,50


#11

You’re gonna need to use decimals for any type of integers.
If you want to eventually see commas in the output, you could convert that variable at the end…something like this: