trphoenix
2025-09-21 bef79be8779f9bb3702bd1692517ef3574234ed8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="author" content="岱特智能科技(上海)有限公司" />
      <link rel="shortcut icon" href="../../../img/favicon.ico" />
    <title>如何集成和风天气组件到HA - DT-HA</title>
    <link rel="stylesheet" href="../../../css/theme.css" />
    <link rel="stylesheet" href="../../../css/theme_extra.css" />
        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/styles/github.min.css" />
    
      <script>
        // Current page data
        var mkdocs_page_name = "\u5982\u4f55\u96c6\u6210\u548c\u98ce\u5929\u6c14\u7ec4\u4ef6\u5230HA";
        var mkdocs_page_input_path = "Usages\\QA\\\u5982\u4f55\u96c6\u6210\u548c\u98ce\u5929\u6c14\u7ec4\u4ef6\u5230HA.md";
        var mkdocs_page_url = null;
      </script>
    
    <!--[if lt IE 9]>
      <script src="../../../js/html5shiv.min.js"></script>
    <![endif]-->
      <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/highlight.min.js"></script>
      <script>hljs.highlightAll();</script> 
</head>
 
<body class="wy-body-for-nav" role="document">
 
  <div class="wy-grid-for-nav">
    <nav data-toggle="wy-nav-shift" class="wy-nav-side stickynav">
    <div class="wy-side-scroll">
      <div class="wy-side-nav-search">
          <a href="../../.." class="icon icon-home"> DT-HA
        </a><div role="search">
  <form id ="rtd-search-form" class="wy-form" action="../../../search.html" method="get">
      <input type="text" name="q" placeholder="Search docs" aria-label="Search docs" title="Type search term here" />
  </form>
