[PROJECT] Weather Service Monitor 4 Hubitat Driver

Wow! They made this WAY more complicated than when I wrote the driver originally. My current ID and Secret still pull in data (I have a location near Uxbridge I base it on).

I am using the "Site specific forecast" section (metoffice.apiconnect.ibmcloud.com/metoffice/production) where you select the Configure Spot API, then register an application. In my case I made an application for WSM4Hubitat.

Trying to figure out the whole other section for the "Atmospheric data service" but there are WAY more options in there than someone really needs.

After much messing around I think I managed to figure out where I was going wrong and I fully agree this seems way more complex than it needs to be even although the mistake was my end.

When you are creating the order and it comes to select location I was selecting UK and Ireland, I didnt realise you could zoom in on the map and make the area smaller, I have done this and it has reduced the data usage significantly, it has allowed me to add every option and the subscription is now showing active.

however upon checking the app it seems I still get no data in the WSM5Hubitat app.

When I check the log files it is showing an invalid APi key
dev:20312021-02-02 00:30:57.046 traceUK Weather (Met Office) - Invalid API credentials provided

dev:20312021-02-02 00:30:56.855 traceUK Weather (Met Office) - Invalid API credentials provided

dev:20312021-02-02 00:30:56.842 debugUK Weather (Met Office) - Refreshing...

dev:20312021-02-02 00:30:56.648 traceUK Weather (Met Office) - Invalid API credentials provided

The Strange thing is I am using the client ID and secret from the web page which checks out.

Maybe it just needs to settle overnight, at least that's what I am telling myself now, will keep digging tomorrow after work appreciate the help so far and the fact you create an app for this, thanks!

Got it working, I had subscribed to the Atmospheric API rather than the spot API, after doing that the app polled all the weather details in.

Good to hear! If you do not mind (since it is fresh for you) can you jot down the steps you did to get it working? I can add those into the driver so the next user has an easier time of it.

1 Like

At this point I put the Client\Secret ID into the WSM device I created from the driver and it started polling the information.

There may be a quicker\better way to do above but it took me a couple of hours to figure it all out with your help so the least I can do is share and it hopefully save someone else the extra pain that I went through trying to figure it out.

As you can see its not just a few steps and felt adding screenshots would really help the next person out.

2 Likes

WOW! I will have to figure out a decent way to put this into steps for people if I want it in the driver, but at the very least it is nice and fresh in the thread here! Thanks for taking the time to document it all AND for the screenshots.

Wow chaps, very well done on the Driver. What a faff to connect met office! But it works brilliantly!

I've used some simple rules to modify a bulb colour each morning to indicate if it's likely to be raining, cloudy or sunny, will see if it works!

Also, my surname is Snell, so I feel like I'm in good hands!

Ha! Well, there are some Snells out there and (in my case) it does come from ancestors from the UK.

Glad the Met Office comes in handy. I went around trying to find various weather APIs because people outside the US seemed to have more trouble getting weather integrated with their Hubitat. Unfortunately I did not find that many but what I did, I tried to put in here.

1 Like

Updated Version(s):

  • WSM4Hubitat.groovy = 0.8.2

Change(s):

  • Added additional refresh rate options of 10, 15, and 30 minutes.
1 Like

Is it at all possible to pull the indoor information off the displays or is this not broadcast by the station? I don't need the indoor temp sensor but could always use another humidity sensor to average with the Ecobee.

It depends on what the station sends back. I am just passing back whatever information the API has received.

When does "today" start? I know on others i can choose when today starts but i prefer this driver. Like i would like to be able to set today starting at sunrise...

From how I have been handling it, it generally starts at midnight, because that is when the APIs return their data for. I am only looking at the "whole day" values returned by the APIs, not breaking it out by hour or performing any calculations on them in the driver (besides Imperial/Metric conversions type of stuff).

If you do not mind my asking, which weather service are you using? I can try to take a look if they have any form of configurable request (so that I can tell it to return data based on a particular timeframe). Cannot guarantee anything... but I can at least look.

Weatherundergound via an acurite weather station.

It appears that, according to my station, "today" begins at 4am EST.

I will have to look into the data they provide back and check then. The fact it is such an arbitrary time... I will have to see if they just calculate it based on when the data request happens.

This one will likely be a bit slower to deal with, I will probably have to do it on the weekend, but I will still try to take a look before that...

Updated Version(s):

  • WSM4Hubitat.groovy = 0.8.3

Change(s):

  • Added ValidTime attributes to indicate when the API said the weather was valid as of (only applicable to WeatherUnderground at this time). Unfortunately WU does not appear to be able to have their forecast requested based on a particular time and it just returns the 5 day forecast as is. It DOES have a "valid as of" type of time included with that data for each day. So I have added attributes for Today_ValidTime and Tomorrow_ValidTime to display the time that WU returned for each of those days.
  • Added a 5 minute refresh option
  • Changed logging at data retrieval to be info level, so it will put an "info" log item each time data was successfully retrieved from any of the current weather services.

Thanks for the update. I built rules around the day starting at 4am. It appears 4am is the start of the day. So it works out quite nicely. Knowing the time helps.

" 2021-04-30T07:00:00-0400" 7-4? 3am? Now I wonder is the day 3am. I bet it's possible cause I have my light checking it on the hour. Hmmmm. Basically they consider the day to begin at 7am GMT. So it's not exactly arbitrary other than it being 7am...

Actually... I was wondering if it was 7am and the -0400 was the timezone for me (since right now I am -0400 from GMT). So I was thinking it was 7am local time, showing the timezone as well.

If you are in a different timezone than EST... then it could mean something different.

I'm est as well and it changes at 3am