UI Widget: Weather

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

Yeah i changed it vars for now. Don’t know if RC1 is out yet … its not showing for me via sudo apt update. Maybe its in a different repo from the snapshot. Anyways, snapshots will catchup in a day i guess, will change it again :slight_smile: thanks.

Every time the map is shown, I suppose.

Hmm, I tested it but I don’t think that I’ve refrehed the map view that much… Maybe I had the browser-tab opened with my modal in the foreground and every time I saved some changes to my widget, the widget and also the map view got refrehed … but just guessing.

I will deactivate it for now and test this later with another API key :slight_smile:

Hey @candiesdoodle

tested it again with build 2077 and a prefix - everything is working as expected. So ‘loop’ seems to be implemented here. I’m wondering, why it’s working with ‘vars.’ in your setup?!

But if it does, everything is fine :slight_smile: - tell me, if you run in trouble with future versions then.

Your UI widget encourages me to tweak it a little. Many thanks @RGroll
Features:

  • more customable translations
  • windspeed and humidity
  • Items are generated by UI (Create Equipment from Thing) exeptional “localStationName”

String OneCallAPIweatherandforecast_localStationName “Name” (OneCallAPIweatherandforecast) [“Point”] {channel=“openweathermap:weather-and-forecast:OpenWeatherMap:local:station#name”}

3 Likes