</div>
      </div>
 
      <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
              <ul>
                <li class="toctree-l1"><a class="reference internal" href="../../..">首页</a>
                </li>
              </ul>
              <ul>
                <li class="toctree-l1"><a class="reference internal" href="../../../about/">关于</a>
                </li>
              </ul>
              <p class="caption"><span class="caption-text">使用教程</span></p>
              <ul class="current">
                  <li class="toctree-l1"><a class="reference internal" href="../../../install-guide/installHa/">安装</a>
                  </li>
                  <li class="toctree-l1"><a class="reference internal" >使用</a>
    <ul>
                <li class="toctree-l2"><a class="reference internal" href="../../usage/">使用概述</a>
                </li>
                <li class="toctree-l2"><a class="reference internal" href="../../netconfig/netconfig/">配置网络</a>
                </li>
                <li class="toctree-l2"><a class="reference internal" href="../../initConfig/initConfig/">系统初始化配置</a>
                </li>
    </ul>
                  </li>
                  <li class="toctree-l1 current"><a class="reference internal current" >Q/A</a>
    <ul class="current">
                <li class="toctree-l2"><a class="reference internal" href="../%E9%80%8F%E6%9E%90%E4%B8%AD%E5%BF%83HA%E7%8E%AF%E5%A2%83%E6%B8%A9%E5%BA%A6%E5%8F%91%E9%80%81%E5%88%B0%E8%83%9C%E9%80%8F%E7%9A%84%E6%93%8D%E4%BD%9C%E6%8C%87%E5%8D%97/">透析中心HA环境温度发送到胜透的操作指南</a>
                </li>
                <li class="toctree-l2"><a class="reference internal" href="../errorsQA/">errorsQA</a>
                </li>
                <li class="toctree-l2"><a class="reference internal" href="../HA-%E5%A6%82%E4%BD%95%E5%AE%9E%E7%8E%B0%E7%8A%B6%E6%80%81%E5%8F%8D%E8%BD%AC/">HA-如何实现状态反转</a>
                </li>
                <li class="toctree-l2"><a class="reference internal" href="../TS88%E9%80%8F%E6%9E%90%E6%9C%BA%E8%81%94%E6%9C%BA%E9%80%9A%E4%BF%A1-%E4%B8%AD%E6%96%87%E7%89%88/">TS88透析机联机通信-中文版</a>
                </li>
                <li class="toctree-l2"><a class="reference internal" href="../VMware-ESXi%E6%89%A9%E5%B1%95HomeAssistant%E7%A1%AC%E7%9B%98%E6%8C%87%E5%8D%97/">VMware-ESXi扩展HomeAssistant硬盘指南</a>
                </li>
                <li class="toctree-l2 current"><a class="reference internal current" href="#">如何集成和风天气组件到HA</a>
    <ul class="current">
    <li class="toctree-l3"><a class="reference internal" href="#_1">和风天气简介</a>
    </li>
    <li class="toctree-l3"><a class="reference internal" href="#_2">集成步骤</a>
    </li>
    <li class="toctree-l3"><a class="reference internal" href="#_3">示例</a>
        <ul>
    <li class="toctree-l4"><a class="reference internal" href="#_4">配置参考</a>
    </li>
        </ul>
    </li>
    </ul>
                </li>
                <li class="toctree-l2"><a class="reference internal" href="../%E5%A6%82%E5%8E%95%E9%A3%8E%E9%99%A9-%E4%BA%BA%E5%AD%98%E5%9C%A8%E4%BC%A0%E6%84%9F%E5%99%A8%E9%85%8D%E7%BD%AE%E6%96%B9%E6%B3%95/">如厕风险-人存在传感器配置方法</a>
                </li>
                <li class="toctree-l2"><a class="reference internal" href="../ubunte-desktop%E6%A1%8C%E9%9D%A2%E7%B3%BB%E7%BB%9F%E5%A6%82%E4%BD%95%E9%85%8D%E7%BD%AE%E5%BC%80%E5%90%AF%E8%BF%9C%E7%A8%8B%E5%8D%8F%E5%8A%A9/">Ubuntu-desktop桌面系统如何配置开启远程协助</a>
                </li>
                <li class="toctree-l2"><a class="reference internal" href="../%E5%A6%82%E4%BD%95%E7%A6%BB%E7%BA%BF%E5%AE%89%E8%A3%85Docker%28ubunt24.04%29/">如何离线安装Docker(ubuntu24.04)</a>
                </li>
                <li class="toctree-l2"><a class="reference internal" href="../%E5%A6%82%E4%BD%95%E5%9C%A8%E7%BA%BFDocker%E4%B8%80%E9%94%AE%E5%AE%89%E8%A3%85%E8%A3%85HomeAssistant/">如何在线Docker一键安装HomeAssistant</a>
                </li>
                <li class="toctree-l2"><a class="reference internal" href="../%E5%A6%82%E4%BD%95%E7%A6%BB%E7%BA%BFDocker%E4%B8%80%E9%94%AE%E5%AE%89%E8%A3%85HomeAssistant/">如何离线Docker一键安装HomeAssistant</a>
                </li>
                <li class="toctree-l2"><a class="reference internal" href="../%E5%9F%BA%E4%BA%8EDocker%E7%9A%84%E6%96%B9%E5%BC%8F%E5%AE%89%E8%A3%85HomeAssistant/">基于Docker的方式安装HomeAssistant</a>
                </li>
                <li class="toctree-l2"><a class="reference internal" href="../%E5%A6%82%E4%BD%95%E5%BF%AB%E9%80%9F%E9%83%A8%E7%BD%B2frpc%E6%9C%8D%E5%8A%A1/">如何快速部署frpc服务</a>
                </li>
                <li class="toctree-l2"><a class="reference internal" href="../windows%E4%B8%8D%E8%83%BD%E8%AE%BF%E9%97%AEHA%E7%9A%84%E5%85%B1%E4%BA%AB%E9%85%8D%E7%BD%AE%E7%9B%AE%E5%BD%95%E7%9A%84%E8%A7%A3%E5%86%B3%E5%8A%9E%E6%B3%95/">windows不能访问HA的共享配置目录的解决办法</a>
                </li>
                <li class="toctree-l2"><a class="reference internal" href="../%E8%AF%AD%E9%9F%B3%E5%90%88%E6%88%90%E4%B8%8E%E8%AF%86%E5%88%AB%E6%9C%8D%E5%8A%A1Docker-%E9%83%A8%E7%BD%B2%E8%AF%B4%E6%98%8E/">语音合成与识别服务Docker-部署说明</a>
                </li>
    </ul>
                  </li>
              </ul>
              <p class="caption"><span class="caption-text">其它教程</span></p>
              <ul>
                  <li class="toctree-l1"><a class="reference internal" >Node-red相关</a>
    <ul>
                <li class="toctree-l2"><a class="reference internal" href="../../../node-reds/%E5%AE%89%E8%A3%85node-red%E8%AE%B0%E5%BD%95/">安装node-red记录</a>
                </li>
                <li class="toctree-l2"><a class="reference internal" href="../../../node-reds/%E5%A6%82%E4%BD%95%E6%8A%8Anode-red%E5%AE%89%E8%A3%85%E5%88%B0orangepiZero3/">如何把node-red安装到orangepiZero</a>
                </li>
                <li class="toctree-l2"><a class="reference internal" href="../../../node-reds/ModbusPoll-v7.0.0%E4%BD%BF%E7%94%A8%E6%95%99%E7%A8%8B/">ModbusPoll-v7.0.0使用教程</a>
                </li>
                <li class="toctree-l2"><a class="reference internal" href="../../../node-reds/node-red%E5%B8%B8%E7%94%A8%E7%BB%84%E4%BB%B6%E5%88%97%E8%A1%A8/">node-red常用组件列表</a>
                </li>
                <li class="toctree-l2"><a class="reference internal" href="../../../node-reds/node-red%E5%A6%82%E4%BD%95%E8%BF%9E%E6%8E%A5modbus%20_slave%E8%AE%BE%E5%A4%87/">node-red如何连接modbus _slave设备</a>
                </li>
    </ul>
                  </li>
              </ul>
      </div>
    </div>
    </nav>
 
    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
      <nav class="wy-nav-top" role="navigation" aria-label="Mobile navigation menu">
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../../..">DT-HA</a>
        
      </nav>
      <div class="wy-nav-content">
        <div class="rst-content"><div role="navigation" aria-label="breadcrumbs navigation">
  <ul class="wy-breadcrumbs">
    <li><a href="../../.." class="icon icon-home" aria-label="Docs"></a></li>
          <li class="breadcrumb-item">使用教程</li>
          <li class="breadcrumb-item">Q/A</li>
      <li class="breadcrumb-item active">如何集成和风天气组件到HA</li>
    <li class="wy-breadcrumbs-aside">
    </li>
  </ul>
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
            <div class="section" itemprop="articleBody">
              
                <h2 id="ha">如何集成和风天气组件到HA<a class="headerlink" href="#ha" title="Permanent link">&para;</a></h2>
