Skip to content

Instantly share code, notes, and snippets.

@jeffehobbs
Last active July 8, 2023 16:23
Show Gist options
  • Save jeffehobbs/29659661dfcf76c42b2c606b945d2000 to your computer and use it in GitHub Desktop.
Save jeffehobbs/29659661dfcf76c42b2c606b945d2000 to your computer and use it in GitHub Desktop.
YAML configuration for WeatherKit data into Home Assistant
# Configuration for WeatherKit in Home Assistant: customize lat/long/token
rest:
- resource: https://weatherkit.apple.com/api/v1/weather/en/YOUR_LATITUDE/YOUR_LONGITUDE
headers:
Authorization: 'Bearer YOUR_TOKEN_HERE'
params:
countryCode: 'US'
dataSets: 'currentWeather,forecastDaily,forecastNextHour,forecastHourly,weatherAlerts'
timezone: 'GMT-5'
scan_interval: 60
sensor:
- name: "WeatherKit currentWeather"
json_attributes_path: "$.currentWeather"
value_template: "OK"
json_attributes:
- "asOf"
- "cloudCover"
- "conditionCode"
- "daylight"
- "humidity"
- "name"
- "precipitationIntensity"
- "pressure"
- "pressureTrend"
- "temperature"
- "temperatureApparent"
- "temperatureDewPoint"
- "uvIndex"
- "visibility"
- "windDirection"
- "windGust"
- "windSpeed"
@jeffehobbs
Copy link
Author

jeffehobbs commented Nov 27, 2022

Get your own WeatherKit API token by following the instructions here:

https://gist.github.com/jeffehobbs/1d35ac0d49b59ce75bc74f033188a6f1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment