habPanel configuration for weather in openhab2

Hello everyone

waiting to receive my raspberry Pi3.
I have installed openhab2 on wiindows 10 64bits
I read the tutorials for started
and to learn I try to start the setting of the weather.
But I can not display this one
I’ll put you in attachment the elements of parameterization that I made if you could give me a hand

Regards,

My html wigdet

<div ng-init="ServerPath='http://192.168.0.1/static'; IconSet='flat_colorful'">
<link rel="stylesheet" type="text/css" href="{{ServerPath}}/layouts/example.css" />
</div>

<table id="weather-table">
	<tr>
		<td colspan="4" ng-if="itemValue('ObservationTime0')!='UNDEF'">My Weather {{itemValue('ObservationTime0') | date:'short'}}</td>
		<td colspan="4" ng-if="itemValue('ObservationTime0')=='UNDEF'">My Weather --/--/----</td>
	</tr>
	<tr>
		<td rowspan="2" colspan="2" ng-if="itemValue('Condition0')!='UNDEF'"><img id="weather-icon" src="{{ServerPath}}/images/{{IconSet}}/{{itemValue('Condition_ID0').replace(' ','-') | lowercase }}.png"/></td>
		<td rowspan="2" colspan="2" ng-if="itemValue('Condition0')=='UNDEF'"><img id="weather-icon" src="{{ServerPath}}/images/{{IconSet}}/3200.png"/></td>
		<td colspan="2" id="weather-temp"  align="left" ng-if="itemValue('Temperature')!='UNDEF'">{{'%.0f' | sprintf:itemValue('Temperature')}}<font id="weather-temp-sign">°C</font></td>
		<td colspan="2" id="weather-temp"  align="left" ng-if="itemValue('Temperature')=='UNDEF'">--</td>
	</tr>
	<tr>
		<td colspan="2">
			<table id="weather-table-details">
				<tr>
					<td>Humidity:</td>
					<td ng-if="itemValue('Humidity')!='UNDEF'">{{itemValue('Humidity')}} %</td>
					<td ng-if="itemValue('Humidity')=='UNDEF'">-- %</td>
				</tr>
				<tr>
					<td>Pressure:</td>
					<td ng-if="itemValue('Pressure')!='UNDEF'">{{'%.0f' | sprintf:itemValue('Pressure') / 1000}} MPa</td>
					<td ng-if="itemValue('Pressure')=='UNDEF'">-- MPa</td>
				</tr>
			</table>
		</td>
	</tr>
	<tr colspan="4">
	 <td height="20"></td>
	</tr>
	<tr>
		<td/>
		<td>Today</td>
		<td ng-if="itemValue('ObservationTime1')!='UNDEF'">{{itemValue('ObservationTime1') | date:'EEEE'}}</td>
		<td ng-if="itemValue('ObservationTime1')=='UNDEF'">--</td>
		<td ng-if="itemValue('ObservationTime2')!='UNDEF'">{{itemValue('ObservationTime2') | date:'EEEE'}}</td>
		<td ng-if="itemValue('ObservationTime2')=='UNDEF'">--</td>
	</tr>
	<tr>
		<td/>
		<td ng-if="itemValue('Condition_ID0')!='UNDEF'">
			<img id="weather-icon" src="{{ServerPath}}/images/{{IconSet}}/{{itemValue('Condition_ID0').replace(' ','-') | lowercase }}.png"/>
			<p> {{itemValue('Condition0')}} </p>
		</td>
		<td ng-if="itemValue('Condition_ID0')=='UNDEF'">
			<img id="weather-icon" src="{{ServerPath}}/images/{{IconSet}}/3200.png"/>
			<p>--</p>
		</td>
		<td ng-if="itemValue('Condition_ID1')!='UNDEF'">
			<img id="weather-icon" src="{{ServerPath}}/images/{{IconSet}}/{{itemValue('Condition_ID1').replace(' ','-') | lowercase }}.png"/>
			<p> {{itemValue('Condition1')}} </p>
		</td>
		<td ng-if="itemValue('Condition_ID1')=='UNDEF'">
			<img id="weather-icon" src="{{ServerPath}}/images/{{IconSet}}/3200.png"/>
			<p>--</p>
		</td>
				<td ng-if="itemValue('Condition_ID2')!='UNDEF'">
			<img id="weather-icon" src="{{ServerPath}}/images/{{IconSet}}/{{itemValue('Condition_ID2').replace(' ','-') | lowercase }}.png"/>
			<p> {{itemValue('Condition2')}} </p>
		</td>
		<td ng-if="itemValue('Condition_ID2')=='UNDEF'">
			<img id="weather-icon" src="{{ServerPath}}/images/{{IconSet}}/3200.png"/>
			<p>--</p>
		</td>
	</tr>
	<tr>
		<td class="col-xs-4" style="color:red">Max</td>
		<td class="col-xs-4" style="color:red" ng-if="itemValue('Temp_Max0')!='UNDEF'">{{'%.0f' | sprintf:itemValue('Temp_Max0')}} °C</td>
		<td class="col-xs-4" style="color:red" ng-if="itemValue('Temp_Max0')=='UNDEF'">-- °C</td>
		<td class="col-xs-4" style="color:red" ng-if="itemValue('Temp_Max1')!='UNDEF'">{{'%.0f' | sprintf:itemValue('Temp_Max1')}} °C</td>
		<td class="col-xs-4" style="color:red" ng-if="itemValue('Temp_Max1')=='UNDEF'">-- °C</td>
		<td class="col-xs-4" style="color:red" ng-if="itemValue('Temp_Max2')!='UNDEF'">{{'%.0f' | sprintf:itemValue('Temp_Max2')}} °C</td>
		<td class="col-xs-4" style="color:red" ng-if="itemValue('Temp_Max2')=='UNDEF'">-- °C</td>
	</tr>
	<tr>
		<td class="col-xs-4" style="color:#0db9f0">Min</td>
		<td class="col-xs-4" style="color:#0db9f0" ng-if="itemValue('Temp_Min0')!='UNDEF'">{{'%.0f' | sprintf:itemValue('Temp_Min0')}} °C</td>
		<td class="col-xs-4" style="color:#0db9f0" ng-if="itemValue('Temp_Min0')=='UNDEF'">-- °C</td>
		<td class="col-xs-4" style="color:#0db9f0" ng-if="itemValue('Temp_Min1')!='UNDEF'">{{'%.0f' | sprintf:itemValue('Temp_Min1')}} °C</td>
		<td class="col-xs-4" style="color:#0db9f0" ng-if="itemValue('Temp_Min1')=='UNDEF'">-- °C</td>
		<td class="col-xs-4" style="color:#0db9f0" ng-if="itemValue('Temp_Min2')!='UNDEF'">{{'%.0f' | sprintf:itemValue('Temp_Min2')}} °C</td>
		<td class="col-xs-4" style="color:#0db9f0" ng-if="itemValue('Temp_Min2')=='UNDEF'">-- °C</td>
	</tr>
</table>

my weather.cfg

apikey.Wunderground=xxxxxxxxxxx

location.home.name=home
location.home.latitude=48.666637
location.home.longitude=-1.2323350000000346
location.home.provider=Wunderground
location.home.language=fr
location.home.updateInterval=10

My weather.item

String Conditions "Conditions [%s]" {channel="weatherunderground:weather:CDG:current#conditions"}
Image Icon "Icon" {channel="weatherunderground:weather:CDG:current#icon"}
DateTime ObservationTime "Observation time [%1$tH:%1$tM]" <clock>  {channel="weatherunderground:weather:CDG:current#observationTime"}
String Location "Location [%s]" {channel="weatherunderground:weather:CDG:current#location"}
String Station "Station [%s]" {channel="weatherunderground:weather:CDG:current#stationId"}

Number Temperature "Current temperature [%.1f °C]" <temperature> {channel="weatherunderground:weather:CDG:current#temperature"}
Number FeelTemp "Feeling temperature [%.1f °C]" <temperature>  {channel="weatherunderground:weather:CDG:current#feelingTemperature"}

Number Humidity "Humidity [%d %%]" <humidity> {channel="weatherunderground:weather:CDG:current#relativeHumidity"}
Number Pressure "Pressure [%.0f hPa]" {channel="weatherunderground:weather:CDG:current#pressure"}

Number RainD "Rain [%.1f mm]" <rain> {channel="weatherunderground:weather:CDG:current#precipitationDay"}
Number RainH "Rain [%.1f mm/h]" <rain> {channel="weatherunderground:weather:CDG:current#precipitationHour"}

