fetch_weather_now #1

Open
opened 2025-10-19 22:56:48 +08:00 by abearxiong · 1 comment
Owner
rest_command:
  fetch_weather_now:
    url: https://n65khufe5n.re.qweatherapi.com/v7/weather/now?location=101210113
    method: GET
    headers:
      X-QW-Api-Key: "fdad5aeb2ba54949a8a1df2a0f3d1efb"
      Content-Type: "application/json"
    
``` rest_command: fetch_weather_now: url: https://n65khufe5n.re.qweatherapi.com/v7/weather/now?location=101210113 method: GET headers: X-QW-Api-Key: "fdad5aeb2ba54949a8a1df2a0f3d1efb" Content-Type: "application/json" ```
Author
Owner
refresh_weather_data:
  alias: "刷新天气数据"
  description: "手动调用和风天气 API(仅触发,不保存结果)"
  mode: single

  sequence:
    - service: rest_command.fetch_weather_now
      response_variable: weather_response  # 接收返回的 JSON 响应

    - service: system_log.write
      data:
        message: "【天气】已手动请求和风天气实况数据 {{ weather_response }}"
        level: info
        logger: custom.weather
``` refresh_weather_data: alias: "刷新天气数据" description: "手动调用和风天气 API(仅触发,不保存结果)" mode: single sequence: - service: rest_command.fetch_weather_now response_variable: weather_response # 接收返回的 JSON 响应 - service: system_log.write data: message: "【天气】已手动请求和风天气实况数据 {{ weather_response }}" level: info logger: custom.weather ```
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: me/homeassistant#1
No description provided.