[PROJECT] Weather Service Monitor 4 Hubitat Driver

Summary:
A general purpose driver for monitoring a weather service. Multiple different weather services are currently supported so when you install the driver you will need to select one (it does not monitor multiple per device, however you could add multiple virtual devices to monitor different services). The Hubitat's location is used to provide the service with a location to receive the weather for. This is not meant to be a "real time" weather method but rather one to get general weather for the day or next day. Basic "what is the weather like" type of information.

Driver(s):

Features:

  • Provides same day/next day forecasting and basic weather.
  • Can enable child devices to get specific day forecasts (as of version 0.9.0). Only available for US, WA, and WU services at this time.
  • Available within the Hubitat Package Manager (HPM).

Services Currently Supported:

2 Likes

Yeah, quite a bit actually

Doh. Guess I should reach out to @bptworld about including the UK Met Office... I hate to duplicate work when I know about it, annoying I did not find that project when looking before, especially since it is recent.

I will say I was focusing more on the Forecasting side of it than the current weather (due to my Ambient PWS)...

@snell I think a lot more people would be interested with the news of Dark Sky going the way of Apple. I just posted on bptworls weather site asking him if this looked viable https://openweathermap.org/ they do seem to have a free api which can accept 1000 calls per day? I would hope that someone would be able to provide anybody around the globe with a nice weather app, I personally like to have a 3 day forcast, sunset and sunrise data and if at all possible a lux reading.

They are obviously expecting more action as this is under the new 1 call api

OK... Their API is pretty simple and getting an API Key should be something anyone can do. I am pretty sure I can have the basics incorporated into my sample driver tonight. I should be able to post the initial version tonight.

Calling quits for tonight, but I have posted a very rough sample of the .groovy for now. It does the basics but needs a lot of cleanup and I have not worked to get any of the values to the "standard" Hubitat attributes yet.

2 Likes

@snell have loaded your driver for open weather and inserted my api key and it pulled some data through, so looking promising. Will follow this project with great interest. I know it is early and I know you get lots of "please can you do this and that", but could you see if it will pull sunrise and sunset data as well as lux levels. These are basically the main 2 bits of data I use in rules and then the weather tile is a nice to have on the dashboard.

It definitely has sunrise-sunset data. I just did not bother with those because I figured most people would just get those values directly from the Hubitat. Except I had not thought about the FORECASTING aspect...

I should be able to add those in easily enough. Just need to add a conversion (they are not a "readable" time).

The biggest problem I think I am going to have is determining how attributes should be presented... Cannot make them as an attribute map, so it is not like I can have an attribute that is "Tonight" with all the values related to tonight within it.

@snell

I don't really make use of the sunset time directly, but I have a tile on my dashboard with the sunset time showing, so I can actually see what time the lights should be turning on if I have used this in RM. The most important (and probably most difficult) is the LUX reading. I know this is not accurate but it does give me some sort of "brightness" indication. I am looking at getting a lux sensor in the future, but at the moment I use Dark Sky for this reading to get lights to turn on even before Sunset if it is dark enough

Thanks for the effort you are putting in. .

Are you aware there is already a built-in device driver for OpenWeatherMap in Hubitat?

1 Like

I am aware of it, but I am making this as a broad weather service driver. Maybe people will find it useful, maybe not. Plus, the built-in version only provides a portion of the available weather data as well as none of the Forecasting.

I'm a happy user of your Ambient Weather Driver so I'll be following your work here as well. I am very interested in the driver for Weather.gov.

BTW, thanks for all your hard work!

I have also posted recently.as I am looking for a rain % to use for a umbrella reminders it wouldbe nice to see this from weather driver that is not darksky

No worries. I started this yesterday "just because" with the US one. Then I remembered someone commenting before that it is great for the US but what about others and I think they were in the UK. So I checked for that... I figured I would just make it more convenient.

% of rain would be problematic from the US one as it does not provide it (not in the sample I have, see below). The UK has it in theirs as does OpenWeather, so overall it will be in the driver. Maybe tonight... maybe over the weekend.

{
            "number": 3,
            "name": "Thursday",
            "startTime": "2020-04-16T06:00:00-04:00",
            "endTime": "2020-04-16T18:00:00-04:00",
            "isDaytime": true,
            "temperature": 40,
            "temperatureUnit": "F",
            "temperatureTrend": null,
            "windSpeed": "13 to 17 mph",
            "windDirection": "W",
            "icon": "https://api.weather.gov/icons/land/day/snow,20/snow,30?size=medium",
            "shortForecast": "Slight Chance Snow Showers",
            "detailedForecast": "A slight chance of snow showers between 8am and 1pm, then a chance of rain and snow showers. Mostly sunny, with a high near 40. West wind 13 to 17 mph. Chance of precipitation is 30%. New rainfall amounts less than a tenth of an inch possible."
        },

It is in open weather map. You can see the discussion here Chance of rain %?

That is what I said, it is in OpenWeather. Just people only relying on the US NWS would be out of luck. But if you are looking at the OpenWeather one, you will be able to have it and I will be putting it in soon I think.

UPDATED:
Version 0.03 is now posted. I have added in ChanceRain & Sunrise/Sunset information (both Epoch & Date formats) for OpenWeather & UK, among other things.

Version 0.04 is now posted. This had a pretty substantial rewrite of how data is handled... But the main things useful to users are:

  1. Many more attributes are now covered per service.
  2. Icon URLs are now included for those that want them (US & OpenWeather).
  3. DetailedForecast from the US service is now parsed for information like chance of rain, snow, or wind gusts. So even though the API results did not directly include those, they will be provided to users if they are in the forecast.

UPDATED (2 days later):
Version 0.05 is now posted. Main changes are:

  1. Weather API is now added.
  2. World Weather Online is now added.
  3. Confirmed Australian weather is accessible via the UK API.

I have been trying to find if particular countries have national weather service APIs that can be checked (without an upfront cost just to develop it). I am open to additional services to add in, just let me know.

1 Like

Version 0.06 is now posted. Mostly just a rework of how data is posted and handled, it made the driver substantially smaller and easier to work with.