Dark Sky - Yawb4oH2 (Yet another weather binding for openHAB 2)

but I totally agree it’s not always possible to read all the posts :wink:

Hi @chris669,

The channel gust-speed of channel type Number:Speed is already supported by the binding (see https://www.openhab.org/addons/bindings/openweathermap/#current-weather).

I got this working yesterday on 2.5M1 thanks to a tip from @5iver here.When in the addons directory, I first installed this:

curl https://repo1.maven.org/maven2/com/google/code/gson/gson/2.8.5/gson-2.8.5.jar > gson-2.8.5.jar

I then installed

curl https://ci.openhab.org/job/openHAB2-Bundles/org.openhab.addons.bundles%24org.openhab.binding.darksky/lastSuccessfulBuild/artifact/org.openhab.addons.bundles/org.openhab.binding.darksky/2.5.0-SNAPSHOT/org.openhab.binding.darksky-2.5.0-SNAPSHOT.jar > org.openhab.binding.darksky-2.5.0-SNAPSHOT.jar'
2 Likes

@cweitkamp

I have just started working with the darksky binding.
Would it be possible to add channels with the icon descriptions so we could use a different icon set? I believe the API, by default just provides an icon description.

Thanks for your work.

Thanks for using the binding. Did you see the icon-id channel? It should return the description you are looking for. Be aware it is an advanced channel, thus not visible in an UI by default.

How do I access it then. Text item?

Depends on your setup. Most of the UIs have a “Show more” button to toggle visibility of advanced channels. In textual configuration use a String item like this:

String localCurrentConditionIconId "Icon ID" { channel="darksky:weather-and-forecast:api:local:current#icon-id" }
1 Like

Thanks.
I am still learning the UI too. Selecting “show More” does show the icon-id.

current#precip-intensity could be a useful addition from the API, IMHO.
current#apparent-temperature too.
Bith those are in the Home Assistant implementation for darksky.

The precipitation intensity is mapped to the channels rain and snow depending on the precipitation type. I omitted the apparent temperature for a reason. It is a “calculated” value and the used formula differs in various places. Some use e.g. “Heat index” and others “Humidex”. You can easily calculate it on your own in a rule.

Thanks. There are 3 precipitation types, though. rain, snow, sleet How is that mapped?
For my use the overall intensity may be useful but I guess I can just sum the values.

One minor units issue for Imperial units. The visibility defaults to inches but is better expressed in miles. I used the label attribute to adjust.

I am trying to make a Flask web app using the REST API to display weather with animated icons in a Webview similar to this:

image

It is initially for my own use but perhaps, with help it could be packaged to share. I have my items defined and am just starting on the Python Flask part.

1 Like

“sleet” seems to be a new type - or I was not aware of it. In case of type “rain” the data will be mapped to the rain channel, in case of “snow” to the snow channel. In this situation it maybe makes sense to introduce two new channels for precip-type and precip-intensity.

That is exactly how it should be done. :+1:

One more question to you - you seem to be very familiar with the API. Did you see my request for help in my OP? I am really interested in implementing the alert feature but I do not have experience with it. Do you? On the other hand I just saw DarkSky improved their docs and it now contains an example alert …

1 Like

I have not worked with alerts. I am just starting working with the REST API here. I have used some other REST APIs though.

I am surprised there is currently no security on the API so I am running my other processes on localhost, until my Pi screams in pain. :smiley:

I am pretty busy at work right now. I work at a University & summer is the busy time when maintenance & upgrade work can be done.

is there a version for OH 2.4.0 stable?

I am running it on 2.5M1 so it may work to manually install. It was added after M1.

In the meantime I submitted an enhancement to provide those two channels. It has been merged and they should be available in the latest snapshot version.

1 Like

Thank you.
I feel like I am giving you a rough time, but I really like the binding. I am currently running into html layout issues for what I envision but I will work through it (eventually).

It is great developers like you that has me recommending OH when I am over on the Home-Assistant forum.

No, absolutely not. People like you are giving me the feeling that I am doing something valuable without wasting my own spare time. Thanks.

Thanks.
Unfortunately I am having web page layout challenges implementing my ideas and other obligations are restricting the time I can currently spend on this.

I’ve installed this Binding manualy like in #23. It works fine but the WindSpeed is in PaperUI shown as m/s, in the Example added with Unit km/h.
I prefer km/h. This can be altered in the API call by Parameter units=ca. (see API Doc).
It may be possible to change this in the configuration as an optional Value like the language selection.
So the selection units=auto is the default and other maybe selected by user.