<h3 id="_1">和风天气简介<a class="headerlink" href="#_1" title="Permanent link">&para;</a></h3>
<p>和风天气是一个提供天气信息的API,可以方便地集成到Home Assistant中。</p>
<h3 id="_2">集成步骤<a class="headerlink" href="#_2" title="Permanent link">&para;</a></h3>
<ol>
<li>在Home Assistant中安装和风天气组件。</li>
<li>配置和风天气API密钥。</li>
<li>在自动化中使用和风天气提供的天气数据。</li>
</ol>
<h3 id="_3">示例<a class="headerlink" href="#_3" title="Permanent link">&para;</a></h3>
<p>登录和风天气控制台,https://console.qweather.com/project?lang=zh
如下图所示,先为此中心创建一个项目,为的是为每个中心使用的api调用次数的统计
<img alt="" src="https://qncdn.tairongkj.com/docs/images/20250815110408.png" /></p>
<p><img alt="" src="https://qncdn.tairongkj.com/docs/images/20250815110451.png" />
记录下来相关信息</p>
<div class="codehilite"><pre><span></span><code>项目名称:湖南旺旺
项目ID:2HKR2MC5WM
API-KEY:885d8b06871b445fbc1beb2eda11cd6c
开发者ID:Q137B51456
API-Host:nd4up3fy3t.re.qweatherapi.com
查询城市区域代码的的址:
git clone https://github.com/qwd/LocationList.git.com/docs/api/geoapi/
</code></pre></div>
 
