How to add DarkSky (fka ForecastIo) in weather binding for openHAB-2.2.0

Hi all,

I am confused. I am trying to add DarkSky API-key into the weather binding in opeHAB 2.2.0. I found that in the past there has been an update to the weather binding to reflect the transition from Forecast.io to Darksky.net. But there is no useful post in this forum that reflects my problems and show how to setup the weather binding for Darksky.

  1. I am running openHAB 2.2.0 in a docker container on my NAS. Nevertheless I installed the weather binding from the Paper UI … but some minutes later openHAB removes it:
...
2017-11-04 16:39:58.697 [INFO ] [core.karaf.internal.FeatureInstaller] - Uninstalled 'openhab-binding-weather1'
...
  1. Then I have put the binding configuration in openhab.cfg and in weather.cfg but openHAB ignores my config. There is no entry regarding any weather binding activity in openhab.log after changing openhab.cfg respectively creating weather.cfg.

Here is my openhab.cfg stanza for the weather binding:

################################### Weather Binding ###################################
#
# The apikey for the different weather providers, at least one must be specified
# Note: Hamweather requires two apikeys: client_id=apikey, client_secret=apikey2
weather:apikey.ForecastIo=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
weather:apikey.Darksky=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#weather:apikey.OpenWeatherMap=
#weather:apikey.WorldWeatherOnline=
#weather:apikey.Wunderground=
#weather:apikey.Hamweather=
#weather:apikey2.Hamweather=

# location configuration, you can specify multiple locations
weather:location.witchhill-fio.latitude=aa.bbbb
weather:location.witchhill-fio.longitude=c.dddd
weather:location.witchhill-fio.provider=ForecastIo
weather:location.witchhill-fio.language=de
weather:location.witchhill-fio.updateInterval=10

# location configuration, you can specify multiple locations
weather:location.witchhill-dky.latitude=aa.bbbb
weather:location.witchhill-dky.longitude=c.dddd
weather:location.witchhill-dky.provider=Darksky
weather:location.witchhill-dky.language=de
weather:location.witchhill-dky.updateInterval=10

The weather.cfg looks almost the same:

weather:apikey.ForecastIo=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
weather:apikey.Darksky=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

weather:location.witchhill-fio.latitude=aa.bbbb
weather:location.witchhill-fio.longitude=c.dddd
weather:location.witchhill-fio.provider=ForecastIo
weather:location.witchhill-fio.language=de
weather:location.witchhill-fio.updateInterval=10

weather:location.witchhill-dky.latitude=aa.bbbb
weather:location.witchhill-dky.longitude=c.dddd
weather:location.witchhill-dky.provider=Darksky
weather:location.witchhill-dky.language=de
weather:location.witchhill-dky.updateInterval=10

For testing I have created an items file:

Number   FIOtemp   "Temperature [%.2f °C]"   {weather="locationId=witchhill-fio, type=temperature, property=current"}
Number   FIOhumi   "Humidity [%d %%]"        {weather="locationId=witchhill-fio, type=atmosphere, property=humidity"}
Number   FIOpres   "Pressure [%d %%]"        {weather="locationId=witchhill-fio, type=atmosphere, property=pressure"}

Number   DKYtemp   "Temperature [%.2f °C]"   {weather="locationId=witchhill-dky, type=temperature, property=current"}
Number   DKYhumi   "Humidity [%d %%]"        {weather="locationId=witchhill-dky, type=atmosphere, property=humidity"}
Number   DKYpres   "Pressure [%d %%]"        {weather="locationId=witchhill-dky, type=atmosphere, property=pressure"}

The only thing I get in openhab.log is that the items above are not recongized …

Any idea how to get this working?

Thank you to anyone :slight_smile:

I am also unable to retrieve data from DarkSky. I have a valid API key, which I confirmed by pulling a valid JSON request in a direct URL.

OpenHAB 2.3.0-SNAPSHOT Build #1269 on OpenHABIAN
binding-weather1 - 1.12.0.SNAPSHOT

weather.cfg

