Which weather binding to use

From https://www.wunderground.com/weather/api/ => follow Important Notice

"For developers who use WU API data for non-commercial purposes, you will have access to a new plan for a personal use, low call volume API. Stay tuned for more details as we build this out.
"

There is still some hope :smiley:

all I see is this

To improve our services and enhance our relationship with our users, we will no longer provide free weather API keys as part of our program. If you have been directed to download our Weather Underground free API key by a third party provider, please contact your vendor for resolution.

So, is the right way to go is to use Weather binding and connect it to my preferred / available service?

yes, choose the “my preferred / available service” . How accurate it works, I think depends on the region. for my location weather underground delivers the best values which represents the real status. But since last week I get a lot of connection errors. I will move to a different one now.

But not so easy, I use it for shadowing. All the others I tested say it is fully cloudy or fully sunny but it is the opposite :wink:

Shadow when no sun or no shadow if sun :wink: My wife will kill me :wink:

Seems like weather binding doesn’t support OWM any more so I am not sure how good it is to use it now (as we also have yahhoo and WU in separate bindings).

There is a “native” OWM Binding available now: https://www.openhab.org/addons/bindings/openweathermap/

It works very well! (but you need OH 2.4.0 M5+)

Thread here: Announcing OpenWeatherMap binding for Eclipse SmartHome / openHAB

I decommissioned my old weather1 binding (using Wunderground) recently also (I was getting more frequent errors) and I am using OWM now.

Though it’s worth mentioning that both Yahoo and WU are end of life and will stop working in the near future. Both services have announced they are stopping free access to their APIs.

@rlkoshak

So beside OWM, what is left?

I don’t know. I’m probably going to parse data from NOAA.gov. My tax dollars are paying for it and it is actually human reviewed instead of just algorithms. Unfortunately the data is not in a very friendly format so it will take a bit.

EDIT: typo, it is a .gov address, not a .org address.

NOAA.org

I don’t pull anything up for that, is that the correct name?

Sorry, brain fart. It’s NOAA.gov. National Oceanographic and Atmospheric Administration. They run the satellites and provide the weather data that pretty much every other commercial service in the US uses their basis. When you see radar maps and satellite imagery or clouds, its NOAA provided data.

I also came across this page -https://forecast-v3.weather.gov/documentation which also looks to use the NOAA data with an API and text only options. If anyone more savvy than I wants to see if leveraging this is a possibility?

There are two APIs, an old one and a newer one. I can’t remember which on that address links to.

For the curious, here is the code I have so far using the newer API. The problem is that the predicted precipitation comes in an indeterminate number of elements that need to be iterated through and the values extracted and summed to get the estimate for the full day. The data is XML (it’s government so of course it is) so the code to do that is going to be ugly as a Rule.

But if it helps, here is what I have so far (NOTE, this is the forecast endpoint, they have a different current conditions endpoint):

rule "NOAA Weather"
when
  System started
