[RELEASE] FREE Meteobridge/Weatherbridge Weather Station v 1.1.* FREE ... Now Also Hubitat-compatible

Meteobridge Weather Station v1.1.28 released on June 26, 2019

Overview

Meteobridge (www.meteobridge.com) is an inexpensive Linux-based server that is used by many to collect data from your local weather station and distribute it to one or more public weather sources (including Weather Underground, for example). It supports data collection from a large number of popular weather stations, and it offers a local API that allows clients/applications to retrieve the latest weather station data on demand.

This weather station DTH uses local hubAction() calls to provide pretty much all information exposed by The Meteobridge Template HTML API, which it retrieves as a JSON formatted map. While the DTH is optimized for Davis Vantage Pro2 Plus stations, it will report whatever subset Meteobridge provides for any connected weather station.

This device also (optionally) calculates and displays Purple Air Air Quality Index from a specified PurpleAir sensor. If you don’t have one of your own, you will need to do a little research on the PurpleAir.com website to find a sensor nearby and then find its device ID from their JSON repository (search the repository for the name displayed for the sensor on the sensor map, then enter the numerical ID of that sensor into Preferences).

As most weather stations do no provide forecast details (hi/lo temps, humidity, probability of precipitation, etc.), this DTH allows selection from 1 of 3 sources for forecast data:

  • Dark Sky: probably the best forecast source for PWS owners, as they provide hyper-local forecast data that probably includes data from your weather station (if you send to CWOP). Note that to use Dark Sky, you will need an API key, available on their web site - this DTH will use about 96 Dark Sky API calls per day;
  • The Weather Company: now owned by IBM, and now the official SmartThings weather service, with location-based forecast data that probably does not include any input from your weather station;
  • MeteoBridge/Davis: Davis Vantage Pro weather stations do provide a calculated forecast string; the code will drop back to use TWC for the rest of the forecast data if you choose this option
  • Weather Underground support has been removed, because SmartThings has replaced the getWeatherFeature() linkage to WU in favor of the above-mentioned TWC support.

Significantly, EVERYTHING that this DTH displays in Tiles is also available programmatically to other SmartApps and WebCoRE pistons. You can thus build apps and integrations based off of changes in any attribute, from temperature and humidity to air quality, lunar phase, wind speed and the like. If interested, have a look at the attributes listed at the top of the source file for the names of the available data points.

Hubitat Compatibility

Thanks to the assistance of @staze and the Hubitat Community plus some code borrowed from Echo Speaks (thanks @tonesto7) this DTH can be used on Hubitat without modification! It will auto-detect the hub platform, and adjust its calls, classes and parameters appropriately for each platform. There are lots of incompatibilities between the two platforms, but clever utilization of Groovy allows a single code base to support both. Of course, on Hubitat there is no UI, but all of the attributes are programmatically available to apps and Rules Engine on that platform.

New in version 1.1.28

MeteoWeather now fully supports the native Hubitat Dashboard Weather Tile. Assigning this device to the Weather Tile will result in this:

MeteoWeather also generates an HTML weather snapshot, designed for use with the HE Dashboard. To access it, create a 2x2 tile in the Dashboard, first select your MeteoWeather device. Then select the “Attribute” template, and assign it to the “myTile” attribute. The resulting display looks like this:

Note that the above display just barely fits within the 1024 character size limitation of the “myTile” attribute.

Important Note for All Users

Since this DTH uses hubAction() for the MeteoBridge data, it will work only when your SmartThings/Hubitat hub and your MeteoBridge/WeatherBridge server are on the same (local) IP network. This approach keeps your password safe(r), but doesn’t handle remote IP addresses. On the plus side, it is pretty lightweight to get updates from your meteobridge every minute, unlike using the WeatherUnderground data source.

The GiThub repository for MeteoWeather is here:

Installation

You can either manually copy/save the DTH code, or you can use the following for SmartThings’ Github integration:

