OpenWeatherMap widget for HABPanel

Hi,
can anyone tell me how can i find my ID ?

My channel link looks like this (openweathermap2.4 binding):

openweathermap:weather-and-forecast:api:local:station#id

Thanks,
Patrick

works just fine
great job!

You can see the ID in the log file, e.g. when you add the weather informtion thing. Important: do not take the ID from the accout thing.

Well, I took me some time to get into Angular but a new enhanced version of this widget is available in beta. It now uses the hourly forecast to get the closest to noon data to display for the coming days. This way you get a more accurate daily forecast stil using the free API.

Before I pull it to master, I would appreciate it if someone with more experience with Angular can take a look at my code to see if it makes sense or not. For instance, I’ve got my doubts about the use of $interval. Fork if you like. Please add the items from the items file.

For everybody else, please wait with this beta until its reviewed.

1 Like

Hi varneyb,
How did you resolve your permission error? I think I`m facing the same problem

Greetings
Frozenfranz

Widget looks good. When I use the browser on my laptop it works perfectly.
I have a RPi with 7" touch screen. I’ve installed Firefox and Chromium and in both browsers it looks like this:

The forecast is stacked on top of each other and the current weather icon is in the wrong place.

I’m able to resize the icons but is there an easy way to resize the text?

Also, the configuration for Imperial (US) works well (THANK YOU!!) Except the current weather show km/h rather than mph. Couldn’t find the text in the set up.

1 Like

I can’t show the 3 images from the openweathermap/images folder (feel.png, humidity.png, wind.png) although the files are at the right place and all permissions are correct. Even after restarting OpenHAB2, nothing changes.

I can’t even access the images directly through the following URI path:
http://openhab:8080/static/openweathermap/images/humidity.png

However the files under openweathermap/weather-icons-master/ are directly accessible:
http://openhab:8080/static/openweathermap/weather-icons-master/svg/wi-rain.svg

Also, no forecast icons are displayed. Instead the CSS tells me there’s a N/A value somewhere, resulting in an incorrect CSS class wi-owm-N/A:

<i class="wi wi-owm-N/A" ng-style="{ 'color' : (config.icon_color_forecast == NULL) ? primary-color : config.icon_color_forecast, 'font-size' : (config.icon_size_forecast == NULL) ? '3em' : config.icon_size_forecast + 'em' }" style="font-size: 3em;"></i>

What else can I do?

Continuing the discussion from OpenWeatherMap widget for HABPanel:

this ist the same i get on my Nexus 7 tablet that i use for HABPanel UI

Hi Bastiaan,

I have got a problem with your widget.
It worked perfectly, and suddenly stopped. I completly deinstalled everything and started new, but the same problem occured. I have used the right ID, I have got the right Fiels and Folders, but I am not sure what it could be.

The three widgets on the right are dummies to show that I am useing the right ID and so on.

I solved the issue by my self. The problem that I had was located in the items file.

Number:Temperature		Weather_OWM_Temperature			"Temperature [%.1f %unit%]" <temperature>		{channel="openweathermap:weather-and-forecast:<your-id-here>:local:current#temperature"}

The :local: in the channel had to be deleted. Now the widget ist working like a charm.

I just haven’t found out from where the problem came from.

2 Likes

thanks for the widget, everything configured in less than 5minutes :slight_smile:
I just have troubles with the resolution on my tablet. how can I change the fontsize so it will fit my screen?

Have you checked the settings of the Widget? They contain options to adjust the text size. Otherwise you can alter it’s source code to set your own preferred css font sizes ext.

Whats you tabled screen size in pixels? I will see if I can find why it looks like that on this resolution.

1280 × 800 pixel …

Try this.

  • Go to your Custom widget list ( Manage button in the settings screen)
  • Click on the OpenWeatherMap widget
  • On the Code tab, replace all instances of “col-md-VALUE” to “col-VALUE”
  • Remove the “md” but don’t change the values!
  • Save in the top right corner
  • Refresh your Habpanel, you do not need to replace the Widget on the Dashboard. It will automaticly use the new code.

Same result on tablet and pc browser too.

But it works fine with “col-sm-”

That doesnt make sense.

This value determines when a column should be placed below each other. Each value, sm, md-, lg represents a certain width. When using “col-” it will not stack columns.

Same thing with me. col- didn’t work but col-sm did!

What I’m not seeing now is the setting to adjust text size. All that is there is for icon size.

Oh also, wind speed is still displayed as k/m rather than mph. Didn’t see anything in the code to fix that.

The widget looks great! Thanks for the effort you’ve put in this, @bastiaan_van_h

I have changed all col-md to col-sm and it works on my PC, but not my iPhone 7 Plus :frowning:

EDIT: I guess it’s the weekday names (full names) requiring the width.
How to set the weekdays to the short versions (Mon, Tue, or Mo Di accordingly in German)?

Oh also, wind speed is still displayed as k/m rather than mph. Didn’t see anything in the code to fix that.

Found the problem, change the windspeed item to:

Number:Speed    		Weather_OWM_Wind_Speed			"Windspeed [%.1f %unit%]"			                {channel="openweathermap:weather-and-forecast:<your-id-here>:local:current#wind-speed"}

It replaces the km/h with the variable %unit%.

Found it:
Juste needed to replace | date:'EEEE' with | date:'EEE'

The forecast is still stacked on top of each other…