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


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


#75

Thank you for the information Ian, I just learned from another thread that AccuWeather provides hourly forecast for free registered users, might as well do an HTTP call to the API and get it, plus it’s well documented!


#76

do you have a link to this? i might try to set this up as well


#77

Here is the thread:


#78

I used to use the snowfall.day, nighttime etc.

Now there for static values, there is only snow1Hour, snow6Hour and snow24Hour which is unfortunate, but what are the intervals in the array $twcweather.forecast.qpfSnow[0],$twcweather.forecast.qpfSnow[1], etc? I assume they are daily since they are in the forecast group.

What are the intervals for $twcweather.forecast.daypart[0].qpfSnow? i.e. hourly?

Also, the same for $twcweather.forecast.daypart[0].snowRange

We are currently going to get 7.3 inches (valiated by the $twcweather.forecast.qpfSnow[0]), but none of the 2 above (going out [1],[2].[3] + all come back with 0.


#79

Based on the day names and day part names in the data we believe the forecast values to be daily for 14 days and the daypart values to be morning and evening always beginning with the morning of the current day. We don’t have access to any documentation for the data the SmartThings is using so operating on best guesses. No idea why the day part data would be so drastically different from the daily forecast.


#80

Hmmm…

daypart shows an array of:

[
0,
0,
0,
0,
0,
0,
0,
0
]

So what are all the values? If they are day and night, I would think there would be only 2 array values.


#81

I have finally have some free time to try to convert my weather monitor piston to look for codes in the new API and today there was flood warning in another county but not here but here is the payload I received from the API call using {$twcweather.alerts[1]}. looking at the payload I found the:

phenomena:FL

But my bigger question is why am I seeing a alert for another area? I thought it was supposed to use my location “long/lat” for forecasts and alerts. Am I looking at this right, I am in Cook county not Kane County?

[adminDistrict:Illinois,
adminDistrictCode:IL,
areaId:ILC089,
areaName:Kane County,
areaTypeCode:C,
categories:[[category:Met,
categoryCode:2]],
certainty:Unknown,
certaintyCode:5,
countryCode:US,
countryName:UNITED STATES OF AMERICA,
detailKey:771b47a0-bf02-37e4-b27b-599150b49444,
disclaimer:null,
effectiveTimeLocal:null,
effectiveTimeLocalTimeZone:null,
eventDescription:River Flood Advisory,
eventTrackingNumber:0065,
expireTimeLocal:2019-03-17T07:00:00-05:00,
expireTimeLocalTimeZone:CDT,
expireTimeUTC:1552824000,
flood:[floodCrestTimeLocal:null,
floodCrestTimeLocalTimeZone:null,
floodEndTimeLocal:null,
floodEndTimeLocalTimeZone:null,
floodImmediateCause:Excessive Rainfall,
floodImmediateCauseCode:ER,
floodLocationId:AFBI2,
floodLocationName:Fox River at Algonquin Tailwater,
floodRecordStatus:N/A,
floodRecordStatusCode:OO,
floodSeverity:None,
floodSeverityCode:N,
floodStartTimeLocal:null,
floodStartTimeLocalTimeZone:null],
headlineText:River Flood Advisory until SUN 7:00 AM CDT,
ianaTimeZone:America/Chicago, identifier:9d20a54780963ab5bb05889f45552dc3,
issueTimeLocal:2019-03-10T10:46:00-05:00,
issueTimeLocalTimeZone:CDT, latitude:41.94, longitude:-88.42,
messageType:Update,
messageTypeCode:2,
officeAdminDistrict:Illinois,
officeAdminDistrictCode:IL,
officeCode:KLOT,
officeCountryCode:US,
officeName:Chicago,
onsetTimeLocal:null,
onsetTimeLocalTimeZone:null,
phenomena:FL,
processTimeUTC:1552232775,
productIdentifier:FLS,
responseTypes:[[responseType:Avoid,
responseTypeCode:5]],
severity:Moderate,
severityCode:3,
significance:Y,
source:National
Weather Service,
urgency:Unknown,
urgencyCode:5]


#82

We do not have access to any documentation for the weather data that is coming out of SmartThings.


#83

Please refer to $twcweather.forecast.daypart[0].daypartName. We don’t know for sure but have assumed that all values under the daypart data follow the same pattern.


#87

I don’t see a way to get chance of precipitation within the forecast. Am I missing something? This is the most important part of a forecast (to me) but the narrative gives only vague hints like “rain” or “thunderstorms” or doesn’t mention it at all.


#88

For the next 15 days broken down into 12 hour blocks, you can use this:
$twcweather.forecast.daypart[0].precipChance
which currently yields this for me:
[null, 0, 0, 20, 0, 10, 10, 0, 0, 10, 10, 10, 40, 50, 40, 0, 0, 10, 10, 10, 50, 50, 50, 40, 40, 40, 40, 40, 40, 40]

To only pull a single data point, you can add [x] to the end. For example,
$twcweather.forecast.daypart[0].precipChance[3]
pulls tomorrow night only. (using the numbers above, yields 20)


removed this banner . It will no longer appear at the top of every page. #89

#90

Thank you!


#91

I want to trigger action when there is a tornado warning. Is it sufficient to just check alerts[0].eventDescription for “Tornado Warning”? I’m not sure exactly what alerts[1] and so on are - are those previously issued alerts and if so does every alert start at [0] to where checking [0] is indeed sufficient? Or are they multiple alerts that are currently active, such that even alerts above 0 need to be checked?


#92

Hi guys - I had been using weather underground to get the outdoor temp, outdoor humidity and dew point prior to the API being shutdown. I had a piston that ran 4 times an hour and called that API, and set global variables to hold these values. Then from any piston I could just access the values from the global variables, which were kept up to date by the piston, refreshed every 15 minutes.

I see that twcweather has $twcweather.conditions.temperatureDewPoint, $twcweather.conditions.temperature and $twcweather.conditions.relativeHumidity. It looks like I can just reference these in my pistons. It is that easy?

A couple questions though:

  1. How do I tell twcweather what my zip code is that I want these readings to come from?

  2. How often do these twcweather values get refreshed, and how can I control them to make sure they are updated at least 4 times and hour, maybe more if allowed?

Thanks!


#93
  1. It gets your location from your hub, make sure you have dropped the pin on your house in the ST app settings.

  2. We don’t know how often they update existing data, but the day / night cycle (where the array for 15 day forecasts moves a notch) updates over a 30 minute window between 1am-1:30am and 1pm-1:30pm ish


#94

Is this still true for you Robin?

My location updates consistently between 3 and 3:30 ish