OpenWeather

Einrichtung der openHAB Umgebung und allgemeine Konfigurationsthemen.

Moderatoren: seppy, udo1toni

sourex
Beiträge: 6
Registriert: 28. Feb 2019 16:31
Answers: 0

Re: OpenWeather

Beitrag von sourex »

Nach einigen Tests bin ich nun wieder ein Schritt weiter gekommen.
Aktuell sieht das ganze so aus:

Bild[/URL]
[/img]

Mein Problem ist nach wie vor das ich das ganze nicht formatieren kann was daran liegt das das Widget bei mir offensichtlich aus dem Ordner Webapps das layout lädt und nicht wie in der Anleitung beschrieben aus der html. Da nur das layout im besagten Ordner liegt kann auch nur das ändern. ? ?
Kann mir jemand verraten was ich änder muss damit das Widget aus der html lädt ??

Desweiteren frage ich mich wie ich eine dritte Zeile einfügen kann im Widget. Hatte folgendes versucht, was aber nicht geklappt hat.
<!DOCTYPE html>
<html>

<head>
<meta http-equiv="Content-type" CONTENT="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="static/weather-data/layouts/example.css" />
<script type="text/javascript" src="static/weather-data/layouts/example.js"></script>
</head>

<body id="weather-body" onload="formatIframe()">
<div id="weather-location-name">${config:name}, ${weather:condition.observationTime(%1$td.%1$tm.%1$tY %1$tH:%1$tM)}</div>

<table id="weather-table">
<tr>
<td rowspan="2"><img id="weather-icon" src="static/weather-data/images/${param:iconset}/${weather:condition.commonId}.png"/></td>
<td id="weather-temp">${weather:temperature.current(%.1f)}</td>
<td id="weather-temp-sign">°C</td>
</tr>
<tr>
<td colspan="2">
<table id="weather-table-details">
<tr>
<td>Luftfeuchtigkeit:</td>
<td>${weather:atmosphere.humidity} %</td>
</tr>
<tr>
<td>Niederschlag:</td>
<td>${weather:precipitation.probability} %</td>
</tr>
<tr>
<td>Wind:</td>
<td>${weather:wind.speed(%.1f)} km/h aus ${weather:wind.direction}</td>
</tr>
</table>
</td>
</tr>
</table>

<table id="weather-forecast-table">
<tr>
<td>Today</td>
<td>${forecast(1):condition.observationTime(%1$tA)}</td>
<td>${forecast(2):condition.observationTime(%1$tA)}</td>
<td>${forecast(3):condition.observationTime(%1$tA)}</td>
<td>${forecast(4):condition.observationTime(%1$tA)}</td>
</tr>
<tr>
<td><img src="static/weather-data/images/${param:iconset}/${forecast(0):condition.commonId}.png"/></td>
<td><img src="static/weather-data/images/${param:iconset}/${forecast(1):condition.commonId}.png"/></td>
<td><img src="static/weather-data/images/${param:iconset}/${forecast(2):condition.commonId}.png"/></td>
<td><img src="static/weather-data/images/${param:iconset}/${forecast(3):condition.commonId}.png"/></td>
<td><img src="static/weather-data/images/${param:iconset}/${forecast(4):condition.commonId}.png"/></td>
</tr>
<tr>
<td class="temp-max">${forecast(0):temperature.max(%.0f)}</td>
<td class="temp-max">${forecast(1):temperature.max(%.0f)}</td>
<td class="temp-max">${forecast(2):temperature.max(%.0f)}</td>
<td class="temp-max">${forecast(3):temperature.max(%.0f)}</td>
<td class="temp-max">${forecast(4):temperature.max(%.0f)}</td>
</tr>
<td class="temp-min">${forecast(0):temperature.min(%.0f)}</td>
<td class="temp-min">${forecast(1):temperature.min(%.0f)}</td>
<td class="temp-min">${forecast(2):temperature.min(%.0f)}</td>
<td class="temp-min">${forecast(3):temperature.min(%.0f)}</td>
<td class="temp-min">${forecast(4):temperature.min(%.0f)}</td>
</tr>
</tr>
<td class="Precip_Probability">${precipitation(0):probability.min} %</td>
<td class="Precip_Probability">${precipitation(0):probability.min} %</td>
<td class="Precip_Probability">${precipitation(0):probability.min} %</td>
<td class="Precip_Probability">${precipitation(0):probability.min} %</td>
</tr>
<tr>
<td class="Precip_Probability">${forecast(1):precipitation.probability} %</td>
</tr>
</table>

</body>

</html>

Antworten