[PROJECT] Weather Service Monitor 4 Hubitat Driver

@snell Thank you for this solution. Quick question, do you know if there is a way to forecast level of rain in addition to chance of rain? I would like to determine if sprinklers should turn on, and if chance of rain is just going to be light, Id probably still run the sprinklers

Maybe there is a better way to determine this based on past days rain levels or something

Any ideas from the group would be great

I guess the main question is "Which weather service are you using?". I tried to implement most every data point they return but I could have missed something or maybe that service does not actually provide something that would work for you. But I am willing to check once I know where to look.

I am using Weather.gov, but my question was more if you might know if any of the services do hourly forecast/precip.

I just stumbled on Pricing - weatherstack ... which does have hourly at a subscription level though

Looks like World Weather Online has an hourlyRain as an attribute. Trying to figure out what hourlyRain : 0.0 actually means

Looking over the Weather.gov spec it does not appear to have any type of "amount of rain" for the forecast section although there are warning items about "heavy rain". Not exactly what you need.

I cannot check much on World Weather Online because they only offer subscription services now and my developer API key is considered expired/invalid... The hourlyRain attribute shows you what the expected rain will be right now, in the response it has received. I did not break their forecasting out on the hour basis, I am just checking it for today/tomorrow type of data.

Just peeked at your code and the API response, as you said its hourly over 24 hours .. so that should be what I need ... if I wanted to pay :frowning: .. lol

I know... I put most of these in when most services had free versions. But now that is tougher to find or some make it very difficult to determine the most basic level.

I can try to expand the forecasting for WWO like I did some of the others but even those I did it as a per-day method not per hour.

I think per-day is fine .. I cant actually think of a use case for me where I need to know it per hour. But answering the question "will it rain today, and how much" is answered ... thank you !

Updated Version(s):

  • WeatherSensorChild.groovy = 0.8.5

Change(s):

  • Changed to a new method to replace the no-longer-functional htmlTemplate. You will have to set it all over again and Save Preferences. The new attribute is called "Tile". It functions the same as the previous one but < > characters should be replaced with [ ]. It should handle all standard HTML commands if you remember to use the [ ] instead.
  • Removed the Clear command. Not much value in removing all the current state data outside of testing purposes.
  • Update to the Logging method, both the Preference structure and how it actually gets implemented. This driver had not been updated yet in 2022 (and not sure when in 2021 it last was) but it was not using my "latest" method of Logging.
  • Update to the driver update check mechanism. :slight_smile: Some cleanup and bringing it in line with my "current" methods of performing this.
1 Like

Did not realize it had been so long since there was an update here... There have been multiple version changes to the WeatherSensorChild since the last post. No changes to the parent driver (no requests) in this timeframe though. It just does what it needs to do.

Updated Version(s):

  • WeatherSensorChild.groovy = 0.8.13

Change(s):

  • Added a daily schedule for driver update checking (does NOT update the driver, just checks for the latest version number from my website and posts an event "Driver Status"). This is scheduled when a new device is added or the user does Save Preferences.
  • Added handling for forced event notifications
  • Additional Air Quality attributes
  • Fixed copy/paste error that removed a number of attributes
  • Added command allowing state variables to be cleared
  • Additional attributes added and corrected 24hr typo on some attributes
  • Added attributes for AQI with 24hr average
  • Additional attributes for air quality sensors

Just installed this device but I need some help. when using the United States National Weather Service as the one to query, I don't think I am getting the forecast for my location.
Is there a way to specify which city I want the forecast from? Can I show forecast from multiple locations?

When it is using the US NWS it will automatically use the latitude and longitude provided by the Hubitat to query NWS for the CWA, GridX, & GridY values they require (they will be saved in the device as State Variables). Then the next time it polls it will send those values instead.

As a result, it cannot show multiple locations even if multiple virtual devices were used because they would all show for the same location that the Hubitat is set for.

If this is really something needed... I could probably build an "override" mechanism into the Preferences so someone can enter different coordinates.

Oh okay. I don't seem to be able to find the attribute for current temperature though. It is only returning today's high in Today_Temperature and Temperature.

This driver is meant to provide the forecast/days data, not current values. So the Today_Temperature and temperature are the same, and what the API returns as "today's temperature".

When I wrote it there were a number of other weather-service drivers focused on the current information but a lack of forecast data (and I also did some additional services beyond the US). I did not want to take away from any of the existing drivers that did current weather. Plus, Hubitat comes with a built-in driver for OpenWeatherMap.

I also have drivers for a couple types of weather stations, and those DO provide current data.

I am fairly new to Hubitat so I wasn't aware of the other weather drivers or even the built in driver for openweathermap. I will look into those. Thank you for pointing me in their direction.

Happy to help! Another spot to look for drivers would be the Custom Device Drivers Wiki.

I found your driver because I was looking for current cloud cover in the UK to decide what my blinds should be doing. Openweathermap gets it completely wrong, but the UK Met office data is correct.

I noticed two things:

  1. Sadly your driver isn't the one I'm looking for because I need the hourly data, not daily.
  2. The driver is hard coded to return the data for Uxbridge, not for the location set for the hub.

The Met Office sign up is much simpler now. You just enter your details, get the client ID and secret and yoi're done.

Thank you for the work on this. I'm going to take a look to see what I can do with the hourly API.

1 Like

@guy2: Ah! I had Uxbridge in while testing (since I am not in the UK I could not leave it location-based) and I must have not removed it and nobody until now mentioned it. I will correct that and get a new version released for my time tonight.

As for the rest, yes... unfortunately I made this to be an overall "day" or couple day forecast because I did not want to take over for anyone else's weather drivers (or the built-in one). It would be possible to make one though... since the data is there in their API. I suppose I could look into that tonight as well.

I pulled the hourly data to take a look at it and it seems to have what I want. I think I'm going to need to combine the weather code and the UV index in some way. The hourly data says when it was generated then you get a set of time slots so it's just a matter of picking the current one.

Thank you for looking into it, I know it's not the primary purpose of your driver.

The timeslots look like this:

..."modelRunDate": "2023-05-24T13:00Z",
"timeSeries": [
{
"time": "2023-05-24T13:00Z",
"screenTemperature": 18.3,
"maxScreenAirTemp": 18.34,
"minScreenAirTemp": 17.69,
"screenDewPointTemperature": 7.81,
"feelsLikeTemperature": 16.73,
"windSpeed10m": 3.14,
"windDirectionFrom10m": 11,
"windGustSpeed10m": 4.63,
"max10mWindGust": 4.72,
"visibility": 24306,
"screenRelativeHumidity": 49.69,
"mslp": 102480,
"uvIndex": 6,
"significantWeatherCode": 1,
"precipitationRate": 0,
"totalPrecipAmount": 0,
"totalSnowAmount": 0,
"probOfPrecipitation": 0
},
{
"time": "2023-05-24T14:00Z",
"...

There's an extended list of weather codes here: