Apple WeatherKit
The Apple WeatherKit integration集成将 Home Assistant 与您的设备、服务等连接和集成。 [Learn more] obtains current weather and forecasts (hourly and daily) from Apple Weather. It is the most direct replacement for those coming from the Dark Sky API since Apple bought Dark Sky and implemented its technology into their weather service.
There is currently support for the following device types within Home Assistant:
- Weather
- Sensor
Requirements
You will need a paid Apple Developer Program account
配置
要将 Apple WeatherKit integration 添加到您的 Home Assistant 实例中,请使用此 My 按钮:
手动配置步骤
如果上述 My 按钮不起作用,您也可以手动执行以下步骤:
-
浏览到您的 Home Assistant 实例。
-
转到
设置 > 设备与服务。 -
在右下角,选择
Add Integration 按钮。 -
从列表中选择 Apple WeatherKit。
-
按照屏幕上的说明完成设置。
Credentials
You will need to obtain the appropriate credentials which you will use to connect to Apple WeatherKit. We need to register a few things in your Apple Developer account:
- Go to Certificates, Identifiers & Profiles
in your Apple Developer account. - In the Keys
section, add a new key. - Name it whatever you want.
- Select “WeatherKit” from the list.
- Download the
.p8
file provided. This is your Private Key. - Write down the Key ID. You will need it later.
- In the Identifiers
section, add a new identifier. - Select “Services IDs” from the drop-down in the top-right.
- Enter whatever you’d like for the description.
- For the identifier, Apple recommends using a reverse-DNS style name, like
com.example.homeassistant
. - Save the identifier you used. This is your Service ID.
You can add a new WeatherKit integration集成将 Home Assistant 与您的设备、服务等连接和集成。 [Learn more] entry now that you have all the credentials. Using the details from earlier, it should look something like this:
-
Key ID:
ABC123DEFG
-
Service ID:
com.example.homeassistant
-
Apple team ID:
ABC123DEFG
- This value can be found in the top-right of the Apple Developer website.
-
Private key:
-----BEGIN PRIVATE KEY----- [...]
- Open the
.p8
file you downloaded earlier in a text editor and copy the entire contents into this field, including the header and footer.
- Open the
Troubleshooting
If you are having issues setting up the integration集成将 Home Assistant 与您的设备、服务等连接和集成。 [Learn more], please make sure the following are true:
- You are entering the key exactly as it appears in the
.p8
file, including the header and footer. - There are no leading or trailing spaces in other configuration values.