apikey.darksky=xxxxx
location.HomeWeather.name=HomeWeather
location.HomeWeather.provider=darksky
location.HomeWeather.latitude=38.898
location.HomeWeather.longitude=-77.123
location.HomeWeather.updateInterval=1
location.HomeWeather.units=us
location.HomeWeather.language=en

/var/lib/openhab2/config/org/openhab/weather.cfg

    apikey.darksky="xxxxx"
    location.HomeWeather.language="en"
    location.HomeWeather.latitude="38.898"
    location.HomeWeather.longitude="-77.123"
    location.HomeWeather.name="HomeWeather"
    location.HomeWeather.provider="darksky"
    location.HomeWeather.units="us"
    location.HomeWeather.updateInterval="1"
    location.home.name="HomeWeather"
    service.pid="org.openhab.weather"

x.items file

Number   DarkSkyTemp    "DarkSkyTemp [%.2f °F]"       {weather="locationId=HomeWeather, type=temperature, property=current, unit=fahrenheit"}

DarkSkyTemp shows up PaperUI:Items, but never gets a value. And I don’t see a Weather binding in PaperUI:Configuration:Bindings, however PaperUI does show that the Weather binding is installed.

The log claims that "Provider with name ‘darksky’ not found.

2018-05-19 00:26:40.113 [WARN ] [eather.internal.common.WeatherConfig] - Provider with name 'darksky' not found. Check openhab.cfg.

2018-05-19 00:26:40.120 [ERROR] [org.apache.felix.configadmin        ] - [org.osgi.service.cm.ManagedService, org.osgi.service.event.EventHandler, id=358, bundle=221/mvn:org.openhab.binding/org.openhab.binding.weather/1.12.0-SNAPSHOT]: Updating property weather of configuration org.openhab.weather caused a problem: Provider with name 'darksky' not found. Check openhab.cfg.

I’m running OH2 so no openhab.cfg exists. Can someone provide a validated weather.cfg entry for DarkSky, please? Or am I otherwise doing this wrong?

Much thanks, Josh

The provider for Darksky is “ForecastIo”, not “darksky”.
So the config has to be:

apikey.ForecastIo=xxxxxx
location.hamburg.provider=ForecastIo

Also, why do you need an update every minute? Darksky’s free API only offers 1000 calls a day which you will exceed with this setting.

1 Like

Christian, thank you so much, it worked! My functioning entry is:

apikey.ForecastIo=<key>
location.HomeWeather.provider=ForecastIo
location.HomeWeather.name=HomeWeather
location.HomeWeather.latitude=38.xxx
location.HomeWeather.longitude=-77.xxx
location.HomeWeather.updateInterval=15
location.HomeWeather.units=us
location.HomeWeather.language=en

I set it to 1 min refresh just for testing.

Hi,
I’m also trying to get this working, but no luck until now :anguished:

My weather service file

apikey.ForecastIo=573da79ad2e8458ce847dcxxxxxxxx
location.myweather.name=home
location.myweather.provider=ForecastIo
location.myweather.language=da
location.myweather.units=us
location.myweather.latitude=55.215624
location.myweather.longitude=11.743367
location.myweather.updateInterval=2

my items

Number   Temperature     "Temperature [%.2f °C]"     {weather="locationId=myweather, type=temperature, property=current, unit=fahrenheit"}

my log

2018-07-26 09:18:42.876 [INFO ] [eather.internal.common.WeatherConfig] - ProviderConfig[providerName=FORECASTIO,apiKey=573da79ad2e8458ce847dcd084xxxxxxx]
2018-07-26 09:18:42.889 [INFO ] [eather.internal.common.WeatherConfig] - LocationConfig[providerName=FORECASTIO,language=da,updateInterval=2,latitude=55.215624,longitude=11.743367,woeid=<null>,locationId=myweather,name=home]
2018-07-26 09:18:45.904 [INFO ] [ternal.scheduler.WeatherJobScheduler] - Disabling weather locationId 'myweather', no binding available
2018-07-26 09:21:47.423 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'weather.items'

any ideas would be helpfull

thanks,
Peter

Hi,

I got i solved by reading the https://www.openhab.org/addons/bindings/weather1/#weather-binding
documentation carefully.

/peter