Weather Underground - additional items...?

Hi, i started to use Wunderground binding and wanted to ask if one the officially mentioned items are available or if it is possible to have for example the follwoing as well to replicate into my OH2 installation?

Length of Day

if it is provided by Wunderground, but not supported in the binding, I presume you could do it by parsing the Json and extracting the value yourself

yes, but this would mean its taken from outside the binding, if i understand you right?
Which i would like to do as the worst alternative…

yes, you would go around the binding. I guess that would be the only alternative if the binding itself doesnt provide it…other than re-writing the binding ofcourse :wink:

Astro provides a length of day Channel

BTW, are you using a paid subscription to Wunderground? They are within days of turning off their free APIs and no longer offer a free API unless you have a weather station to provide info to them. But in that case the API is completely different so the Wunderground binding won’t work.

In other words, don’t spend any time on the Wunderground Binding (I think it got removed on the 2.4 release).

Hi Rich, that is very good information (@Astro). Thanks!!!

Sh"%$$, … i now spent days on the weather binding but none of all these weather sources provides realistic data for my town (near Vienna, Austria). Yesterday it was -10Degree…but none of them was close to 10…
-4degree was the closest…so tried WU and it works great and data are highly correct…binding is 2.5.0 so my believe is/was that its more likely to survive longterm then the Weather 1.0 binding…

hm…so back to start.

btw, i had a weather station sending data for years to WU,…so i have an active API…but as you said, noboday knows for how long this will stay this way…

Well, if you do then you should have received email from them signing you up for their new API.

The API is completely different and you have to have a weather station to get a key so I wouldn’t hold my breath for a binding. But you should be able to get access to the data using the HTTP binding. See, particularly the comments thread for details.

I don’t have a weather station so I’ve switched to the OpenWeatherMap binding for now. I’m more concerned with current conditions than the forecast so it works for what I need.

@rlkoshak do you have experience with Daylight from Astro? (guess this shows the hours a day has @ light.

Have Sunrise/set installed for years and it works, did it the same way but i only see “–” in ClassicUI.
Maybe i missed something stupid?

DateTime LocalSun_Rise_StartTime "Sunrise Miba [%1$tH:%1$tM]" <sunrise> { channel="astro:sun:local:rise#start" }
DateTime LocalSun_Set_StartTime "Sunset Miba [%1$tH:%1$tM]" <sunset> { channel="astro:sun:local:set#start" }
DateTime LocalSun_Daylight "Daylight Miba [%1$tH:%1$tM]" <daylight> { channel="astro:sun:local:daylight#duration" }

I think it’s minutes. I’ve seen it used but don’t use it myself.

If you look in PaperUI though, you will see that the daylight channel expects to be linked to a Number:Time Item, not a DateTime Item. A DateTime represents a specific instant in time, not a time duration.


You probably are seeing errors in the logs sayingsome thing like “cannot use 1401 to set DateTime Item LocalSun_Daylight”.

If you don’t want to mess with units of measurement (it’s worth learning it) it might work if you use just a Number Item.

Hi, thanks a lot for drawing a solution path.
I now can see 557min…is there a way to show as hh:mm. Tried several things based on your units of measurements link but did not work out as expected.

Regards Norbert

What have you tired. My understanding is that if you specify h as the unit (e.g. [%s h]) it should show hh:mm. Does it just show hh?

If it only shows hh then you will need a JS transform I think to convert the minutes to hh:mm. Something like:

(function(i) {
    if(isNaN(i)) return "NAN";
    var mins = i%60
    var totalhours = Math.floor(i/60)
    var hours = totalhours%24
    var days = Math.floor(totalhours/24)
    var pad = "00";
    return days+":"+(pad+hours).slice(-pad.length)+":"+(pad+mins).slice(-pad.length)+":00";

I’ve only ever used this with a plain Number though. You might need to do some string manipulation to remove the trailing “m” before you start doing math with the value. I don’t know. I’m pretty new to UOM myself.

Hi @rlkoshak, thanks a lot for the further input! i tried %s h but it delivers 9.316666666666666666667h which is close to what i need. I’m sorry to not be too firm in these value/unit manipulations and the link you sent does not provide any time examples but is there a way to make it look like 9:30 for hours:minutes?
If not this is fine as well and i would cut the longtail of numbers…

Cheers Norbert

Interesting. OK, we will need to use a JS transformation then to get to hh:mm. See the JavaScript above for how I do it.