[RELEASE] Enhanced Weather Underground Driver

Hi All, I found a number of issues with Cobra's version of a WU driver in the way it handles certain forecast fields, plus I've made a number of enhancements that I think are worthy of branching out.

To use Weather Underground with Hubitat, you need your own PWS (Personal Weather Station) connected to Weather Underground. I recommend the ECOWITT GW1101 Wi-Fi Weather Station. It’s a great unit and very affordable.

Major Changes:

Now Available via Hubitat Package Manager:

  • "currentConditions" has been renamed to "forecastShort" as this is a more accurate name.
  • Added "cloudCover" as I find this useful for automating Lamps around the house without having Lux sensors in every room.
  • My driver takes your location directly from your Hub rather than from WU (doesnt make much difference to operation)
  • Switches the WU language from en-GB to en-US as this seems to cause issues for Aussies and most likely Americans too.
  • forecastToday auto switches to day/night content
  • forecastTodayIcon auto switches to day/night icons
  • Weather Icons are hosted on GitHub, so there is no need to set up your own server to host them.

So the fun part is my Driver switches the detailed forecast from Day to Night automatically as soon as WU changes the day content to null. This is also great for those of us using icons as they switch too.

v6.3.0 has been released and includes the excellent 3 Day Forecast tile (html3dayfcst) developed by @swade.

Screen Shot 2022-10-14 at 10.01.45 am

Now includes a Weather Warnings Tile covering the next 3 days:
Screen Shot 2022-10-19 at 11.56.46 am

If you find any issues or have any ideas to improve it please let me know.

Install the driver by importing the below URL into a new HE Driver:

https://raw.githubusercontent.com/dJOS1475/Hubitat_WU_Driver/main/WU_Driver.groovy

PS, I'm not actually a developer, so feel free to constructively provide feedback on improving the code quality. Community Code contributions are welcome, and I will provide attribution in the driver.

8 Likes

UPDATES:

August 10th
v7.0.4 - added Spanish Language support

June 15th 2023
v7.00.1 by @swade

  • Speed Improvements. Improve 3 Day Forecast Tile and removed FeelsLike value since it didn't seem to be correct.
  • Improve Coding Logic. Added ICAO Airport Code for Forecasts.
  • Display an @ sign in forcast day if a WU warning exist for the day. Since WU doesn't provide illuminance, stop using solar radiation as it's value

November 15th

  • v6.10.0 - @swade fixed all my LoFi code and made lots of improvements under the hood - it is highly recommended that you use the "ClearState" function and then force a manual poll after upgrading to this version.
  • Also, please make sure after you upgrade before you do a poll, you save preferences even if you don't make any changes.

7th November 2022

  • v6.8.2 - Removed PWS Optional functions - it was causing some odd issues. Added Driver Version Reporting.

28th October 2022

  • v6.7.0 - Added Rain History Tile and Today/Tonight forecast header when forecast changes by @swade

19th October 2022

  • v6.6.0 -major overhaul to the forecast code, as it had become hard for even me to comprehend (and I wrote much of it). Aside from being easier to maintain, all relevant forecast data now auto switches between day and night, so you shouldn't see any more "null" data. The major new feature is a Weather Warnings Tile covering the next 3 days:

14th October 2022

  • v6.3.0 - has been released and includes the excellent 3 Day Forecast tile (html3dayfcst) developed by @swade (also includes logging tweaks by @Busthead ).

1st October 2022

  • v6.2.2 - Actually Fixed the Day/Night ForecastDayAfterTomorrow Icon switch over bug

30th September 2022

  • v6.2.1 - Fixed Day/Night ForecastDayAfterTomorrow Icon switch-over bug

26th September 2022

  • v6.2.0 - Improved formatting, fixed debug.logging and added Station Location to the Tiles
  • v6.1.1 - Broke 3 Day FC into individual tiles due to 1024 char limit
  • v6.0.2 - Tile bug fixes
  • v6.0.1 - Added a 3 Day Forecast Dashboard Tile
    (thanks to @thebearmay for his extensive HTML assistance and @sburke781 for his help with CSS)

20th September 2022 - 5.7.0 - Added a 3rd day of forecast data "forecastDayAfterTomorrow" including Icon

15 August 2020 - 5.6.2 - Added 6 new fields covering Snow, Thunder & UV:

qpfSnow:
The forecasted measurable precipitation as snow during the 12 hour forecast period.
snowRange Snow accumulation amount for the 12 hour forecast period.

thunderCategory:
The description of probability thunderstorm activity in an area for 12 hour daypart.
0 = "No thunder"; 1 = "Thunder possible"; 2 = "Thunder expected"; 3 = "Severe thunderstorms possible"; 4 = "Severe thunderstorms likely"; 5 = "High risk of severe thunderstorms"