<h4 id="_4">配置参考<a class="headerlink" href="#_4" title="Permanent link">&para;</a></h4>
<p>打开的配置文件 <code>configuration.yaml</code>,添加以下内容:</p>
<div class="codehilite"><pre><span></span><code>weather:
  - platform: heweather
    location: 101210301        # 你的区域代码城市id
    host: nd4up3fy3t.re.qweatherapi.com  # API Host
    key: 885d8b06871b445fbc1beb2eda11cd6c                 # 你的API KEY
</code></pre></div>
 
<p>其中,要更换的内容主要有,区域代码城市id、API Host和API KEY。
如下图
<img alt="" src="https://qncdn.tairongkj.com/docs/images/20250815110802.png" /></p>
<h5 id="id">获取城市id区域代码的方法<a class="headerlink" href="#id" title="Permanent link">&para;</a></h5>
<p>这里一定要配对正确的城市id区域代码,否则会报的天气不准。
可以通过此文档提供的API,查询   https://github.com/qwd/LocationList.git.com/docs/api/geoapi/</p>
<p>其中:</p>
<ul>
<li>
<p>X-QW-Api-Key 为你的API密钥。</p>
</li>
<li>
<p>location 为你要查询的城市名称拼音.</p>
</li>
</ul>
<div class="codehilite"><pre><span></span><code>curl -H &quot;X-QW-Api-Key: 885d8b06871b445fbc1beb2eda11cd6c&quot; --compressed \
&#39;https://nd4up3fy3t.re.qweatherapi.com/geo/v2/city/lookup?location=changsha&#39;   
</code></pre></div>
 
<p>如下图所示
<img alt="" src="https://qncdn.tairongkj.com/docs/images/20250815111350.png" /></p>
              
            </div>
          </div><footer>
    <div class="rst-footer-buttons" role="navigation" aria-label="Footer Navigation">
        <a href="../VMware-ESXi%E6%89%A9%E5%B1%95HomeAssistant%E7%A1%AC%E7%9B%98%E6%8C%87%E5%8D%97/" class="btn btn-neutral float-left" title="VMware-ESXi扩展HomeAssistant硬盘指南"><span class="icon icon-circle-arrow-left"></span> Previous</a>
        <a href="../%E5%A6%82%E5%8E%95%E9%A3%8E%E9%99%A9-%E4%BA%BA%E5%AD%98%E5%9C%A8%E4%BC%A0%E6%84%9F%E5%99%A8%E9%85%8D%E7%BD%AE%E6%96%B9%E6%B3%95/" class="btn btn-neutral float-right" title="如厕风险-人存在传感器配置方法">Next <span class="icon icon-circle-arrow-right"></span></a>
    </div>
 
  <hr/>
 
  <div role="contentinfo">
    <!-- Copyright etc -->
  </div>
 
  Built with <a href="https://www.mkdocs.org/">MkDocs</a> using a <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
          
        </div>
      </div>
 
    </section>
 
  </div>
 
  <div class="rst-versions" role="note" aria-label="Versions">
  <span class="rst-current-version" data-toggle="rst-current-version">
    
        <span>
          <a href="http://dh.leon056.com:7499/r/Embedded/HomeAssistantPtoject.git" class="fa fa-code-fork" style="color: #fcfcfc"> Dh</a>
        </span>
    
    
      <span><a href="../VMware-ESXi%E6%89%A9%E5%B1%95HomeAssistant%E7%A1%AC%E7%9B%98%E6%8C%87%E5%8D%97/" style="color: #fcfcfc">&laquo; Previous</a></span>
    
    
      <span><a href="../%E5%A6%82%E5%8E%95%E9%A3%8E%E9%99%A9-%E4%BA%BA%E5%AD%98%E5%9C%A8%E4%BC%A0%E6%84%9F%E5%99%A8%E9%85%8D%E7%BD%AE%E6%96%B9%E6%B3%95/" style="color: #fcfcfc">Next &raquo;</a></span>
    
  </span>
</div>
    <script src="../../../js/jquery-3.6.0.min.js"></script>
    <script>var base_url = "../../..";</script>
    <script src="../../../js/theme_extra.js"></script>
    <script src="../../../js/theme.js"></script>
      <script src="../../../search/main.js"></script>
    <script>
        jQuery(function () {
            SphinxRtdTheme.Navigation.enable(true);
        });
    </script>
 
</body>
</html>