mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-11-28 04:59:52 +01:00
2.4 KiB
2.4 KiB
Weather Plugin Usage Guide
Overview
The get_weather weather plugin is a core feature of Xiaozhi's ESP32 voice assistant, allowing you to query weather information for locations across the country via voice. Based on the Hefeng Weather API, the plugin provides real-time weather and a 7-day forecast.
API Key Application Guide
1. Register a Hefeng Weather account
- Visit the QWeather console
- Register an account and complete email verification
- Log in to the console
2. Create an application and obtain an API Key
- After entering the console, click "Project Management" on the right → "Create Project"
- Fill in the project information:
- Project Name: such as "Xiaozhi Voice Assistant"
- Click Save
- After the project is created, click "Create Credentials" in the project
- Fill in the credentials:
- Credential Name: such as "Xiaozhi Voice Assistant"
- Authentication method: Select "API Key"
- Click Save
- Copy the
API Keyin the credentials, which is the first key configuration information
3. Get the API Host
- In the console, click "Settings" → "API Host"
- Check the dedicated
API Hostaddress assigned to you. This is the second key configuration information.
The above operation will get two important configuration information: API Key and API Host
Configuration method (choose one)
Method 1. If you use the Smart Console deployment (recommended)
- Log in to the smart console
- Enter the "Role Configuration" page
- Select the agent to configure
- Click the "Edit Function" button
- Find the "Weather Query" plug-in in the parameter configuration area on the right
- Check "Weather Query"
- Fill in the copied first key configuration
API Keyinto theWeather Plugin API Key - Fill in the copied second key configuration
API HostintoDeveloper API Host - Save the configuration, then save the agent configuration
Method 2. If you only deploy a single module xiaozhi-server
Configure in data/.config.yaml:
- Fill in the copied first key configuration
API Keyintoapi_key - Fill in the copied second key configuration
API Hostintoapi_host - Fill in your city in
default_location, for example,Guangzhou
plugins:
get_weather:
api_key: "Your Zephyr Weather API key"
api_host: "Your Zefeng Weather API host address"
default_location: "Your default query city"