then
  logInfo(logName, "Started NOAA query")
  val BASE_URL = "https://graphical.weather.gov/xml/sample_products/browser_interface/ndfdXMLclient.php?lat={0}&lon={1}&product=time-series&begin={2}&end={3}"
  val LOC_URL = BASE_URL.replace("{0}", "XX.XXXXXX").replace("{1}", "XXX.XXXXXX")

  val todayStart = now.withTimeAtStartOfDay.withZone(DateTimeZone.UTC).toString("yyyy-MM-dd'T'HH:mm")
  val todayEnd = now.withTimeAtStartOfDay.plusDays(1).withZone(DateTimeZone.UTC).toString("yyyy-MM-dd'T'HH:mm")
  val TODAY_URL = LOC_URL.replace("{2}", todayStart).replace("{3}", todayEnd)

  // val tomorrowStart = todayEnd
  // val tomorrowEnd = now.withTimeAtStartOfDay.plusDays(2).toString("yyyy-MM-dd'T'HH:mm")
  // val TOMORROW_URL = LOC_URL.replace("{2}", tomorrowStart).replace("{3}", tomorrowEnd)

  logInfo(logName, "Checking today with " + TODAY_URL)
  val todayForecast = sendHttpGetRequest(TODAY_URL, 20000)

  // logInfo(logName, "Checking tomorrow with " + TOMORROW_URL)
  // val tomorrowForecast = sendHttpGetRequest(TOMORROW_URL, 20000)

  val todayPrecipitation = transform("XSLT", "noaaPrecip.xsl", todayForecast)
  logInfo(logName, "Today Precip = " + todayPrecipitation)

  val todayTempMax = transform("XSLT", "noaaTempMax.xsl", todayForecast)
  logInfo(logName, "Today Temp Max = " + todayTempMax)

  val todayTempMin = transform("XSLT", "noaaTempMin.xsl", todayForecast)
  logInfo(logName, "Today Temo Min = " + todayTempMin)

  // val tomorrowPrecipitation = transform("XSLT", "noaaPrecip.xsl", tomorrowForecast)
  // logInfo(logName, "Tomorrow Precip = " + tomorrowPrecipitation)

  // val tomorrowTempMax = transform("XSLT", "noaaTempMax.xsl", tomorrowForecast)
  // logInfo(logName, "Tomorrow Temp Max = " + tomorrowTempMax)

  // val tomorrowTempMin = transform("XSLT", "noaaTempMin.xsl", tomorrowForecast)
  // logInfo(logName, "Tomorrow Temo Min = " + tomorrowTempMin)
end

Replace the XX.XXXXXX with your lat and long.

noaaPrecip.xsl

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:foo="http://www.foo.org/" xmlns:bar="http://www.bar.org">
    <xsl:output method="text"/>
   <xsl:template match="/">
      <xsl:value-of select="sum(/dwml/data/parameters/precipitation/value)"/>
    </xsl:template>
</xsl:stylesheet>

noaaTempMax.xsl

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:foo="http://www.foo.org/" xmlns:bar="http://www.bar.org">
    <xsl:output method="text"/>
   <xsl:template match="/">
       <xsl:for-each select="/dwml/data/parameters/temperature[@type='maximum']/value">
           <xsl:sort data-type="number" order="descending"/>
           <xsl:if test="position()=1"><xsl:value-of select="."/></xsl:if>
       </xsl:for-each>
    </xsl:template>
</xsl:stylesheet>

noaaTempMin.xsl

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:foo="http://www.foo.org/" xmlns:bar="http://www.bar.org">
    <xsl:output method="text"/>
   <xsl:template match="/">
       <xsl:for-each select="/dwml/data/parameters/temperature[@type='minimum']/value">
           <xsl:sort data-type="number" order="ascending"/>
           <xsl:if test="position()=1"><xsl:value-of select="."/></xsl:if>
       </xsl:for-each>
    </xsl:template>
</xsl:stylesheet>
2 Likes

There is another new weather binding available: meteoblue Binding.

I don’t see this binding in paperUI?
Other bindings from market are visible.

(actual oh-snapshot)

It was merged into ESH 7 days ago
It may take some time until it reaches PaperUI (via OH2.4.0 Snapshots)
I don’t know if it was ever published on the marketplace…
edit: it seems not

OH 2.4.0.S1451 now has it:
image

@Dim

How do I update the add-ons without updating the snapshot? I have Build #1447

Thx

You can download the individual *.jar file for the binding and place it in your addons folder.
Remember 2 things:
a) Some bindings require changes to the core so they may not work if you don’t update the core also.
b) You will need to uninstall the version that corresponds to your core build from PaperUI

I cannot find now the org.eclipse.smarthome.binding.meteoblue-0.10.0-SNAPSHOT.jar but you can do the following:
Download the Snapshot Build #1451 of the offline addons package (openhab-addons-2.4.0-SNAPSHOT.kar) from here: https://ci.openhab.org/job/openHAB-Distribution/lastBuild/

extract it using 7zip and take the jar from here: openhab-addons-2.4.0-SNAPSHOT.kar\repository\org\eclipse\smarthome\binding\org.eclipse.smarthome.binding.meteoblue\0.10.0-SNAPSHOT\

Readme here: https://github.com/eclipse/smarthome/blob/master/extensions/binding/org.eclipse.smarthome.binding.meteoblue/README.md

1 Like