Owner: SANdood
Name: MeteoWeather
Branch: master

After loading and publishing the DTH, you will need to manually create the device from the Devices page in your IDE. Once created, use your Mobile App to configure the preferences for your new Meteobridge-based Weather Station!

Donations

This work is fully Open Source, and available for use at no charge.

While not required, I do humbly accept donations. If you would like to make an optional donation, I will be most grateful. You can make donations to me on PayPal at https://paypal.me/BarryABurke

Change Log:

* 1.1.10 Initial Release (March 20, 2019)
2019-03-24 1.1.15 New SmartThings/Hubitat Portability Library, Bug fixes
2019-03-24 1.1.16 Fixed TWC error (state.isHE)
2019-03-26 1.1.17 Major bug fixes, new icons, new myTile attribute for Hubitat Dashboard
2019-03-27 1.1.20 Improved handling of non-existent sensors and missing data
2019-04-02 1.1.23 Major overhaul of template structure for better error handling & efficiency
2019-04-22 1.1.25 Option to use data averaged over the update cycle instead of actual reading

Screen Shot:

5 Likes

Thanks for your work!

1 Like

For those interested, here are the available attributes provided by this DTH

attribute "illuminance", "number"           // lux - (configurable ranges)
attribute "temperature", "number"           // C or F (configurable)
attribute "humidity", "number"
attribute "water", "string"                 // 'wet' or 'dry'
attribute "ultravioletIndex", "number"      // uvi - 0.0 - 11.0+
attribute "heatIndex", "number"
attribute "uvIndex", "number"               // uvi - 0.0 - 11.0+
attribute "dewpoint", "number"
attribute "pressure", "number"              // inHg or mmHg (configurable)
attribute "pressureTrend", "string"         // 'Steady', 'Rising', 'Falling', etc.
attribute "solarRadiation", "number"        // W/m²
attribute "evapotranspiration", "number" 
attribute "highTempYesterday", "number"
attribute "lowTempYesterday", "number"
attribute "highTemp", "number"
attribute "lowTemp", "number"
attribute "highTempForecast", "number"
attribute "lowTempForecast", "number"
attribute "highTempTomorrow", "number"
attribute "lowTempTomorrow", "number"
attribute "highHumYesterday", "number"
attribute "lowHumYesterday", "number"
attribute "highHumidity", "number"
attribute "lowHumidity", "number"
attribute "avgHumForecast", "number"
attribute "avgHumTomorrow", "number"
attribute "precipYesterday", "number"              
attribute "precipToday", "number"           // in or mm (configurable) 
attribute "precipForecast", "number"
attribute "precipLastHour", "number"
attribute "precipRate", "number"
attribute "precipTomorrow", "number"
attribute "pop", "number"                   // Probability of Precipitation (in %)
attribute "popForecast", "number"
attribute "popTomorrow", "number"
attribute "weather", "string"               // Current weather
attribute "weatherIcon", "string"
attribute "forecast", "string"              // Forecasted weather
attribute "forecastCode", "string"
attribute "airQualityIndex", "number"       // US AQI
attribute "aqi", "number"
attribute "wind", "number"                  // mph or kph
attribute "windDirection", "string"         // N, S, E, W, NE, NNE, etc.
attribute "windGust", "number"
attribute "windChill", "number"
attribute "windDirectionDegrees", "number" 
attribute "sunrise", "string"               // 24 hour local time
attribute "sunriseAPM", "string"            // AM/PM local time
attribute "sunriseEpoch", "number"
attribute "sunset", "string"                // 24 hour loccal time
attribute "sunsetAPM", "string"
attribute "sunsetEpoch", "number"
attribute "dayHours", "string"              // HH:MM
attribute "dayMinutes", "number"
attribute "isDay", "number"                 // 1=true, 0=false
attribute "isNight", "number"
attribute "moonrise", "string"              // Can be null
attribute "moonriseAPM", "string"
attribute "moonriseEpoch", "number"
attribute "moonset", "string"               // can be null
attribute "moonsetAPM", "string"
attribute "moonsetEpoch", "number"
attribute "lunarSegment", "number"
attribute "lunarAge", "number"              // days
attribute "lunarPercent", "number"          // % lit
attribute "moonPhase", "string"

