UI Widget: Weather

Hi, here the map file meteo.map.txt (1.0 KB) , you should rename it as meteo.map and move to the “transform” directory.
Then you should add the ConditionID items as follow:

String localCurrentConditionID “[MAP(meteo.map):%s]”
String localDailyForecastTomorrowConditionID “[MAP(meteo.map):%s]”
and so on …

Than you can use this updated Widget UI_Weather2.txt (37.6 KB) even if it is not the final version yet

Regards
Lorenzo

1 Like

I’m currently working on a soloution with custom backgrounds depending on day/night as well as the weather condition. Your mapping will help me here, saving some time - TY! :slight_smile:

And please keep me updated on your progress.

On my side it’s mostly about creating and adjusting the images inside the widget that it looks nice on all devices. If I got this working in my test-widget I’ll implement this in this version as well.

7 Likes

Rainer, Do you mind sharing your updated widget :wink:

Hey @hmerk

I’ll do tomorrow if everything goes according to plan (which also depends on the mood of my son, who is a bit grumpy right now :stuck_out_tongue:) . There are some nasty errors on iOS I’d like to solve before I publish it and I have to create some weather graphics, to not getting any copyright troubles.

I try my best to publish it as fast as I can - as I’m very interested in your opinion. :slight_smile:

2 Likes

I know what you mean, my 2 1/2 year old boy can be really stressing…

1 Like

Impossible, unfortunately. The YAML is just another serialization of the contents of the JSON DB, and JSON doesn’t support comments. I preferred having a clean JSON DB than do what I did in HABPanel and serialize everything in a JSON string, which is ugly.

Understandable - thanks for your quick response!

This would look lovely as a popup to a marker in a map page, since map pages can now display weather overlays from OWM :wink:

3 Likes

Will update my build immediately and try it out :stuck_out_tongue:

Would this work also the other way around - implementing this kind of map as an inline-view inside of widgets?

Despite that I feel like the weather-guy on the news right now after starring on all that weather-informations for hours… :crazy_face:

// Edit:
Works very well - is the API called each time the map gets opened?

And another one with a smaller footprint inside a card…

Additionally to the above mentioned items, it uses this:

Number                  localCurrentApparentTemp            "Apparent Temperature [%.0f°]"      { channel="openweathermap:onecall:api:local:current#apparent-temperature" }

→ See the first post for a new version

7 Likes

Excellent @RGroll, will test it soon…

1 Like

Could a “comment” field be added to the JSON/YAML? The comments don’t necessarily need to be inline to be useful. Just one comment field that can hold arbitrary text per level could be quite handy.

Yes, if it doesn’t break the JSON DB, I never altered the schema so I don’t know how it behaves… Probably not what you want to hear, but you can put anything in the config: section, for instance a _comment: key, if it doesn’t match anything it will simply be ignored :slight_smile:

Good to know @ysc, din’t thought about this. This could help already. Would it be possible to mark those lines in a separate color in the editor? Maybe based on the underscore at the beginning (_)?

hi @RGroll, i cant seem to get it work. I imported your item definition, added a prefix in item names while importing and in the props too, but this is what i am getting in the widget. And i am on #2077. Any suggestions

When did you copied the code as I changed the syntax of oh-repeater today? I will check this after my OWM binding is working again (something broke after updating to RC1)

Just to take everything into account - what prefix you’ve added?

We’ll see… for 3.1 :wink:

1 Like

got it to work. it was the loop.day vs. vars.day issue. I guess RC1 should solve it. For #2077, its still vars.day
Btw, just a note for others - for images, custom URLs for local images have to be within the /etc/openhab/html/ folder.

So:
/etc/openhab/html/weather_img/skyline_day.svg is /static/weather_img/skyline_day.svg

1 Like

Thanks for your response and glad you got it working! Do you changed loop back to vars now or do you updated your version?

But somewhat strange… - I used 2077 before updating to RC1 for testing and loop worked there. Maybe it is some other problem then… I’ll have a look.

@ysc I think there might be an error with the frequency of the OWM API calls in context with the map-overlay for the rain radar. I wondered why my OWM binding can’t connect and saw this in my OWM overview :stuck_out_tongue:

How often does it refresh?

1 Like