webCoRE Update v0.3.10a.20190223 - adds $twcweather to replace discontinued $weather, bug fixes


#41

I appreciate the suggestion, but it does not seem to be working (apart from if I’m doing something wrong. (I do not have any programming experience and I blindly follow examples)

And

Also, I can’t figure out where to add what to get the statement to work in conjunction with the rest of my expression:
“It’s currently {$twcweather.conditions.wxPhraseLong} with a temperature of {$twcweather.conditions.temperature}°C. The expected Minimum and Maximum temperatures for today and tonight are {$twcweather.conditions.temperatureMax24Hour} and {$twcweather.conditions.temperatureMin24Hour}°C. Today it is expected to be {$twcweather.forecast.narrative[0]}. Sunset will be at {Sunset} tonight.”
I tried :
replace({$twcweather.forecast.narrative[0], ‘/(degrees?) C/’, ‘$1 Celsius’})
replace({$twcweather.forecast.narrative[0]}, ‘/(degrees?) C/’, ‘$1 Celsius’)
but none of these statements work if I add them to my Expression. As soon as I add the latter statements within the “…” of my expression, the statement causes the Expression to fail.

Sorry for being a nuisance.


#42

Ahh it’s 16C not 16 degrees C. Looks like you put it in the correct place but let’s use this pattern instead to allow a space or no space following the number: replace(replace($twcweather.forecast.narrative[0], '/([0-9]) *C\\b/', '$1 degrees Celsius'), '/(degrees?) *C\\b/', '$1 Celsius')

That should work properly with variations like 55C, 55 C., 55 degrees C, and 1 degree C without messing with words that begin with capital C like 12 Cold days.


#43

That works! Much appreciated! (Sorry for the slip in my initial post about this issue.)


#44

This is still giving me trouble, I can see all the alert data at $twcweather.alerts and $twcweather.alerts[0] is empty…


#45

What does $twcweather.alerts look like for you (I only get [])?


#46

It is an array of alerts with data that can be seen in the ST example e.g. $twcweather.alerts[0].eventDescription.

The remaining problem with alerts is that $twcweather.alerts[0] is looking for a weather feature called alerts[0] since it only splits on . dots. Fix coming within the next 15 minutes or so.


#47

Another update was just pushed out to the webCoRE Piston smart app to fix alert access. In the last update I was able to see all the alerts but could not access data within them. Now this will work properly: $twcweather.alerts[0].eventDescription.


#48

Thanks for tackling this. I love the weather functionality, and was dissapointed to see WU going away. Really appreciate you guys being on top of it.


#49

Wow, bummer about Weather Underground. It looks like TWC is pretty good, but I’m still missing two things: Illuminance (lux) and daily forecast.

Any thoughts on how I can evaluate if it’s dark outside?

Is there format or syntax that does something like $twcweather.forecast[1].wxPhraseLong that would indicate tomorrow would be “Partly Cloudy”? That’s invalid, btw. It’s what I’m trying to do, though. I want to know tomorrow in general, not specifically ‘n’ hours from now or morning/night.

Thanks for your help!


#50

How about, “formatDateTime($sunset, ‘H:mm’)”.
Which for here/today results in (string) 17:52


#51

TWC distinguishes between day and night - if you are looking for tomorrow during the day, you can use

$twcweather.forecast.daypart[0].wxPhraseLong[2]

(or [3] for tomorrow night):


#52

I’m going to post a working example of my weather alert piston here

so as to not hijack this thread. Thanks to @ipaterson

I should add that it is a modified version of one I found on here about 1.5 years ago. I can’t take full credit!


#53

I haven’t seen $twcweather lux or illuminance parameter yet. I use a lux sensor for determining this.

{$twcweather.forecast.narrative[0]} = Today
{$twcweather.forecast.narrative[1]} = Tomorrow
{$twcweather.forecast.narrative[2]} = Day After Tomorrow
etc.


#54

Interesting - I guess it depends how much information you want. Things look different when asking for the forecast for tomorrow vs. tomorrow day/tomorrow night:


made this a banner . It will appear at the top of every page until it is dismissed by the user. #55

#56

It’s worth noting that the pricing for SmartThings’ access to this weather API is most likely based on the number of requests each month across the entire platform. That’s no small expense so please consider avoiding whatever you may consider to be excessive use of $twcweather.


#58

What do you use icons in WebCoRE for?


#59

Thanks for the suggestion. I tried that, but it doesn’t play nicely with Echo Speak. The time is announced as “It is six colon twenty-three”.
I played around and got to this: formatDateTime($sunrise, ‘H mm’) " A M" which seem to work.


#60

They can be used in various places around the dashboard, like in dashboard tiles, piston state, and log messages. Here’s an example of weather icons used in tiles:


They don’t work outside of the dashboard such as in text messages or push notifications.


#61

Hi-
`$twcweather.forecast.temperatureMax[0]’ returns empty… using [1], all the way up to 8 (that I tested) returns valid values.

Is this a known issue?

Using $twcweather.forecast.temperatureMin[0] works as expected.