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


#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.


#62

Depends on the time of day… index [0] relates to Daytime today, therefore if you are checking index [0] at nighttime, it will return null as that time has already passed.

Index [1] = tonight
Index [2] = daytime tomorrow etc. etc.


#63

I have my dense hat on apparently.

I simply want to get a reading of the forecasted high for the day. I do my check at 3am. So what index should I use because yes, at 3am I get 0 if I use [0].

As reported above, Min[0] does return me a real value when I check at 3am.


#64

Use $twcweather.forecast.temperatureMax[0] || $twcweather.conditions.temperatureMax24Hour for today’s high I guess.

The morning and night distinction only applies to the data under forecast.daypart (see forecast.dayOfWeek, $twcweather.forecast.temperatureMax is a 14 day forecast but dayparts splits night and day)

We don’t have any real documentation to tell us exactly what the values mean. I see the null on temperatureMax as well (night time currently). Is it possible that it changes to null once the high temperature has passed? That would really suck.


#65

I think I’m going to have to patch in these missing numbers from $twcweather.conditions.temperatureMax24Hour. What a lousy API to drop values like that, it’s unreasonable to require everyone to tiptoe around those null values in pistons

I’m going on 27 hours without electricity but if I have power and internet tomorrow I’ll try to figure something out.


#66

Thanks Ian. Hope you get power back soon.


#67

Is there an API for conditions for .cloudCover? Right now it seems that there is only .cloudCoverPhrase. In the forecast.daypart there is .cloudCover that returns an integer.


#68

My guess is that cloudCover indicates the percentage of cloud cover (i.e., 0-100).


#69

{$twcweather.conditions.windGust}

returns null also.


#70

For now all I can recommend for those of you who need forecast data for the current day is to set up a piston to run every morning after 7am and store the values you need to global variables then use those instead of the potentially null [0] slots.

If we’re able to patch over the missing data in webCoRE it still won’t cover a few metrics that do not have counterparts in the conditions data.

Would someone please search the ST community for discussions of this problem, or start a new discussion to make sure other smart app developers are aware of the data issues? Then link the thread back here for reference.


#71

Yup. That was my guess. However, conditions.cloudCover is not available and is only available in the dayPart API. Was just wondering if this was whether the original API that ST gets does not have that field, or was accidentally overlooked on the webCoRe end.


#72

We’re just using the ST functions directly so all the data is unmodified from what is available to all smart apps via ST. It looks like they pulled only some of the Weather Company data endpoints but I haven’t compared every field to see what was missed on any specific endpoint like conditions or forecast. It looked like they map snake_case_names to camelCaseNames so it’s possible that it’s not a 1-to-1 clone of the Weather Company data, but also possible that the source data is lacking.


#73

Hi @ipaterson,

Greetings! I noticed you mention there’s no hourly forecast available for the new API, if so what would you recommend to get similar function with new API? I have a piston checking future 1 hour weather to decide the time for lights to turn on.

And also can you help to get a list of possible values for conditions.wxPhraseShort ?

Many thanks!


#74

You will need to find weather smart apps to fill in data that is not available in the TWC API.

Sorry, but we have not found any public documentation for the API that SmartThings is using. Some fields seem to correspond to this Weather Company REST API documentation or this PDF or a few random Google docs that come up in searches, but nothing is 1-to-1 with the data we see coming from SmartThings (docs are for v1 API but I think ST uses the new v3).

That PDF describes the value of wx_phrase as “257 phrases” with no examples which is probably not helpful to you. It is also probably larger than the number of short phrases which may come from blunt_phrase or terse_phrase or a different API entirely.

I am reaching out to a few people who may have more info about this API so that we can track down docs and stop the guesswork!