String WindDirection "Wind direction [%s]" <wind> {channel="weatherunderground:weather:CDG:current#windDirection"}
Number WindDirection2 "Wind direction [%.0f °]" <wind>  {channel="weatherunderground:weather:CDG:current#windDirectionDegrees"}
Number WindSpeed "Wind speed [%.1f km/h]" <wind> {channel="weatherunderground:weather:CDG:current#windSpeed"}
Number WindGust "Wind gust [%.1f km/h]" <wind> {channel="weatherunderground:weather:CDG:current#windGust"}

Number DewPoint "Dew Point [%.1f °C]" <temperature>  {channel="weatherunderground:weather:CDG:current#dewPoint"}
Number HeatIndex "Heat Index [%.1f °C]" <temperature>  {channel="weatherunderground:weather:CDG:current#heatIndex"}
Number WindChill "Wind Chill [%.1f °C]" <temperature>  {channel="weatherunderground:weather:CDG:current#windChill"}
Number Visibility "Visibility [%.1f km]" {channel="weatherunderground:weather:CDG:current#visibility"}
Number SolarRadiation "Solar Radiation [%.2f] W/m2"  {channel="weatherunderground:weather:CDG:current#solarRadiation"}
Number UV "UV Index [%.1f]" {channel="weatherunderground:weather:CDG:current#UVIndex"}

DateTime ForecastTime "Forecast time [%1$tH:%1$tM]" <clock>  {channel="weatherunderground:weather:CDG:forecastToday#forecastTime"}
String ForecastCondition "Forecast conditions [%s]"  {channel="weatherunderground:weather:CDG:forecastToday#conditions"}
Image ForecastIcon "Forecast icon"  {channel="weatherunderground:weather:CDG:forecastToday#icon"}
Number ForecastTempMin "Forecast min temp [%.1f °C]" <temperature>  {channel="weatherunderground:weather:CDG:forecastToday#minTemperature"}
Number ForecastTempMax "Forecast max temp [%.1f °C]" <temperature>  {channel="weatherunderground:weather:CDG:forecastToday#maxTemperature"}
Number ForecastHumidity "Forecast Humidity [%d %%]" <humidity>  {channel="weatherunderground:weather:CDG:forecastToday#relativeHumidity"}
Number ForecastProbaPrecip "Proba precip [%d %%]" <rain>  {channel="weatherunderground:weather:CDG:forecastToday#probaPrecipitation"}
Number ForecastRain "Rain [%.1f mm]" <rain> {channel="weatherunderground:weather:CDG:forecastToday#precipitationDay"}
Number ForecastSnow "Snow [%.2f cm]" <rain> {channel="weatherunderground:weather:CDG:forecastToday#snow"}
String ForecastMaxWindDirection "Max wind direction [%s]" <wind>  {channel="weatherunderground:weather:CDG:forecastToday#maxWindDirection"}
Number ForecastMaxWindDirection2 "Max wind direction [%.0f °]" <wind>  {channel="weatherunderground:weather:CDG:forecastToday#maxWindDirectionDegrees"}
Number ForecastMaxWindSpeed "Max wind speed [%.1f km/h]" <wind>  {channel="weatherunderground:weather:CDG:forecastToday#maxWindSpeed"}
String ForecastAvgWindDirection "Avg wind direction [%s]" <wind>  {channel="weatherunderground:weather:CDG:forecastToday#averageWindDirection"}
Number ForecastAvgWindDirection2 "Avg wind direction [%.0f °]" <wind>  {channel="weatherunderground:weather:CDG:forecastToday#averageWindDirectionDegrees"}
Number ForecastAvgWindSpeed "Avg wind speed [%.1f km/h]" <wind>  {channel="weatherunderground:weather:CDG:forecastToday#averageWindSpeed"}

here is what it gives

thanks

You have this line

<div ng-init="ServerPath='http://192.168.0.1/static'; IconSet='flat_colorful'">

Is 192.168.0.1 really the IP of your OH server ?
I assume that’s your router. So you might replace it with the correct IP

Hello
this address and the IP of my server OH
my router is in 192.168.0.254

there is no one for my problem
thank you

Comparing your first line with my setup, I have the port stated there also.
So your line should read:

<div ng-init="ServerPath='http://192.168.0.1:8080/static'; IconSet='flat_colorful'">

Hello thank you very much
the: 8080 was present except that I forgot it in the example that I showed you
I noticed one thing, when I retrieve the link of the images in my browser I get this address
http://192.168.0.1:8080/static/images/flat_colorful/null.png
normally should not I get his address with the correct png file name?

In short, Yes!
For me such a request looks like:

http://openhab:8080/static/images/flat_colorful/04d.png

Are you sure that you are getting returns from the weather provider?

excuse me from my ignorance I’m just beginning to use openhab and understand it
how do we see that we receive from the weather provider

Either on a “normal” sitemap using BasicUI or ClassicUI. Or use the log on karaf , by setting
"log:set DEBURG org.openhab.binding.weather"
you will see the debug entries in the log.

i just saw the openhab log file and i think i have errors of locationId
I can transmit the file to you
if you can take a look
Thank you
openhab-log.pdf (340.8 KB)

The log complains about a missing weather.cfg file. You posted yours, where is it stored? It should be in “etc/openhab2/services/” (at least it is there on my openhabian system)

Checking your setup I found that your items are setup other then mine:

I have them defined like that:

Number Temperature "Temperatur [%.1f °C]" <temperature< {weather="locationId=home, type=temperature, property=current"}

at least it works for me that way.

my weather.cfg file is located in the openhab2 \ conf \ services folder

for now my installation is under windows
I ordered a raspberry pi3 card but I did not receive it
is what being under windows changes a few things

should be ok.

yes that’s what I tell myself too

is it that you bother to show me your files of the meto so that I can compare to mine
if your configuration does the same on my machine it is that I must be mistaken somewhere
Thank you

My weather.cfg:

apikey.OpenWeatherMap=MyKey
location.home.name=MyHome
location.home.latitude=somewherenorthoftheequator
location.Nordholz.longitude=somewhereeastofgreenwich
location.Nordholz.provider=OpenWeatherMap
location.Nordholz.language=de
location.Nordholz.updateInterval=30

my weather-items

//Wetter
String StationName    "Wetter in [%s]" {weather="locationId=home, type=station, property=name"}
Number Temperature    "Temperatur [%.1f °C]"      {weather="locationId=home, type=temperature, property=current"}
Number WindSpeed      "Windgeschwindigkeit [%.f kmh]"       {weather="locationId=home, type=wind, property=speed"}
String WindDirection   "Windrichtung [%s]"         {weather="locationId=home, type=wind, property=direction"}
DateTime ObservationTime    "Last update [%1$td.%1$tm.%1$tY %1$tH:%1$tM]" {weather="locationId=home, type=condition, property=observationTime"}
DateTime ObservationTime0   "Observation time [%1$td.%1$tm.%1$tY %1$tH:%1$tM]"   {weather="locationId=home, forecast=0, type=condition, property=observationTime"}
DateTime ObservationTime1   "Observation time [%1$td.%1$tm.%1$tY %1$tH:%1$tM]"   {weather="locationId=home, forecast=1, type=condition, property=observationTime"}
DateTime ObservationTime2   "Observation time [%1$td.%1$tm.%1$tY %1$tH:%1$tM]"   {weather="locationId=home, forecast=2, type=condition, property=observationTime"}
Switch Holiday
Number   Temp_Min0         "Temperatur min [%.2f °C]"  {weather="locationId=home, forecast=0, type=temperature, property=min"}
Number   Temp_Max0         "Temperatur max [%.2f °C]"  {weather="locationId=home, forecast=0, type=temperature, property=max"}
Number   Temp_Min1         "Temperatur min [%.2f °C]"  {weather="locationId=home, forecast=1, type=temperature, property=min"}
Number   Temp_Max1         "Temperatur max [%.2f °C]"  {weather="locationId=home, forecast=1, type=temperature, property=max"}
Number   Temp_Min2         "Temperatur min [%.2f °C]"  {weather="locationId=home, forecast=2, type=temperature, property=min"}
Number   Temp_Max2         "Temperatur max [%.2f °C]"  {weather="locationId=home, forecast=2, type=temperature, property=max"}
String   Condition          "Wetter [%s]"             {weather="locationId=home, type=condition, property=text"}
String   Condition0         "Wetter [%s]"             {weather="locationId=home, forecast=0, type=condition, property=text"}
String   Condition1         "Wetter [%s]"             {weather="locationId=home, forecast=1, type=condition, property=text"}
String   Condition2         "Wetter [%s]"             {weather="locationId=home, forecast=2, type=condition, property=text"}
String   ConditionIcon        "Wetter [%s]"             {weather="locationId=home,  type=condition, property=icon"}
String   ConditionIcon0       "Wetter [%s]"             {weather="locationId=home, forecast=0, type=condition, property=icon"}
String   ConditionIcon1       "Wetter [%s]"             {weather="locationId=home, forecast=1, type=condition, property=icon"}
String   ConditionIcon2       "Wetter [%s]"             {weather="locationId=home, forecast=2, type=condition, property=icon"}

