{"id":86008,"date":"2026-07-28T01:58:09","date_gmt":"2026-07-27T17:58:09","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/86008.html"},"modified":"2026-07-28T01:58:09","modified_gmt":"2026-07-27T17:58:09","slug":"home-assistant%ef%bc%88ha%ef%bc%89-mqtt-%e8%87%aa%e5%ae%9a%e4%b9%89%e6%9c%8d%e5%8a%a1%e5%99%a8-%e7%9a%84%e5%85%b8%e5%9e%8b%e8%ae%be%e5%a4%87%e6%8e%a5%e5%85%a5%e6%96%b9%e5%bc%8f%ef%bc%8c%e6%80%bb","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/86008.html","title":{"rendered":"Home Assistant\uff08HA\uff09+ MQTT \u81ea\u5b9a\u4e49\u670d\u52a1\u5668 \u7684\u5178\u578b\u8bbe\u5907\u63a5\u5165\u65b9\u5f0f\uff0c\u603b\u7ed3 \u9700\u8981\u4e0a\u62a5\uff08Publish\uff09 \u4e0e \u9700\u8981\u8ba2\u9605\uff08Subscribe\uff09 \u7684\u4e3b\u9898\uff0c\u4ee5\u53ca\u5e38\u89c1\u5b57\u6bb5\u5185\u5bb9\u3002"},"content":{"rendered":"<p>\u4e0b\u9762\u6309 Home Assistant&#xff08;HA&#xff09;&#043; MQTT \u81ea\u5b9a\u4e49\u670d\u52a1\u5668 \u7684\u5178\u578b\u8bbe\u5907\u63a5\u5165\u65b9\u5f0f&#xff0c;\u603b\u7ed3 \u9700\u8981\u4e0a\u62a5&#xff08;Publish&#xff09; \u4e0e \u9700\u8981\u8ba2\u9605&#xff08;Subscribe&#xff09; \u7684\u4e3b\u9898&#xff0c;\u4ee5\u53ca\u5e38\u89c1\u5b57\u6bb5\u5185\u5bb9\u3002<\/p>\n<hr \/>\n<h2>\u2705 \u4e00\u3001MQTT \u8bbe\u5907\u63a5\u5165 Home Assistant \u7684\u4e24\u79cd\u65b9\u5f0f<\/h2>\n<p>Home Assistant \u652f\u6301\u4e24\u79cd MQTT \u8bbe\u5907\u6a21\u5f0f&#xff1a;<\/p>\n<h3>\u65b9\u5f0f A&#xff1a;\u4f7f\u7528 MQTT Discovery&#xff08;\u63a8\u8350&#xff09;<\/h3>\n<p>\u8bbe\u5907\u81ea\u52a8\u88ab HA \u53d1\u73b0&#xff0c;\u65e0\u9700\u624b\u52a8\u914d\u7f6e\u3002<\/p>\n<h3>\u65b9\u5f0f B&#xff1a;\u624b\u52a8\u914d\u7f6e\u5b9e\u4f53&#xff08;\u4e0d\u63a8\u8350&#xff09;<\/h3>\n<p>\u9700\u8981\u7528\u6237\u5728 configuration.yaml \u5199\u914d\u7f6e\u3002<\/p>\n<p>\u4e0b\u9762\u4e3b\u8981\u8bb2\u65b9\u5f0f A&#xff08;MQTT Discovery&#xff09;&#xff0c;\u4e5f\u662f\u4f60\u4f7f\u7528\u81ea\u5b9a\u4e49 MQTT \u670d\u52a1\u5668\u65f6\u6700\u5e38\u7528\u7684\u3002<\/p>\n<hr \/>\n<h2>\u2705 \u4e8c\u3001MQTT Discovery \u4e3b\u9898\u7ed3\u6784&#xff08;\u91cd\u8981&#xff09;<\/h2>\n<p>Home Assistant \u7684\u81ea\u52a8\u53d1\u73b0\u4e3b\u9898\u683c\u5f0f\u4e3a&#xff1a;<\/p>\n<p>homeassistant\/&lt;component&gt;\/&lt;object_id&gt;\/config<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>homeassistant\/sensor\/temp_sensor\/config<br \/>\nhomeassistant\/light\/desk_light\/config<\/p>\n<p>\u5f53\u8bbe\u5907\u53d1\u5e03 config \u6d88\u606f\u540e&#xff0c;HA \u4f1a\u81ea\u52a8\u521b\u5efa\u5b9e\u4f53\u3002<\/p>\n<hr \/>\n<h2>\u2705 \u4e09\u3001\u8bbe\u5907\u9700\u8981&#xff1a;\u53d1\u5e03&#xff08;Publish&#xff09;\u7684\u4e3b\u9898<\/h2>\n<p>\u4e0b\u8868\u603b\u7ed3\u4e00\u4e2a\u5178\u578b\u8bbe\u5907\u63a5\u5165 HA&#xff08;\u4f7f\u7528 MQTT Discovery&#xff09;\u9700\u8981\u7684\u4e0a\u62a5\u4e3b\u9898\u3002<\/p>\n<hr \/>\n<h3>\u2b50 1. \u8bbe\u5907\u201c\u914d\u7f6e\u201d\u4e3b\u9898&#xff08;\u5fc5\u987b&#xff09;<\/h3>\n<p>\u8bbe\u5907\u542f\u52a8\u65f6\u5411 HA \u53d1\u5e03\u4e00\u4e2a \u201c\u914d\u7f6e\u6d88\u606f\u201d&#xff0c;\u7528\u6765\u544a\u8bc9 HA \u5982\u4f55\u521b\u5efa\u5b9e\u4f53\u3002<\/p>\n<p>\u4f8b&#xff1a;\u4e00\u4e2a\u6e29\u5ea6\u4f20\u611f\u5668&#xff1a;<\/p>\n<p>\u4e3b\u9898&#xff1a;<\/p>\n<p>homeassistant\/sensor\/room_temperature\/config<\/p>\n<p>\u6d88\u606f\u5185\u5bb9(JSON)&#xff1a;<\/p>\n<p>{<br \/>\n  &#034;name&#034;: &#034;Room Temperature&#034;,<br \/>\n  &#034;uniq_id&#034;: &#034;dev123_temp&#034;,<br \/>\n  &#034;stat_t&#034;: &#034;mydevice\/room\/temperature&#034;,<br \/>\n  &#034;unit_of_meas&#034;: &#034;\u00b0C&#034;,<br \/>\n  &#034;dev_cla&#034;: &#034;temperature&#034;,<br \/>\n  &#034;val_tpl&#034;: &#034;{{ value_json.temperature }}&#034;,<br \/>\n  &#034;device&#034;: {<br \/>\n    &#034;ids&#034;: [&#034;dev123&#034;],<br \/>\n    &#034;name&#034;: &#034;My Device&#034;,<br \/>\n    &#034;mf&#034;: &#034;YourCompany&#034;,<br \/>\n    &#034;mdl&#034;: &#034;ESP32&#034;<br \/>\n  }<br \/>\n}<\/p>\n<p>\u26a0\ufe0f HA \u53ea\u6709\u5728\u6536\u5230 config \u4e4b\u540e\u624d\u4f1a\u663e\u793a\u5b9e\u4f53&#xff01;<\/p>\n<hr \/>\n<h3>\u2b50 2. \u72b6\u6001\u4e0a\u62a5\u4e3b\u9898&#xff08;stat_t&#xff09;<\/h3>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>mydevice\/room\/temperature<\/p>\n<p>\u6d88\u606f&#xff1a;<\/p>\n<p>{<br \/>\n  &#034;temperature&#034;: 25.3<br \/>\n}<\/p>\n<p>\u72b6\u6001\u4e3b\u9898\u683c\u5f0f\u5b8c\u5168\u53ef\u81ea\u5b9a\u4e49&#xff0c;\u53ea\u8981\u5728 config \u91cc\u58f0\u660e\u5373\u53ef\u3002<\/p>\n<hr \/>\n<h3>\u2b50 3. \u53ef\u9009&#xff1a;\u8bbe\u5907\u72b6\u6001&#xff08;online\/offline&#xff09;<\/h3>\n<p>\u4e3b\u9898&#xff08;\u56fa\u5b9a\u7ea6\u5b9a&#xff09;&#xff1a;<\/p>\n<p>mydevice\/status<\/p>\n<p>payload&#xff1a;<\/p>\n<p>online<\/p>\n<p>\u6216<\/p>\n<p>offline<\/p>\n<hr \/>\n<h2>\u2705 \u56db\u3001\u8bbe\u5907\u9700\u8981&#xff1a;\u8ba2\u9605&#xff08;Subscribe&#xff09;\u7684\u4e3b\u9898<\/h2>\n<p>\u5982\u679c\u4f60\u7684\u8bbe\u5907\u662f\u201c\u53ef\u63a7\u8bbe\u5907\u201d&#xff08;\u5982 light\u3001switch&#xff09;&#xff0c;\u5c31\u5fc5\u987b\u8ba2\u9605 HA \u4e0b\u53d1\u7684\u63a7\u5236\u6307\u4ee4\u3002<\/p>\n<p>\u5e38\u89c1\u7ed3\u6784\u5982\u4e0b&#xff1a;<\/p>\n<hr \/>\n<h3>\u2b50 1. \u63a7\u5236\u4e3b\u9898&#xff08;cmd_t&#xff09;<\/h3>\n<p>\u4f8b\u5982\u4e00\u4e2a\u706f&#xff1a;<\/p>\n<p>\u8bbe\u5907\u5728 config \u4e2d\u7ea6\u5b9a&#xff1a;<\/p>\n<p>{<br \/>\n  &#034;cmd_t&#034;: &#034;mydevice\/light\/desk\/set&#034;,<br \/>\n  &#034;stat_t&#034;: &#034;mydevice\/light\/desk\/state&#034;<br \/>\n}<\/p>\n<p>\u90a3\u4e48\u8bbe\u5907\u9700\u8981\u8ba2\u9605&#xff1a;<\/p>\n<p>mydevice\/light\/desk\/set<\/p>\n<p>HA \u4f1a\u53d1\u5e03 payload&#xff0c;\u4f8b\u5982&#xff1a;<\/p>\n<h4>\u5f00\u706f<\/h4>\n<p>ON<\/p>\n<h4>\u5173\u706f<\/h4>\n<p>OFF<\/p>\n<p>\u5bf9\u4e8e\u8c03\u5149\u706f&#xff1a;<\/p>\n<p>{&#034;state&#034;: &#034;ON&#034;, &#034;brightness&#034;: 180}<\/p>\n<hr \/>\n<h2>\u2705 \u4e94\u3001\u603b\u7ed3&#xff1a;\u5e38\u7528\u7ec4\u4ef6\u7684\u8ba2\u9605\/\u53d1\u5e03\u4e3b\u9898\u6e05\u5355<\/h2>\n<hr \/>\n<h3>### &#x1f7e6; 1. Sensor&#xff08;\u4f20\u611f\u5668&#xff09;<\/h3>\n<p>&#x1f4cc; \u8bbe\u5907\u53d1\u5e03&#xff1a;<\/p>\n<table>\n<tr>\u7c7b\u578b\u4e3b\u9898\u5185\u5bb9<\/tr>\n<tbody>\n<tr>\n<td>\u914d\u7f6e<\/td>\n<td>homeassistant\/sensor\/&lt;id&gt;\/config<\/td>\n<td>JSON<\/td>\n<\/tr>\n<tr>\n<td>\u72b6\u6001<\/td>\n<td>mydevice\/&lt;id&gt;\/state<\/td>\n<td>JSON<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&#x1f4cc; \u8bbe\u5907\u8ba2\u9605&#xff1a;<\/p>\n<p>\u65e0&#xff08;Sensor \u4e0d\u53ef\u63a7&#xff09;<\/p>\n<hr \/>\n<h3>### &#x1f7e6; 2. Binary Sensor&#xff08;\u5f00\u5173\u91cf\u4f20\u611f\u5668&#xff09;<\/h3>\n<p>&#x1f4cc; \u53d1\u5e03&#xff1a;<\/p>\n<p>homeassistant\/binary_sensor\/&lt;id&gt;\/config<br \/>\nmydevice\/&lt;id&gt;\/state<\/p>\n<p>payload:<\/p>\n<p>ON \u6216 OFF<\/p>\n<hr \/>\n<h3>### &#x1f7e6; 3. Switch&#xff08;\u5f00\u5173\u8bbe\u5907&#xff09;<\/h3>\n<p>&#x1f4cc; \u53d1\u5e03&#xff1a;<\/p>\n<p>homeassistant\/switch\/&lt;id&gt;\/config<br \/>\nmydevice\/&lt;id&gt;\/state<\/p>\n<p>&#x1f4cc; \u8ba2\u9605&#xff1a;<\/p>\n<p>mydevice\/&lt;id&gt;\/set<\/p>\n<hr \/>\n<h3>### &#x1f7e6; 4. Light&#xff08;\u706f&#xff09;<\/h3>\n<p>&#x1f4cc; \u53d1\u5e03&#xff1a;<\/p>\n<p>homeassistant\/light\/&lt;id&gt;\/config<br \/>\nmydevice\/light\/&lt;id&gt;\/state<\/p>\n<p>&#x1f4cc; \u8ba2\u9605&#xff1a;<\/p>\n<p>mydevice\/light\/&lt;id&gt;\/set<\/p>\n<p>payload \u793a\u4f8b&#xff1a;<\/p>\n<p>{&#034;state&#034;:&#034;ON&#034;,&#034;brightness&#034;:128}<\/p>\n<hr \/>\n<h3>### &#x1f7e6; 5. Cover&#xff08;\u7a97\u5e18\u3001\u7535\u52a8\u95e8&#xff09;<\/h3>\n<p>&#x1f4cc; \u53d1\u5e03&#xff1a;<\/p>\n<p>homeassistant\/cover\/&lt;id&gt;\/config<br \/>\nmydevice\/cover\/&lt;id&gt;\/state<\/p>\n<p>&#x1f4cc; \u8ba2\u9605&#xff1a;<\/p>\n<p>mydevice\/cover\/&lt;id&gt;\/set<\/p>\n<p>payload:<\/p>\n<p>OPEN \/ CLOSE \/ STOP<\/p>\n<hr \/>\n<h2>\u2705 \u516d\u3001\u901a\u7528 MQTT Discovery \u914d\u7f6e\u6a21\u677f&#xff08;\u4f60\u53ef\u4ee5\u76f4\u63a5\u7528&#xff09;<\/h2>\n<p>homeassistant\/&lt;component&gt;\/&lt;object_id&gt;\/config<\/p>\n<p>JSON \u4e2d\u5e38\u7528\u5b57\u6bb5&#xff08;\u6700\u91cd\u8981&#xff09;&#xff1a;<\/p>\n<table>\n<tr>\u5b57\u6bb5\u8bf4\u660e<\/tr>\n<tbody>\n<tr>\n<td>name<\/td>\n<td>\u5728 HA \u663e\u793a\u7684\u540d\u5b57<\/td>\n<\/tr>\n<tr>\n<td>uniq_id<\/td>\n<td>\u552f\u4e00 ID&#xff08;\u5fc5\u987b&#xff0c;\u5426\u5219\u4e0d\u80fd\u5728 UI \u4e2d\u4fee\u6539&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>stat_t<\/td>\n<td>\u72b6\u6001\u4e0a\u62a5\u4e3b\u9898<\/td>\n<\/tr>\n<tr>\n<td>cmd_t<\/td>\n<td>\u63a7\u5236\u6307\u4ee4\u4e3b\u9898&#xff08;\u4ec5\u53ef\u63a7\u8bbe\u5907&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>val_tpl<\/td>\n<td>\u63d0\u53d6 JSON \u5b57\u6bb5<\/td>\n<\/tr>\n<tr>\n<td>dev_cla<\/td>\n<td>\u8bbe\u5907\u7c7b\u522b&#xff08;\u6e29\u5ea6\u3001\u6e7f\u5ea6\u3001\u529f\u7387\u7b49&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>device<\/td>\n<td>\u8bbe\u5907\u5143\u6570\u636e&#xff08;\u91cd\u8981&#xff1a;\u540c\u4e00\u8bbe\u5907\u5171\u4eab device \u7ed3\u6784&#xff09;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n","protected":false},"excerpt":{"rendered":"<p>\u4e0b\u9762\u6309 Home Assistant&#xff08;HA&#xff09; MQTT \u81ea\u5b9a\u4e49\u670d\u52a1\u5668 \u7684\u5178\u578b\u8bbe\u5907\u63a5\u5165\u65b9\u5f0f&#xff0c;\u603b\u7ed3 \u9700\u8981\u4e0a\u62a5&#xff08;Publish&#xff09; \u4e0e \u9700\u8981\u8ba2\u9605&#xff08;Subscribe&#xff09; \u7684\u4e3b\u9898&#xff0c;\u4ee5\u53ca\u5e38\u89c1\u5b57\u6bb5\u5185\u5bb9\u3002\u2705 \u4e00\u3001MQTT \u8bbe\u5907\u63a5\u5165 Home Assistant \u7684\u4e24\u79cd\u65b9\u5f0fHome Assistant \u652f\u6301\u4e24\u79cd MQTT \u8bbe\u5907\u6a21\u5f0f&#xff1a;\u65b9\u5f0f A&#xff1a;\u4f7f\u7528 MQTT <\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[9672,58,87,2271,43],"topic":[],"class_list":["post-86008","post","type-post","status-publish","format-standard","hentry","category-server","tag-esp32-c5","tag-linux","tag-87","tag-2271","tag-43"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Home Assistant\uff08HA\uff09+ MQTT \u81ea\u5b9a\u4e49\u670d\u52a1\u5668 \u7684\u5178\u578b\u8bbe\u5907\u63a5\u5165\u65b9\u5f0f\uff0c\u603b\u7ed3 \u9700\u8981\u4e0a\u62a5\uff08Publish\uff09 \u4e0e \u9700\u8981\u8ba2\u9605\uff08Subscribe\uff09 \u7684\u4e3b\u9898\uff0c\u4ee5\u53ca\u5e38\u89c1\u5b57\u6bb5\u5185\u5bb9\u3002 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/86008.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Home Assistant\uff08HA\uff09+ MQTT \u81ea\u5b9a\u4e49\u670d\u52a1\u5668 \u7684\u5178\u578b\u8bbe\u5907\u63a5\u5165\u65b9\u5f0f\uff0c\u603b\u7ed3 \u9700\u8981\u4e0a\u62a5\uff08Publish\uff09 \u4e0e \u9700\u8981\u8ba2\u9605\uff08Subscribe\uff09 \u7684\u4e3b\u9898\uff0c\u4ee5\u53ca\u5e38\u89c1\u5b57\u6bb5\u5185\u5bb9\u3002 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u4e0b\u9762\u6309 Home Assistant&#xff08;HA&#xff09; MQTT \u81ea\u5b9a\u4e49\u670d\u52a1\u5668 \u7684\u5178\u578b\u8bbe\u5907\u63a5\u5165\u65b9\u5f0f&#xff0c;\u603b\u7ed3 \u9700\u8981\u4e0a\u62a5&#xff08;Publish&#xff09; \u4e0e \u9700\u8981\u8ba2\u9605&#xff08;Subscribe&#xff09; \u7684\u4e3b\u9898&#xff0c;\u4ee5\u53ca\u5e38\u89c1\u5b57\u6bb5\u5185\u5bb9\u3002\u2705 \u4e00\u3001MQTT \u8bbe\u5907\u63a5\u5165 Home Assistant \u7684\u4e24\u79cd\u65b9\u5f0fHome Assistant \u652f\u6301\u4e24\u79cd MQTT \u8bbe\u5907\u6a21\u5f0f&#xff1a;\u65b9\u5f0f A&#xff1a;\u4f7f\u7528 MQTT\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/86008.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-07-27T17:58:09+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/86008.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/86008.html\",\"name\":\"Home Assistant\uff08HA\uff09+ MQTT \u81ea\u5b9a\u4e49\u670d\u52a1\u5668 \u7684\u5178\u578b\u8bbe\u5907\u63a5\u5165\u65b9\u5f0f\uff0c\u603b\u7ed3 \u9700\u8981\u4e0a\u62a5\uff08Publish\uff09 \u4e0e \u9700\u8981\u8ba2\u9605\uff08Subscribe\uff09 \u7684\u4e3b\u9898\uff0c\u4ee5\u53ca\u5e38\u89c1\u5b57\u6bb5\u5185\u5bb9\u3002 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-07-27T17:58:09+00:00\",\"dateModified\":\"2026-07-27T17:58:09+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/86008.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/86008.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/86008.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Home Assistant\uff08HA\uff09+ MQTT \u81ea\u5b9a\u4e49\u670d\u52a1\u5668 \u7684\u5178\u578b\u8bbe\u5907\u63a5\u5165\u65b9\u5f0f\uff0c\u603b\u7ed3 \u9700\u8981\u4e0a\u62a5\uff08Publish\uff09 \u4e0e \u9700\u8981\u8ba2\u9605\uff08Subscribe\uff09 \u7684\u4e3b\u9898\uff0c\u4ee5\u53ca\u5e38\u89c1\u5b57\u6bb5\u5185\u5bb9\u3002\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Home Assistant\uff08HA\uff09+ MQTT \u81ea\u5b9a\u4e49\u670d\u52a1\u5668 \u7684\u5178\u578b\u8bbe\u5907\u63a5\u5165\u65b9\u5f0f\uff0c\u603b\u7ed3 \u9700\u8981\u4e0a\u62a5\uff08Publish\uff09 \u4e0e \u9700\u8981\u8ba2\u9605\uff08Subscribe\uff09 \u7684\u4e3b\u9898\uff0c\u4ee5\u53ca\u5e38\u89c1\u5b57\u6bb5\u5185\u5bb9\u3002 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/86008.html","og_locale":"zh_CN","og_type":"article","og_title":"Home Assistant\uff08HA\uff09+ MQTT \u81ea\u5b9a\u4e49\u670d\u52a1\u5668 \u7684\u5178\u578b\u8bbe\u5907\u63a5\u5165\u65b9\u5f0f\uff0c\u603b\u7ed3 \u9700\u8981\u4e0a\u62a5\uff08Publish\uff09 \u4e0e \u9700\u8981\u8ba2\u9605\uff08Subscribe\uff09 \u7684\u4e3b\u9898\uff0c\u4ee5\u53ca\u5e38\u89c1\u5b57\u6bb5\u5185\u5bb9\u3002 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u4e0b\u9762\u6309 Home Assistant&#xff08;HA&#xff09; MQTT \u81ea\u5b9a\u4e49\u670d\u52a1\u5668 \u7684\u5178\u578b\u8bbe\u5907\u63a5\u5165\u65b9\u5f0f&#xff0c;\u603b\u7ed3 \u9700\u8981\u4e0a\u62a5&#xff08;Publish&#xff09; \u4e0e \u9700\u8981\u8ba2\u9605&#xff08;Subscribe&#xff09; \u7684\u4e3b\u9898&#xff0c;\u4ee5\u53ca\u5e38\u89c1\u5b57\u6bb5\u5185\u5bb9\u3002\u2705 \u4e00\u3001MQTT \u8bbe\u5907\u63a5\u5165 Home Assistant \u7684\u4e24\u79cd\u65b9\u5f0fHome Assistant \u652f\u6301\u4e24\u79cd MQTT \u8bbe\u5907\u6a21\u5f0f&#xff1a;\u65b9\u5f0f A&#xff1a;\u4f7f\u7528 MQTT","og_url":"https:\/\/www.wsisp.com\/helps\/86008.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-07-27T17:58:09+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/86008.html","url":"https:\/\/www.wsisp.com\/helps\/86008.html","name":"Home Assistant\uff08HA\uff09+ MQTT \u81ea\u5b9a\u4e49\u670d\u52a1\u5668 \u7684\u5178\u578b\u8bbe\u5907\u63a5\u5165\u65b9\u5f0f\uff0c\u603b\u7ed3 \u9700\u8981\u4e0a\u62a5\uff08Publish\uff09 \u4e0e \u9700\u8981\u8ba2\u9605\uff08Subscribe\uff09 \u7684\u4e3b\u9898\uff0c\u4ee5\u53ca\u5e38\u89c1\u5b57\u6bb5\u5185\u5bb9\u3002 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-07-27T17:58:09+00:00","dateModified":"2026-07-27T17:58:09+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/86008.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/86008.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/86008.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Home Assistant\uff08HA\uff09+ MQTT \u81ea\u5b9a\u4e49\u670d\u52a1\u5668 \u7684\u5178\u578b\u8bbe\u5907\u63a5\u5165\u65b9\u5f0f\uff0c\u603b\u7ed3 \u9700\u8981\u4e0a\u62a5\uff08Publish\uff09 \u4e0e \u9700\u8981\u8ba2\u9605\uff08Subscribe\uff09 \u7684\u4e3b\u9898\uff0c\u4ee5\u53ca\u5e38\u89c1\u5b57\u6bb5\u5185\u5bb9\u3002"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/86008","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=86008"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/86008\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=86008"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=86008"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=86008"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=86008"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}