Cannot figure out outside temperture


#1

1) Give a description of the problem
Whenever try to set a dynamic variable named “outsidetemp” and put in the expression: $twcweather.conditions.temperature. I get "Variable ‘$twcweather.conditions.temperature’ not found

2) What is the expected behaviour?
I am expecting to see the outside temperature in the express


#2

That is the correct expression

pic


I am curious… Do any $twcweather expressions work for you in the bottom console?

pic


#3

Doesn’t look like it. I have webcore installed on my Hubitat C7.

Screenshot%202020-12-13%20183509


#4

I only get null when I querry $twcweather…
My question/suggestion was to test a few full expressions from that list. IE:

pic


I shifted this topic to the Hubitat category for better exposure.


#5

As of April last year…


#6

Well ■■■■! Is there any other way to figure out temperature at 5AM?


#7

Do you have a SmartThings hub?


#8

Nope I sold it to get the Hubitat hub


#9

Do you have a device outside that has a temperature sensor on it?
(or a device you could move outside?)


#10

I do not unfortunately


#11

Hmmm… Do you have an API key to any weather station?


#12

Nope!


#13

There used to be a few good free Weather APIs… (Wunderground, or Dark Sky come to mind)
…but I do not know of any at the moment. (they all want your money)

Maybe someone else can recommend a decent free one?


Pro Tip:

If your coding skills are good, you could always try using webCoRE to parse “localweather.htm” (stripping out the temperature) … but that is not an easy task on most websites.


#14

If i were to get a weather API what would be my next steps?


#15

Use webCoRE to make a query to that site using the provided key.

IE:

Make a GET request to {url}
Log to console = $response

#16

OpenWeatherMap has a free tier that might work for you…

It’s quite limited, but I just tested the current temp with success:

pic


You could enclose that logic inside a “Every day at 5am” block…


#17

What am I doing wrong here?


#18

It might not be you…
It took about 30 min (after email confirmation) for my new API key to actually be activated.
(the email says it may take a few hours)


Second, I cannot see all of your URL, but there are many different formats to go with.
I picked this one at random:
http://api.openweathermap.org/data/2.5/onecall?lat=12.345&lon=-56.789&units=imperial&APPID=myKeyHere

If you want to test outside of webCoRE, you can play with the URLs in a normal web browser.


#19

Got it awesome thank you, now I gotta figure out to how put this only on Wednesdays at 5AM and turn on an outlet if it is less than 32 degrees


#20

I’d probably surround it by an “EVERY” block, and add an IF condition inside.
Something like this:

Note: I increase to < 34 since that temp is an approximation…
(I don’t want your pipes to freeze based on my code, :grin:)