feat: add glance weather tile from home assistant
custom-api Wetterkachel zieht die Ecowitt-Sensoren live aus HA (intern http://homeassistant:8123, frontend_net) im Neon-Ops-Stil. Boeen > 40 km/h werden rot markiert (analog HA-Warnautomation). Benoetigt GLANCE_HA_TOKEN als Glance-Stack-ENV. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -106,6 +106,92 @@
|
|||||||
- timezone: UTC
|
- timezone: UTC
|
||||||
label: UTC
|
label: UTC
|
||||||
|
|
||||||
|
- type: custom-api
|
||||||
|
title: Wetter · KalliHome
|
||||||
|
title-url: https://home.kaleschke.info
|
||||||
|
cache: 30s
|
||||||
|
url: http://homeassistant:8123/api/states/sensor.gw3000a_outdoor_temperature
|
||||||
|
headers:
|
||||||
|
Authorization: Bearer ${GLANCE_HA_TOKEN}
|
||||||
|
Content-Type: application/json
|
||||||
|
subrequests:
|
||||||
|
feels:
|
||||||
|
url: http://homeassistant:8123/api/states/sensor.gw3000a_feels_like_temperature
|
||||||
|
headers:
|
||||||
|
Authorization: Bearer ${GLANCE_HA_TOKEN}
|
||||||
|
humidity:
|
||||||
|
url: http://homeassistant:8123/api/states/sensor.gw3000a_humidity
|
||||||
|
headers:
|
||||||
|
Authorization: Bearer ${GLANCE_HA_TOKEN}
|
||||||
|
wind:
|
||||||
|
url: http://homeassistant:8123/api/states/sensor.gw3000a_wind_speed
|
||||||
|
headers:
|
||||||
|
Authorization: Bearer ${GLANCE_HA_TOKEN}
|
||||||
|
gust:
|
||||||
|
url: http://homeassistant:8123/api/states/sensor.gw3000a_wind_gust
|
||||||
|
headers:
|
||||||
|
Authorization: Bearer ${GLANCE_HA_TOKEN}
|
||||||
|
rain:
|
||||||
|
url: http://homeassistant:8123/api/states/sensor.gw3000a_daily_rain
|
||||||
|
headers:
|
||||||
|
Authorization: Bearer ${GLANCE_HA_TOKEN}
|
||||||
|
solar:
|
||||||
|
url: http://homeassistant:8123/api/states/sensor.gw3000a_solar_radiation
|
||||||
|
headers:
|
||||||
|
Authorization: Bearer ${GLANCE_HA_TOKEN}
|
||||||
|
uv:
|
||||||
|
url: http://homeassistant:8123/api/states/sensor.gw3000a_uv_index
|
||||||
|
headers:
|
||||||
|
Authorization: Bearer ${GLANCE_HA_TOKEN}
|
||||||
|
pressure:
|
||||||
|
url: http://homeassistant:8123/api/states/sensor.gw3000a_relative_pressure
|
||||||
|
headers:
|
||||||
|
Authorization: Bearer ${GLANCE_HA_TOKEN}
|
||||||
|
template: |
|
||||||
|
{{ $temp := .JSON.String "state" }}
|
||||||
|
{{ $feels := (.Subrequest "feels").JSON.String "state" }}
|
||||||
|
{{ $hum := (.Subrequest "humidity").JSON.String "state" }}
|
||||||
|
{{ $wind := (.Subrequest "wind").JSON.String "state" }}
|
||||||
|
{{ $gust := (.Subrequest "gust").JSON.String "state" }}
|
||||||
|
{{ $rain := (.Subrequest "rain").JSON.String "state" }}
|
||||||
|
{{ $solar := (.Subrequest "solar").JSON.String "state" }}
|
||||||
|
{{ $uv := (.Subrequest "uv").JSON.String "state" }}
|
||||||
|
{{ $press := (.Subrequest "pressure").JSON.String "state" }}
|
||||||
|
{{ $gustF := toFloat $gust }}
|
||||||
|
{{ $divider := "border-left: 1px solid hsla(220, 40%, 70%, 0.14);" }}
|
||||||
|
<div class="text-center" style="margin-bottom: 12px;">
|
||||||
|
<div class="color-highlight size-h2" style="font-weight: 700;">{{ $temp }}°C</div>
|
||||||
|
<div class="size-h6 color-subdue">gefühlt {{ $feels }}° · {{ $hum }}% feucht</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex justify-between text-center" style="margin-bottom: 12px;">
|
||||||
|
<div style="flex: 1;">
|
||||||
|
<div class="size-h4 {{ if gt $gustF 40.0 }}color-negative{{ else }}color-highlight{{ end }}">{{ $wind }}</div>
|
||||||
|
<div class="size-h6 uppercase color-subdue">km/h Wind</div>
|
||||||
|
</div>
|
||||||
|
<div style="flex: 1; {{ $divider }}">
|
||||||
|
<div class="size-h4 {{ if gt $gustF 40.0 }}color-negative{{ else }}color-highlight{{ end }}">{{ $gust }}</div>
|
||||||
|
<div class="size-h6 uppercase color-subdue">km/h Böe</div>
|
||||||
|
</div>
|
||||||
|
<div style="flex: 1; {{ $divider }}">
|
||||||
|
<div class="size-h4 color-highlight">{{ $rain }}</div>
|
||||||
|
<div class="size-h6 uppercase color-subdue">mm heute</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex justify-between text-center">
|
||||||
|
<div style="flex: 1;">
|
||||||
|
<div class="size-h4 color-highlight">{{ $solar }}</div>
|
||||||
|
<div class="size-h6 uppercase color-subdue">W/m² Solar</div>
|
||||||
|
</div>
|
||||||
|
<div style="flex: 1; {{ $divider }}">
|
||||||
|
<div class="size-h4 color-highlight">{{ $uv }}</div>
|
||||||
|
<div class="size-h6 uppercase color-subdue">UV-Index</div>
|
||||||
|
</div>
|
||||||
|
<div style="flex: 1; {{ $divider }}">
|
||||||
|
<div class="size-h4 color-highlight">{{ $press }}</div>
|
||||||
|
<div class="size-h6 uppercase color-subdue">hPa Druck</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
- type: weather
|
- type: weather
|
||||||
location: Berlin, Germany
|
location: Berlin, Germany
|
||||||
units: metric
|
units: metric
|
||||||
|
|||||||
Reference in New Issue
Block a user