[OH3] Install & Set-up OpenWeatherMap via UI

Tags: #<Tag:0x00007efecd2a0a80> #<Tag:0x00007efecd2a09b8>

Hey!

This is my attempt to write down a beginner-friendly step-by-step instruction for the installation and configuration of the OpenWeatherMap binding via the new OH3 UI.

image

This tutorial is linked to the setup of the custom weather widgets for the new MainUI and should serve as a starting point for users of these widgets.

It should be seen as an addition to the already existing (and more in-depth) documentation.


But before we start, one more word on the prerequisites - It is recommended (but not mandatory) to set-up at least a basic semantic model before you start. There are some nice articles on how to proceed with this:


:computer: Installation & set-up via user interface

  1. Create a free OWM-Account
    1.1. Sign up here
    1.2. Grab your API-key here

  2. Install OpenWeatherMap Binding
    Settings → Bindings → + (Add) Button in the lower right corner → Search for OpenWeatherMap and Install the binding.
    001-install_binding

  3. Create Bridge Thing
    Settings → Things → + (Add) → Select OpenWeatherMap Binding → Select OpenWeatherMap Account which acts as the bridge → Set a UniqueID, a label as well as your OWM API key, Refresh Interval and Language → Click Create Thing
    002-create_bridge


    :exclamation: Info: Don’t panic if your bridge thing is shown as ‘Offline’ at this stage - it will work after adding more things that connects to that bridge.


    This is also a good time to check if you’ve set-up your geolocation via…
    Settings → Regional Settings → Set your Location

  4. Add more things
    Settings → Things → + (Add) → Select OpenWeatherMap Binding → Click Add All in the Discovered Things or just select the Things that you need.


    :exclamation: Info: You need at least the Local weather and forecast and the One Call API weather and forecast thing to use the full functionality of the above mentioned weather widgets.


    004-add_things

    • Local UV-Index
      Thing for all UV-Index related items for your location

    • One Call API history data
      Historical weather-data for your location from the OWM OneCall API

    • Local weather and forecast
      Local weather and forecast data for your location based on the standard OWM API

    • One Call API weather and forecast
      Local weather and forecast data for your location based on the OWM OneCall API (reduced API calls and more information channels)

    Now all your Things should be visible in the Things overview and marked as Online
    006-things_overview

  5. Create items
    Settings → Things → Select One Call API weather and forecast → Configure the parameters Number of Days and Number of Hours to your liking and hit Save to update the parameters.


    :exclamation: Info: For all of the weather-widgets to work as intended you need at least:

    • Number of days 4
    • Number of hours 13

    Change the tab at the top to Channels → Scroll down to the bottom of the page → Click Add Points to Model

    Now you can pick a Location or Equipment group within the semantic model where your items will be inserted (if you have one already) - click Pick from Model for this.

    If you don’t have a semantic model yet, you can leave this empty (what we will do here for demo purposes)

    If you would choose Expert Mode here, you’d get a text view with all of the channels that will be linked to the point items (including a suggested naming)


    :exclamation: Info

    As you might recognize at this point, the OneCall API Thing of the OWM binding has a lot of channels (666 :japanese_ogre: in the 7-days and 25-hour configuration)

    Linking all of them might cause your browser to get unresponisve multiple times within the linking process.

    If you just want to use the minimal required channels for the above mentioned weather-widgets, it would be enough to add ‘only’ 172 of the available channels…

    There are 2-ways to filter these items now…

    1. Select all of the needed channels by hand (by clicking the checkbox to the left of each channel)

    1.1. Fine, I like clicking, show me the list of channels to link...
    ObservationTime                    
    Current_Sunrise                    
    Current_Sunset                     
    Current_Condition                  
    Current_Conditionid                
    Current_Iconid                     
    Current_Temperature                
    Current_Apparenttemperature        
    Current_Pressure                   
    Current_Humidity                   
    Current_Windspeed                  
    ForecastHours01_Condition          
    ForecastHours01_Conditionid        
    ForecastHours01_Iconid             
    ForecastHours01_Temperature        
    ForecastHours01_Apparenttemperature
    ForecastHours01_Pressure           
    ForecastHours01_Humidity           
    ForecastHours01_Windspeed          
    ForecastHours01_Precipprobability  
    ForecastHours02_Condition          
    ForecastHours02_Conditionid        
    ForecastHours02_Iconid             
    ForecastHours02_Temperature        
    ForecastHours02_Apparenttemperature
    ForecastHours02_Pressure           
    ForecastHours02_Humidity           
    ForecastHours02_Windspeed          
    ForecastHours02_Precipprobability  
    ForecastHours03_Condition          
    ForecastHours03_Conditionid        
    ForecastHours03_Iconid             
    ForecastHours03_Temperature        
    ForecastHours03_Apparenttemperature
    ForecastHours03_Pressure           
    ForecastHours03_Humidity           
    ForecastHours03_Windspeed          
    ForecastHours03_Precipprobability  
    ForecastHours04_Condition          
    ForecastHours04_Conditionid        
    ForecastHours04_Iconid             
    ForecastHours04_Temperature        
    ForecastHours04_Apparenttemperature
    ForecastHours04_Pressure           
    ForecastHours04_Humidity           
    ForecastHours04_Windspeed          
    ForecastHours04_Precipprobability  
    ForecastHours05_Condition          
    ForecastHours05_Conditionid        
    ForecastHours05_Iconid             
    ForecastHours05_Temperature        
    ForecastHours05_Apparenttemperature
    ForecastHours05_Pressure           
    ForecastHours05_Humidity           
    ForecastHours05_Windspeed          
    ForecastHours05_Precipprobability  
    ForecastHours06_Condition          
    ForecastHours06_Conditionid        
    ForecastHours06_Iconid             
    ForecastHours06_Temperature        
    ForecastHours06_Apparenttemperature
    ForecastHours06_Pressure           
    ForecastHours06_Humidity           
    ForecastHours06_Windspeed          
    ForecastHours06_Precipprobability  
    ForecastHours07_Condition          
    ForecastHours07_Conditionid        
    ForecastHours07_Iconid             
    ForecastHours07_Temperature        
    ForecastHours07_Apparenttemperature
    ForecastHours07_Pressure           
    ForecastHours07_Humidity           
    ForecastHours07_Windspeed          
    ForecastHours07_Precipprobability  
    ForecastHours08_Condition          
    ForecastHours08_Conditionid        
    ForecastHours08_Iconid             
    ForecastHours08_Temperature        
    ForecastHours08_Apparenttemperature
    ForecastHours08_Pressure           
    ForecastHours08_Humidity           
    ForecastHours08_Windspeed          
    ForecastHours08_Precipprobability  
    ForecastHours09_Condition          
    ForecastHours09_Conditionid        
    ForecastHours09_Iconid             
    ForecastHours09_Temperature        
    ForecastHours09_Apparenttemperature
    ForecastHours09_Pressure           
    ForecastHours09_Humidity           
    ForecastHours09_Windspeed          
    ForecastHours09_Precipprobability  
    ForecastHours10_Condition          
    ForecastHours10_Conditionid        
    ForecastHours10_Iconid             
    ForecastHours10_Temperature        
    ForecastHours10_Apparenttemperature
    ForecastHours10_Pressure           
    ForecastHours10_Humidity           
    ForecastHours10_Windspeed          
    ForecastHours10_Precipprobability  
    ForecastHours11_Condition          
    ForecastHours11_Conditionid        
    ForecastHours11_Iconid             
    ForecastHours11_Temperature        
    ForecastHours11_Apparenttemperature
    ForecastHours11_Pressure           
    ForecastHours11_Humidity           
    ForecastHours11_Windspeed          
    ForecastHours11_Precipprobability  
    ForecastHours12_Condition          
    ForecastHours12_Conditionid        
    ForecastHours12_Iconid             
    ForecastHours12_Temperature        
    ForecastHours12_Apparenttemperature
    ForecastHours12_Pressure           
    ForecastHours12_Humidity           
    ForecastHours12_Windspeed          
    ForecastHours12_Precipprobability  
    ForecastHours13_Condition          
    ForecastHours13_Conditionid        
    ForecastHours13_Iconid             
    ForecastHours13_Temperature        
    ForecastHours13_Apparenttemperature
    ForecastHours13_Pressure           
    ForecastHours13_Humidity           
    ForecastHours13_Windspeed          
    ForecastHours13_Precipprobability  
    ForecastToday_Sunrise              
    ForecastToday_Sunset               
    ForecastToday_Condition            
    ForecastToday_Conditionid          
    ForecastToday_Iconid               
    ForecastToday_Mintemperature       
    ForecastToday_Maxtemperature       
    ForecastToday_Pressure             
    ForecastToday_Humidity             
    ForecastToday_Windspeed            
    ForecastToday_Precipprobability    
    ForecastTomorrow_Sunrise           
    ForecastTomorrow_Sunset            
    ForecastTomorrow_Condition         
    ForecastTomorrow_Conditionid       
    ForecastTomorrow_Iconid            
    ForecastTomorrow_Mintemperature    
    ForecastTomorrow_Maxtemperature    
    ForecastTomorrow_Pressure          
    ForecastTomorrow_Humidity          
    ForecastTomorrow_Windspeed         
    ForecastTomorrow_Precipprobability 
    ForecastDay2_Sunrise               
    ForecastDay2_Sunset                
    ForecastDay2_Condition             
    ForecastDay2_Conditionid           
    ForecastDay2_Iconid                
    ForecastDay2_Mintemperature        
    ForecastDay2_Maxtemperature        
    ForecastDay2_Pressure              
    ForecastDay2_Humidity              
    ForecastDay2_Windspeed             
    ForecastDay2_Precipprobability     
    ForecastDay3_Sunrise               
    ForecastDay3_Sunset                
    ForecastDay3_Condition             
    ForecastDay3_Conditionid           
    ForecastDay3_Iconid                
    ForecastDay3_Mintemperature        
    ForecastDay3_Maxtemperature        
    ForecastDay3_Pressure              
    ForecastDay3_Humidity              
    ForecastDay3_Windspeed             
    ForecastDay3_Precipprobability
    

    2. Use the mentioned Expert Mode and link your channels that way…

    2.1. No clicking - sound`s good - What I've to do?!
    • :warning: Be carefull: If you have selected a group in your semantic model or your Thing bridge naming differs from the one that is used in this tutorial, you might adjust the values - a basic understanding of the item pattern is important here.

    • Click on Expert Mode and put in this list of items (no semantic model assigned and bridge as name of the Bridge Thing)

      oh3-widgets/owm-weather_onecall_minimal at master · rgrollfitz/oh3-widgets · GitHub


    But we leave the Expert Mode behind for now and go full UI here.

    To make sure we’ll add all the needed items we check Show advanced on the top right of the bottom-list. → Scroll all the way down click Select All and Add to Model then.

    010-add_to_model

    image

  6. Finish
    You should see a list of all the linked channels with their respective items now - Congratulations! :partying_face:
    Go to Settings → Items to see your added Items and check their curent state.

    To add more items from the things you’ve created above, just repeat the steps from point 5.

  7. Create your first widget
    Now you can proceed using the state of your items in sitemaps, rules and especially the great new pages layout, where you can add system- and custom-widgets.

    As mentioned, there are already some custom-widgets available here, which are fully compatible with the items that you just created.

Hope this will help someone making his first steps with the OpenHAB 3.0 UI.

7 Likes

[placeholder]

Thanks for your detailed howto @RGroll,
With the 7 days & 25h setting you screenshotted above this added 666 items to my config :slight_smile: Whoop, whoop!
My Chrome alerted like 3 times about unresponsiveness until the the “Select all” finished up.
image

I guess these are a “few” items too much. Do you have a recommendation on the day & hour settings. I just want to add your awesome Weather widget from the other thread.
Thanks much for your efforts!

Hey @waitz_sebastian
Thanks for your feedback and the kind words!

And yes, my browser alerted me too and I think if I’ve done this on a slower machine the consequences of this load may be even harder.

The OWM binding is a veeery channel-heavy binding, other bindings are much more ‘lightweight’ - but I think it’s worth the hardware-effort, having the possibility to show a 24 hour-forecast :smiley:

Everyone should adjust these values to their needs and might save some items (and system-load) on the way :slight_smile:

I personally like the 24-hour / 7-days forecast - For all widgets to work as intended, you need 13 hours and 4 days for all type of weather-widgets that are available. If you aim to use the standard weather_Popup without the extended feature-set, you could get rid of the hourly-forecast completely and set your days-forecast to 4 (today + 3 days forecast)

I’ll post a new version in the next hours, which brings some more possibilities in terms of styling and size (but not regarding the needed items tbh :stuck_out_tongue:)

Hello,
I add onecallapi to be a le to display precipitation hourly forecast in weather widget but values are Null.
Some known fix or test to do?

  • What is the item-state in the item-overview of OH (http://YOUR-OH-IP:8080/#!/settings/items/)
  • Do you used the widgets from the linked thread or built your own one? If you used the linked widgets, did you set up the itemPrefix?

MMhhh after one reboot all seems OK.

The new “collapsable” widget is beautyful.

Thank you and sorry for disturb

Glad to hear!

Thank you! And no problem - If i don’t have time or passion to answer I just wouldn’t do it - so don’t hesitate to ask, if you get stuck. :stuck_out_tongue:

Hi Rainer,

I read this tutorial, but I can not get this wifget to run.
I copied the text from github and integrated the items over the ui approach.
I used all items from OneCallApi Weather and Forecast.
On all these items I can see Values.

The I create the Widget with the help of the ui, and copied the text from git(WeatherCard)
inside the windwow. I just changed the two parts you mentioned.

uid: weatherCard
tags:

  • allInOne
  • weather
  • expandable
  • OpenWeatherMap
  • daily forecast
  • hourly forecast
    props:
    parameters:
    • description: Optional prefix for item names
      label: OneCallAPIweatherandforecast_
      name: OneCallAPIweatherandforecast_
      required: false
      type: TEXT
      groupName: general
    • description: Additional prefix for item names that belongs to another Things channel (valid for ‘StationName’ as it might differ)
      label: Localweatherandforecast_
      name: Localweatherandforecast_
      required: false

The rest stays untouched.

On one of my pages I can see the widget but with no valid content.
Do you ore someone has a tip?

Hey @Gthorsten,

you don’t have to change the widget code itself. The settings I mentioned are for inside the widget configuration.

Just copy the code from github into the widget editor and click Save. After that, go to the page where you want to add the widget to and click Edit on the top right corner and add the widget into a column. - Tap the black icon on the top right of the added widget and select Configure Widget. (see here for a bit more info on that)

Hope it helps!

Hi Rainer,
Thanks for this tip. I will try it later and answer you.
Best regards
Thorsten