[PROJECT] Weather Service Monitor 4 Hubitat Driver

@theDaithiMac: I apologize that I somehow missed your posting here for so long. That is really unacceptable on my part. Please see below.

All UK Met Office Users
All, please do not use the migrated UK Met Office API yet if possible. While I am working on it and it is possible to add your API Key into the code there are some issues I am reaching out to Hubitat about (first and foremost that device Preference fields appear to have a 255 character limit and the API Key I got is >1600).

That said... if you cannot wait and really need this... Here is a link to a... let's call it "Alpha" version that will replace the driver on your system. I am NOT going to replace the main published version at this time with it until this can be worked out better than having you hard code your API Key into the driver (as is currently necessary). The instructions you need to follow are:

  1. Open the driver code on your Hubitat (Drivers Code - WSM4Hubitat).
  2. Go to line 404 within the driver code window.
  3. Replace the ENTER_UK_API_KEY_HERE with the API Key you have for your Met Office account.
  4. Save the drivers code.
  5. Go to the device.
  6. Make sure the "Service to Query" Preference is set to "United Kingdom Met Office" (if you change it, you should Save Preferences).

This should now allow it to query the new API. The received data structure has not appeared to have changed, it worked just fine on my system (faking my location as being in Uxbridge).

I apologize for the hassle here. I am trying to figure out a method to make the driver work properly and be convenient again before I replace the main version.

Updated Version(s):

  • WSM4Hubitat.groovy = 0.9.7
  • WeatherSensorChild.groovy = 0.8.14

Change(s):

  • The UK Met Office workaround is now required. "Hard code" your API Key on line 412 (due to changes so far). I am still trying to work with Hubitat on alternatives.
  • Driver-specific attributes that had spaces in their names (Driver Name, Driver Version, and Driver Status) have been replaced with versions that do not have spaces. They will be removed the next time you Save Preferences.
  • Correction was made to the ProcessEvent function.

Just found this project while looking around for alternatives to OpenWeatherMap (their API is changing).

Everything installed great, but it appears that I'm getting an incorrect value for temperature. It looks to me like 'temperature' matches Today_Temperature. I'm using NWS and the NWS website shows my current temp quite a bit cooler than the WSM device. I've observed this before as well, but hadn't had a chance to play around with it.

I queried https://api.weather.gov/stations/KDET/observations/latest in my browser and it shows 22.2C (72F), which is correct. temperature in the device shows 77F as does the info returned in the trace log.

Thoughts?

This project is meant to provide just a daily snapshot and possibly some forecasting (if the service queried provides it). It does not provide the "current" weather (for example, temperature) and was never designed for that because there were other options (such as OpenWeatherMap) when I originally wrote it.