Which weather binding to use

@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

Hi all,
the thread started out with the queston ‘which weather binding to use’. A new one recently arrived (meteoblue).
So: why should we usethis in stead of ‘weather binding’?

It says meteoblue non-commercial contract has access for 1 year. I don’t think I’d bother using it to have to change it in a years time.

Hi!

i am using forecast io.
the readme to the weather binding says it provides 8 day forecast but for me only tomorrow is working …
is there any free api that has forecast (1 week) and maybe even rain?

Dit anyone look at The Weather Company API?
https://cloud.ibm.com/catalog/services/weather-company-data

“The Weather Company Data Free plan allows you to make a maximum of 10 calls to The Weather Company per minute, up to a maximum of 10,000 API calls, for each IBM Cloud Account. You can test the data in your applications without restrictions to geography, forecast type, or time series observations, with only a restriction on number of calls. When the maximum call limit is reached, the Free Plan will not allow any Weather Company data to be retrieved until the Cloud Service is upgraded to the Base, Standard, or Premium plan. You can have only one instance of the Weather Company Data service in the Free plan.”
Blockquote

@Wim_G Perhaps I’m reading it incorrectly but on the Weather Company Data Free plan, it seems that is 10,000 requests ever on the free tier and not per month.

I suppose 1 call per day (10,000/365 days a year) would be 27 years of weather data, but one call an hour to refresh data would be only about year (10,000/24 calls per day/365 days per year) before needing to start paying or finding another source.

If the free tier is per month, then that might be a good option.

I’m looking into seeing what I can do with NOAA api also. Thanks for sharing this. Did you make additional progress?

No, I abandoned the effort. The DarkSky and OpenWeatherMap bindings provide everything I need so I’ve moved on to other things. Parsing the XML and calculating the precipitation forecast for the day, where I got stuck, would be a lot easier to achieve in Scripted Automation though. I’ve thought about revisiting this but haven’t thus far.

2 Likes