My habpanel setup

<div ng-init="ServerPath='http://openhab:8080/static'; IconSet='flat_colorful'">
<link rel="stylesheet" type="text/css" href="{{ServerPath}}/layouts/example.css" />
</div>

<div id="weather-location-name" >
	{{itemValue('StationName')}}  am  {{itemValue('ObservationTime') | date:'dd.MM.yyyy HH:mm'}} Uhr
</div>

<table id="weather-table">
	<tr>
		<td rowspan="3"><img id="weather-icon" src="{{ServerPath}}/images/{{IconSet}}/{{itemValue('ConditionIcon').replace(' ','-') | lowercase }}.png"/></td>
		<td id="weather-temp">{{'%.1f' | sprintf:itemValue('Temperature')}}</td>
		<td id="weather-temp-sign">°C</td>
	</tr>
	<tr>
		<td>
			<table id="weather-table-details">
				<tr>
					<td colspan="3">{{itemValue('Condition') }}   </td>
        </tr>
        <tr>
          <td>  Wind:   </td>
					<td>{{itemValue('WindDirection') }} /   </td>
          <td>{{'%.1f' | sprintf:itemValue('WindSpeed')}} m/s</td>
				</tr>
			</table>
		</td>
	</tr>
</table>
<p/>
<table id="weather-forecast-table">
	<tr>    
		<td>Vorhersage:</td>
		<td>Heute</td>
<div ng-init="daysnames={'Sunday': 'Sonntag', 'Monday': 'Montag', 'Tuesday': 'Dienstag', 'Wednesday': 'Mittwoch', 'Thursday': 'Donnerstag', 'Friday': 'Freitag', 'Saturday': 'Samstag'}">
  
		<td>{{daysnames[(itemValue('ObservationTime1') | date:'EEEE')]}}</td>
		<td>{{daysnames[(itemValue('ObservationTime2') | date:'EEEE')]}}</td>
</div>  
  </tr>
	<tr>
		<td/>
		<td>
			<img src="{{ServerPath}}/images/{{IconSet}}/{{itemValue('ConditionIcon0').replace(' ','-') | lowercase }}.png"/>
			<p>{{itemValue('Condition0')}}</p>
		</td>
		<td>
			<img src="{{ServerPath}}/images/{{IconSet}}/{{itemValue('ConditionIcon1').replace(' ','-') | lowercase }}.png"/>
			<p>{{itemValue('Condition1')}}</p>
		</td>
		<td>
			<img src="{{ServerPath}}/images/{{IconSet}}/{{itemValue('ConditionIcon2').replace(' ','-') | lowercase }}.png"/>
			<p>{{itemValue('Condition2')}}</p>
		</td>
	</tr>
	<tr>
		<td class="col-xs-4" style="color:red">Max</td>
		<td class="col-xs-4" style="color:red">{{'%.0f' | sprintf:itemValue('Temp_Max0')}} °C</td>
		<td class="col-xs-4" style="color:red">{{'%.0f' | sprintf:itemValue('Temp_Max1')}} °C</td>
		<td class="col-xs-4" style="color:red">{{'%.0f' | sprintf:itemValue('Temp_Max2')}} °C</td>
	</tr>
	<tr>
		<td class="col-xs-4" style="color:#0db9f0">Min</td>
		<td class="col-xs-4" style="color:#0db9f0">{{'%.0f' | sprintf:itemValue('Temp_Min0')}} °C</td>
		<td class="col-xs-4" style="color:#0db9f0">{{'%.0f' | sprintf:itemValue('Temp_Min1')}} °C</td>
		<td class="col-xs-4" style="color:#0db9f0">{{'%.0f' | sprintf:itemValue('Temp_Min2')}} °C</td>
	</tr>
</table>

it does the same thing with your code
is that it can not come from the installation of the weather

I just installed openhab2 under ubuntu and I get exactly the same thing
I really do not see or it does not work, if someone had an idea to clear the neurons if not tans worse I will try with another software of home automation
thank you

What is the current setup of .items and weather.cfg?
What version of OH2 you are using?
What version of the weather binding you are using? Do you have the weather action installed also? (Weather binding g and action are NOT compatible)
Post a current log .

You have shown all that, however it isn’t working, therefore another look is required.