Notes:

  • Unavailable data is returned as null.
  • Sunrise/sunset and moonrise/moonset can be null depending upon location and date.
2 Likes

MeteoWeather Station Update, v1.1.16 released on 24 March 2019 @ 11:40pm EDT

  • Implements a new SmartThings / Hubitat Portability Library (SHPL)
  • New/additional current weather status reports/icons
  • Additional attributes (indoor temp/humidity/dewpoint, plus ‘Air Quality’)
  • Fixed cloudCover calculation
  • Fixed TWC error (state.isHE)
1 Like

MeteWeather Station Update, v1.1.17 released on 26 March 2019 @ 7:45am EDT

Fixes include:

  • Multiple bug fixes that had accumulated over time (typos, missing variables, etc.)
  • New weather icons (from VCloud)
  • New myTile attribute for Hubitat Dashboard
1 Like

Hello @storageanarchy I did an update last night and now my weather is not refreshing…

Here is what I see:

1:00:32 PM: error groovy.json.JsonException: Unable to determine the current character, it is not a string, number, array, or object

The current character read is ‘,’ with an int value of 44
Unable to determine the current character, it is not a string, number, array, or object
line number 1
index number 412
{“timestamp”:1553623226834,“version”:3.9,“station”:"",“latitude”:30.053743,“longitude”:-95.494539,"time…[TRUNCATED]

I have the latest version v1.1.17

Can you please edit line 2366 and tell me if this solves the problem?

At the very end of the line, you will see:

[wind${d}wind-act=bft.0:]

Please change that to:

[wind${d}wind-act=bft:]

Then save/publish and test… TIA

I am on it, Will report back.

Thanks!

Edit: @storageanarchy

Here is what I get:

[c96fb688-b035-4a28-96ea-61f57cc43d7d](https://graph-na04-useast2.api.smartthings.com/ide/logs#c96fb688-b035-4a28-96ea-61f57cc43d7d) 2:04:20 PM: error groovy.json.JsonException: Unable to determine the current character, it is not a string, number, array, or object

The current character read is ',' with an int value of 44
Unable to determine the current character, it is not a string, number, array, or object
line number 1
index number 412
{"timestamp":1553627053463,"version":3.9,"station":"","latitude":30.053743,"longitude":-95.494539,"time...[TRUNCATED]

[c96fb688-b035-4a28-96ea-61f57cc43d7d](https://graph-na04-useast2.api.smartthings.com/ide/logs#c96fb688-b035-4a28-96ea-61f57cc43d7d) 2:04:13 PM: info getMeteoWeather() completed

[c96fb688-b035-4a28-96ea-61f57cc43d7d](https://graph-na04-useast2.api.smartthings.com/ide/logs#c96fb688-b035-4a28-96ea-61f57cc43d7d) 2:04:13 PM: trace getMeteoWeather( yesterday = false )

[c96fb688-b035-4a28-96ea-61f57cc43d7d](https://graph-na04-useast2.api.smartthings.com/ide/logs#c96fb688-b035-4a28-96ea-61f57cc43d7d) 2:04:07 PM: trace purpleAirResponse() finished

[c96fb688-b035-4a28-96ea-61f57cc43d7d](https://graph-na04-useast2.api.smartthings.com/ide/logs#c96fb688-b035-4a28-96ea-61f57cc43d7d) 2:04:07 PM: trace purpleAirResponse() status: 200

[c96fb688-b035-4a28-96ea-61f57cc43d7d](https://graph-na04-useast2.api.smartthings.com/ide/logs#c96fb688-b035-4a28-96ea-61f57cc43d7d) 2:04:05 PM: trace getPurpleAirAQI() finished

[c96fb688-b035-4a28-96ea-61f57cc43d7d](https://graph-na04-useast2.api.smartthings.com/ide/logs#c96fb688-b035-4a28-96ea-61f57cc43d7d) 2:04:05 PM: trace getPurpleAirAQI() entered

[c96fb688-b035-4a28-96ea-61f57cc43d7d](https://graph-na04-useast2.api.smartthings.com/ide/logs#c96fb688-b035-4a28-96ea-61f57cc43d7d) 2:03:42 PM: error java.util.concurrent.TimeoutException: Execution time exceeded 20 app execution seconds: 598382737963700 @line -1 (doCall)

OK, so please revert it back, and at the top of the source file, change debug to be true. Save/publish/run.

In the IDE, select My Devices, then click on this device in the Devices List. Scroll down, and in the States you should see an attribute named meteoWeather and one named meteoTemplate - if you could PM me the complete strings associated with both, I can look and see where I screwed up…

Thanks

1 Like

I am on it.

I do not have this attributes :frowning_face:

At the top of the source file, change:

private Boolean getDebug() { false }

to

private Boolean getDebug() { true }

Then the attributes should appear (after the next time they are used).

1 Like

That’s what I did. Let me check again and see if it appears.

Ok I see them now. Incoming PM.

MeteoWeather Station Update, v1.1.20 released on 27 March 2019 @ 6:45pm EDT

Fixes include:

  • Much better handling of non-existent sensors and missing data

NOTE: If the DTH stops updating, please open/save preferences on your mobile device for SmartThings (re-save the preferences on the Hubitat device page).

This update is recommended for ALL users of this DTH.

1 Like

MeteoWeather Station Update, v1.1.23 released on 2 April 2019 at 5:30pm EDT

This release embodies a major overhaul of the MeteoWeather template infrastructure used to gather data from your MeteoBridge/WeatherBridge (et al). Now handles weather stations that do not have the complete complement of sensors. Reduces significantly the amount of data transferred for improved efficiency and reliability (I had reached the maximum string size for the current MeteoBridge devices).

Fixes:

  • Now properly handles missing/uninstalled sensors
  • Shorter communication strings means faster updates

This updated is recommended for ALL MeteoWeather users!!

2 Likes

Amazing job Barry!

Thanks!

What about calculating sunrise and sunset based off of lat/long daily? Which I wish SmartThings would do natively, so sunrise sunset events could run local.

I imagine the dh creates Sensor data which can be used by ST, IFTTT, and Core.

So I could have my garage door close if it starts raining… or switch thermostat heating / cooling mode based on outside temperature…

I am pretty sure that SmartThings no longer bases sunrise/sunset off of your Zip code, if only because the new TWC weather data doesn’t support anything other than US Zip codes.

Both SmartThings and Hubitat now apparently require that the lat/lon be set for your location, and this determines your location.sunrise/sunset events.

That said, this Meteobridge DTH does provide astronomical sunrise/sunset times which you could use with timeTodayAfter() and runOnce() to schedule events based off of the Meteobridge’s sunrise/sunset data, using these attributes:

attribute "sunrise", "string"               // Astronomical sunrise, 24 hour local time
attribute "sunriseAPM", "string"            // Astronomical sunrise, AM/PM local time
attribute "sunriseEpoch", "number"
attribute "sunset", "string"                // Astronomical sunset, 24 hour loccal time
attribute "sunsetAPM", "string"
attribute "sunsetEpoch", "number"

You can also use this DTH’s isDay attribute ( a number) - it will change to 1 at civil sunrise, and to 0 at civil sunset. The “civil” day (daylight) is shorter than the “astronomical” day - this DTH uses the civil transition time to determine when to change between day and night condition icons.

1 Like

All I know is smart lighting still runs in the cloud ;:frowning:
Which makes me think the calculation is internet lookup.