thunderIndex:
The enumeration of thunderstorm probability within an area for a 12 hour daypart.

uvDescription:
The UV Index Description which complements the UV Index value by providing an associated level of risk of skin damage due to exposure.
-2 = Not Available, -1 = No Report, 0 to 2 = Low, 3 to 5 = Moderate, 6 to 7 = High, 8 to 10 = Very High, 11 to 16 = Extreme

uvIndex:
Maximum UV index for the 12 hour forecast period.

.

19 June 2022
Now Available via Hubitat Package Manager:

17 Nov 2020 - v5.5.0 - WU Icons now hosted on GitHub Repo (but still optional) - no URL's are required to be copy and pasted and Icon's now work when connected via the cloud

20 Nov 2020 - v5.6.0 - add selectable language eg en-GB or en-US
(I can add more options if requested)

17 July 2022 - v5.6.1 - Minor Bug Fix

You can update your driver by importing the below URL:

https://raw.githubusercontent.com/dJOS1475/Hubitat_WU_Driver/main/WU_Driver.groovy

3 Likes

My PWS uploads to WU. Can I use data from this with your app?

1 Like

You certainly can, it uses your WU API key and station ID.

Have you compared accuracy to our local BOM weather ?
I started using @cometfish’s BOM Driver because it seemed to be more accurate than the international sites.

1 Like

I haven’t on Hubitat. I only use WU for the forecast data.

Live data is from my PWS as we live in a micro-climate in the Yarra Ranges so even the closest BoM station is wrong most of the time.

1 Like

I've just tried to install this and got an error.

expecting ')', found 'if' @ line 345, column 4

Something easy to fix I hope!

Ah oops, I’ll upload a fix tomorrow.

I know exactly what the issue is. :man_facepalming:

1 Like

I'm a new HE user, and this was the first driver I installed. I got the same error noted above and just "trial and errored" a fix yesterday. Replaced and moved some ) and } as I recall. Working GREAT, so thanks for creating this. Allows me to use my own data from a Davis VP2 that I upload to WU.

I haven't yet figured out how to get all data onto my dashboard yet, but should be fun to try. Also, if you ever decide to code a driver that reads local CumulusMX data with no cloud involvement, I'd be happy to help test it. I saw that someone created a Weewx driver, but I've found that Weewx itself locks up often on the RPi on which I run CumulusMX, so I decided to stay with CumulusMX, which runs for months and months with no intervention, in my case. Anyway, thanks again for offering this driver. Greatly appreciated.

1 Like

@andy-e @Madcodger
Should be fixed now - I must have hit the space bar by accident before I hit save which broke some formatting on that line. :man_facepalming:

1 Like

Ok, got it loaded now. Thanks for that.
Now playing around with it, but not getting icons. Clicked on Use Externally Hosted Icons which didn't do any good, so switched it back off. Now I can't Save Preferences 'cos it wants the Icon Base URL filled in no matter what the setting is...

Hopefully another easy fix!

You need to download them and copy them into the hub with file manager ATM.

It’s a bit of a kludge but the next version will hopefully do things properly.

I’m still learning the groovy language and haven’t written code in several decades. Hopefully it won’t take me too long to figure out.

Ok, got it now! But what about not being able to leave the Icon Base URL field blank after turning the Externally Hosted Icons switch on then back off? Is this fixable?

You can store the icons locally on the hub (it's very tedious to upload 50 icons one at a time tho) and then point the WU driver at "http://<Hub_IP>/local/". I'll look into a method of storing them locally automatically in the next versions.

Yeah, I got all that! I’m just saying that once I switched the External Icons switch on and then back off, I can no longer save my preferences from the Device edit screen. Locks up asking for the External Icon location box to be filled. Won’t let me out. I have to abandon the screen. Seriously, really, I understand fully what you say about the Icons locations - this is purely about the Virtual Device details screen not letting me save any preferences once the External Icons switch has been used...

I’m not using this driver but Have you tried using - [quote="dJOS, post:15, topic:54141"]
then point the WU driver at "http://<Hub_IP>/local/".
[/quote]

That is bizarre, I can’t replicate this.

Which browser are you using?

Thanks for the idea. I just put that in the address field and it cleared the error.

2 Likes

The Wunderground Icon's have been uploaded to my GitHub Repo and you can now point your WU driver at the following location:

https://github.com/dJOS1475/Hubitat_WU_Driver/raw/main/wuIcons/

I'll update the 1st post.

1 Like

v5.5.0 released: