{"id":3823,"date":"2017-08-04T04:55:36","date_gmt":"2017-08-03T20:55:36","guid":{"rendered":"http:\/\/benjenq.ddns.net\/blog\/%e3%80%90%e5%89%b5%e5%ae%a2%e3%80%91%e5%8f%aa%e7%ae%a1%e5%87%ba%e4%b8%80%e5%bc%b5%e5%98%b4%ef%bc%9a%e7%94%a8-siri-%e6%8e%a7%e5%88%b6%e5%ae%b6%e8%a3%a1%e7%9a%84%e8%80%81%e5%ae%b6%e9%9b%bb\/"},"modified":"2017-08-04T04:55:36","modified_gmt":"2017-08-03T20:55:36","slug":"%e3%80%90%e5%89%b5%e5%ae%a2%e3%80%91%e5%8f%aa%e7%ae%a1%e5%87%ba%e4%b8%80%e5%bc%b5%e5%98%b4%ef%bc%9a%e7%94%a8-siri-%e6%8e%a7%e5%88%b6%e5%ae%b6%e8%a3%a1%e7%9a%84%e8%80%81%e5%ae%b6%e9%9b%bb","status":"publish","type":"post","link":"http:\/\/benjenq.ddns.net\/blog\/%e3%80%90%e5%89%b5%e5%ae%a2%e3%80%91%e5%8f%aa%e7%ae%a1%e5%87%ba%e4%b8%80%e5%bc%b5%e5%98%b4%ef%bc%9a%e7%94%a8-siri-%e6%8e%a7%e5%88%b6%e5%ae%b6%e8%a3%a1%e7%9a%84%e8%80%81%e5%ae%b6%e9%9b%bb\/","title":{"rendered":"\u3010\u5275\u5ba2\u3011\u53ea\u7ba1\u51fa\u4e00\u5f35\u5634\uff1a\u7528 Siri \u63a7\u5236\u5bb6\u88e1\u7684\u8001\u5bb6\u96fb"},"content":{"rendered":"<p><img decoding=\"async\" alt=\"IMG_1598\" border=\"0\" src=\"https:\/\/pic.pimg.tw\/benjenq\/1501833031-1351108483_l.png?v=1501833033\" title=\"IMG_1598\"><\/p>\n<p>\u4e0d\u4e45\u524d\u5728 Youtube \u4e0a\u770b\u5230\u4e00\u5247<a href=\"https:\/\/www.youtube.com\/watch?v=hUToRlzY3IQ\" target=\"_blank\">\u5f71\u7247<\/a>\uff0c\u4e3b\u89d2\u53ea\u51fa\u4e00\u5f35\u5634\uff0c\u5c31\u80fd\u900f\u904e Siri \u8b93\u5bb6\u88e1\u7684\u96fb\u5668\u7528\u54c1\u4e56\u4e56\u807d\u8a71\uff0c\u5c31\u50cf\u5c0f\u6642\u5019\u7684\u79d1\u5e7b\u7247\u63cf\u8ff0\u672a\u4f86\u7684\u5c45\u5bb6\u751f\u6d3b\uff0c\u9817\u70ba\u795e\u5947\u3002\u53ea\u4e0d\u904e\u5f71\u7247\u4e2d\u4e26\u6c92\u6709\u8aaa\u660e\u5be6\u4f5c\u7684\u65b9\u6cd5\uff0c\u53ea\u5728\u5f71\u7247\u4e0b\u65b9\u7559\u8a00\u4e2d\u63d0\u5230\u5e7e\u500b\u95dc\u9375\u5b57\uff0c\u5f15\u8d77\u4e86\u6211\u7684\u597d\u5947\u3002<\/p>\n<p>\u5f9e iOS \u958b\u767c\u8005\u7684\u89d2\u5ea6\u4f86\u770b\uff0c\u539f\u4ee5\u70ba\u662f iOS 10 \u7684 Sirikit \u7684\u65b0\u529f\u80fd\uff0c\u65bc\u662f\u6211\u5617\u8a66\u547c\u53eb Siri \uff0c\u5f97\u5230\u7684\u662f\u4ee5\u4e0b\u7684\u7d50\u679c\uff1a<\/p>\n<p><!-- more --><\/p>\n<p>&nbsp;<\/p>\n<p><img decoding=\"async\" alt=\"IMG_1599\" border=\"0\" src=\"https:\/\/pic.pimg.tw\/benjenq\/1501833755-345126460.png?v=1501833758\" title=\"IMG_1599\"><\/p>\n<p>Siri \u56de\u7b54\u63d0\u5230\u300c\u6253\u7406\u9019\u500b\u5bb6\u300d\uff0c\u5927\u6982\u80fd\u731c\u5f97\u5230\uff0ciOS \u4f7f\u7528 Homekit \u63a7\u5236\u5bb6\u96fb \uff0c\u800c Siri \u8207 Homekit \u6574\u5408\u5df2\u7d93\u662f iOS 10 \u5167\u5efa\u7684\u529f\u80fd\uff0c\u6240\u4ee5 Siri \u63a7\u5236\u5bb6\u96fb\u4e26\u975e\u4f7f\u7528 Sirikit \uff0c\u800c\u662f\u7528 Homekit \u4f86\u5be6\u73fe\u3002\u63db\u8a00\u4e4b\uff0c\u6240\u8b02\u5bb6\u96fb\u7528\u54c1\u652f\u63f4 Homekit \u529f\u80fd\uff0c\u5c31\u662f\u9664\u4e86\u80fd\u900f\u904e iOS 10 \u5167\u5efa\u7684\u300c\u5bb6\u5ead App\u300d\u4f86\u7d71\u4e00\u7ba1\u7406\uff0c\u4e26\u53ef\u81ea\u8a02\u4f7f\u7528\u60c5\u5883\u3001\u5834\u666f\u8207\u914d\u4ef6\u7684\u8a2d\u5b9a\uff0c\u6253\u9020\u500b\u4eba\u5c08\u5c6c\u7684\u5bb6\u96fb\u904b\u4f5c\u6a21\u5f0f\u4e4b\u5916\uff0c\u9084\u80fd\u900f\u904e iOS \u7684 Siri \u8a9e\u97f3\u52a9\u7406\uff0c\u300c\u7528\u8b1b\u7684\u300d\u64cd\u63a7\u5bb6\u96fb\u7684\u90e8\u5206\u529f\u80fd\u3002\u300c\u5bb6\u5ead App \u7ba1\u7406\u5bb6\u96fb\u300d\u8207\u300cSiri \u8a9e\u97f3\u63a7\u5236\u5bb6\u96fb\u300d\u5169\u9805\u91cd\u9ede\u529f\u80fd\uff0c\u5c31\u662f iOS 10 \u7684 Homekit \u667a\u6167\u5bb6\u96fb\u5e73\u53f0\u3002<\/p>\n<p>\u8fd1\u5e74\u4f86\u6709\u8d8a\u4f86\u8d8a\u591a\u65b0\u7684\u5bb6\u96fb\u7522\u54c1\u6a19\u699c\u300c\u667a\u6167\u5bb6\u96fb\u300d\u529f\u80fd\uff0c\u4f46\u53f0\u7063\u6c11\u773e\u5c0d\u9019\u4e00\u584a\u7684\u71b1\u5ea6\u4e0d\u5920\uff0c\u76ee\u524d\u5e02\u9762\u4e0a\u9084\u4e0d\u666e\u53ca\uff0c\u73fe\u5f79\u5bb6\u96fb\u7522\u54c1\u4e5f\u5927\u591a\u9084\u80fd\u7528\u500b\u5f88\u591a\u5e74\uff0c\u9664\u975e\u5728\u88dd\u4fee\u65b0\u623f\u6642\u5c31\u7d0d\u5165\u667a\u6167\u5bb6\u96fb\u7684\u898f\u5283\uff0c\u5426\u5247\u53ea\u6709\u6975\u5c11\u6578\u7684\u4eba\u70ba\u4e86\u4eab\u53d7\u300c\u667a\u6167\u5bb6\u96fb\u751f\u6d3b\u300d\u628a\u5bb6\u88cf\u7684\u96fb\u5668\u7522\u54c1\u5168\u90e8\u63db\u6389\uff08\u64da\u8aaa\u6709\u500b\u793e\u6703\u540d\u4eba\u5c31\u9019\u6a23\u641e\uff0c\u6253\u9020\u667a\u6167\u5bb6\u5ead\u5c31\u82b1\u4e86\u56db\u5343\u842c\u53f0\u5e63\uff09\u3002\u65bc\u662f\u63db\u500b\u89d2\u5ea6\uff0c\u6709\u6c92\u6709\u8fa6\u6cd5\u8b93\u5bb6\u88cf\u9762\u7684\u73fe\u6709\u5bb6\u96fb\uff0c\u900f\u904e\u5916\u639b\u624b\u6bb5\u4f86\u652f\u63f4 Homekit \u5462\uff1f\u7b54\u6848\u662f\u6709\u7684\uff0c\u50f9\u683c\u4e5f\u5f88\u4f4e\u5ec9\uff0c\u53ea\u662f\u8981\u9054\u5230\u9019\u6a23\u7684\u76ee\u6a19\u6709\u4e00\u5b9a\u7684\u6280\u8853\u9580\u6abb\uff0c\u96d6\u7136\u4e0d\u96e3\uff0c\u4f46\u4e5f\u4e0d\u7b97\u5bb9\u6613\uff0c\u56e0\u70ba\u4e0d\u540c\u7684\u96fb\u5668\u6709\u4e0d\u540c\u7684\u52d5\u4f5c\u8a2d\u5b9a\uff0c\u7d0d\u5165 Homekit \u4e4b\u5f8c\u66f4\u4e0d\u4e00\u5b9a\u652f\u63f4\u5bb6\u96fb\u539f\u6709\u7684\u5168\u90e8\u529f\u80fd\u3002<\/p>\n<p>\u6240\u4ee5\u6211\u53ef\u4ee5\u7406\u89e3\u70ba\u4f55\u4e00\u5806 Youtube \u5f71\u7247\uff0c\u5c24\u5176\u662f\u4e2d\u6587\u7684\uff0c\u5927\u591a\u6c92\u6709\u6559\u5b78\uff0c\u7562\u7adf\u6709\u4e9b\u5be6\u4f5c\u6b65\u9a5f\u5f88\u6709\u53ef\u80fd\u5361\u95dc\uff0c\u5be6\u4f5c\u65b9\u5f0f\u4e5f\u6703\u727d\u6d89\u5230\u7279\u5b9a\u7684\u77e5\u8b58\u9818\u57df\uff0c\u5beb\u4e86\u6559\u5b78\u4e5f\u4e0d\u53ef\u80fd\u4eba\u4eba\u90fd\u80fd\u6dfa\u986f\u6613\u61c2\u3002\u6240\u4ee5\u9019\u7bc7\u6587\u7ae0\u4e26\u975e\u65b0\u624b\u6559\u5b78\uff0c\u53ea\u6703\u6982\u7565\u63d0\u51fa\u5be6\u4f5c\u65b9\u5f0f\uff0c\u9664\u4e86\u5e6b\u81ea\u5df1\u505a\u7d00\u9304\uff0c\u4e5f\u63d0\u4f9b\u5df2\u6709\u4ee5\u4e0b\u76f8\u95dc\u57fa\u790e\u77e5\u8b58\uff0c\u4e26\u4e14\u6709\u8208\u8da3\u60f3\u5617\u8a66\u7684\u4eba\u505a\u53c3\u8003\u3002<\/p>\n<ul>\n<li>\u6703\u4f7f\u7528 Arduino IDE \u64b0\u5beb\u55ae\u6676\u7247\u97cc\u9ad4\u3002<\/li>\n<li>\u7565\u61c2 Linux \u7d42\u7aef\u6a5f\u64cd\u4f5c\u6307\u4ee4\u3002<\/li>\n<\/ul>\n<p>\u76ee\u6a19\u4f7f\u7528\u60c5\u5883\uff1a\u4ee5\u5bb6\u88cf\u904b\u4f5c\u591a\u5e74\u7684\u8001\u51b7\u6c23\u6a5f\u70ba\u4f8b\uff0c\u5229\u7528 iOS \u7684 Homekit \u529f\u80fd\u4f86\u63a7\u5236\u51b7\u6c23\u7684\u57fa\u672c\u529f\u80fd\u300c\u958b\u300d\u548c\u300c\u95dc\u300d\u3002<\/p>\n<p>\u5e02\u552e\u7684\u50b3\u7d71\u5bb6\u7528\u51b7\u6c23\u90fd\u6709\u7d05\u5916\u7dda\u9059\u63a7\u5668\uff0c\u4f46\u4e26\u4e0d\u652f\u63f4\u7121\u7dda\u7db2\u8def\u3002\u6240\u4ee5\u8981\u9054\u5230\u4e0a\u8ff0\u76ee\u6a19\uff0c\u5be6\u4f5c\u76ee\u6a19\u5206\u6210\u5169\u5927\u90e8\u5206\uff1a<\/p>\n<ul>\n<li><strong>\u5be6\u4f5c\u4e00\u7d44\u53ef\u652f\u63f4\u7db2\u8def\u64cd\u63a7\u7684\u81ea\u88fd\u7d05\u5916\u7dda WIFI \u9059\u63a7\u5668<\/strong><\/li>\n<li><strong>\u5728\u5bb6\u88e1\u7684\u5340\u57df\u7db2\u8def\u5167\uff0c\u9023\u63a5 Homekit \u8207\u81ea\u88fd\u7684\u7d05\u5916\u7ddaWIFI\u9059\u63a7\u5668<\/strong><\/li>\n<\/ul>\n<p><strong><span style=\"font-size:14pt\">\u4e00\u3001\u652f\u63f4 WIFI \u7db2\u8def\u64cd\u63a7\u7684\u7d05\u5916\u7dda\u9059\u63a7\u5668<\/span><\/strong><\/p>\n<p>\u9019\u500b\u90e8\u5206\u6559\u5b78\u5c31\u4e0d\u5c11\u4e86\uff0c\u641c\u5c0b\u300c<a href=\"https:\/\/www.google.com.tw\/search?q=Arduino%2BIRremote&amp;oq=Arduino%2BIRremote&amp;aqs=chrome..69i57j69i65&amp;sourceid=chrome&amp;ie=UTF-8\" target=\"_blank\">Arduino+IRremote<\/a>\u300d\u5c31\u6703\u8dd1\u51fa\u4e00\u5806\u3002\u9019\u88e1\u518d\u7d30\u5206\u51fa\u5169\u968e\u6bb5\uff1a\u6750\u6599\u63a1\u8cfc\u8207\u8edf\u9ad4\u64b0\u5beb\u3002<\/p>\n<p>\u6750\u6599\u76f8\u7576\u5ec9\u50f9\uff0c\u751a\u81f3\u65bc\u6bd4\u4f60\u53bb\u591c\u5e02\u8cb7\u4e00\u96bb\u842c\u7528\u9059\u63a7\u5668\u9084\u4fbf\u5b9c\u3002<\/p>\n<ul>\n<li>MCU\/SoC \u6676\u7247\uff1a\u9996\u5148\u662f\u5fc5\u9808\u652f\u63f4\u806f\u7db2\u529f\u80fd\u7684\u55ae\u6676\u7247\uff0cESP8266 \u7cfb\u5217\u7576\u7136\u662f\u4e0d\u4e8c\u4eba\u9078\uff0c\u76f4\u63a5\u7528 <a href=\"http:\/\/goods.ruten.com.tw\/item\/show?21647522142501\" target=\"_blank\">NodeMCU V1.0<\/a> \u5c31\u53ef\u4ee5\u4e86\uff0c\u6216\u662f\u4f7f\u7528\u9ad4\u7a4d\u66f4\u5c0f\u3001\u66f4\u4fbf\u5b9c\u7684 <a href=\"http:\/\/goods.ruten.com.tw\/item\/show?21705187123625\" target=\"_blank\">WEMOS D1 mini<\/a> \u4e5f\u884c\u3002\u9019\u6771\u897f\u8d8a\u4f86\u8d8a\u4fbf\u5b9c\uff0c\u53f0\u7063\u4e00\u500b\u624d\u4e00\u767e\u591a\u5143\uff0c\u5c0d\u5cb8\u7684\u6dd8\u5bf6\u66f4\u4fbf\u5b9c\uff0c\u5408\u53f0\u5e63\u4e0d\u5230 80 \u5143\uff0cCP \u503c\u7206\u8868\uff0c\u5c4c\u6253\u4e00\u5806\u52d5\u8f12\u5343\u5143\u7684\u7269\u806f\u7db2\u6a21\u7d44\u3002<\/li>\n<li>\u7d05\u5916\u7dda\u767c\u5c04 LED \uff1a<a href=\"http:\/\/goods.ruten.com.tw\/item\/show?21645330739025\" target=\"_blank\">\u4e00\u9846\u624d 2 \u5143<\/a>\uff0c\u53f0\u5357\u5e02\u5340\u7684\u96fb\u5b50\u6750\u6599\u5e97\u7d04 10-15 \u5143\u3002\u56e0\u70ba\u767c\u5c04\u6642\u6709\u65b9\u5411\u6027\uff0c\u53ef\u4ee5\u4f75\u806f\u500b2-3\u9846\uff0c\u6bcf\u4e00\u9846\u671d\u4e0d\u540c\u7684\u65b9\u5411\u3002<\/li>\n<li>\u96fb\u6676\u9ad4\uff1aNPN \u578b\uff0c\u4f8b\u5982 <a href=\"http:\/\/goods.ruten.com.tw\/item\/show?21211285370002\" target=\"_blank\">2N3904<\/a>\uff0c\u4f5c\u7528\u662f\u653e\u5927\u7d05\u5916\u7dda\u767c\u5c04\u8a0a\u865f\uff0c\u4e00\u9846\u4e5f\u662f 2-5 \u5143\u3002<\/li>\n<\/ul>\n<p>\u5143\u4ef6\u63a5\u6cd5\u53ef\u53c3\u8003<a href=\"https:\/\/github.com\/markszabo\/IRremoteESP8266\/wiki#ir-sending\" target=\"_blank\">\u9019\u500b\u7db2\u9801<\/a>\uff0c\u81ea\u88fd\u7d05\u5916\u7dda\u6416\u63a7\u5668\u7684\u786c\u9ad4\u914d\u7f6e\u5c31\u9019\u6a23\u800c\u5df2\uff0c\u6750\u6599\u8cbb\u624d\u53f0\u5e63\u4e00\u767e\u591a\u5143\u3002\u81f3\u65bc\u904b\u4f5c\u7684\u96fb\u6e90\uff0c\u627e\u689d <a href=\"https:\/\/24h.pchome.com.tw\/store\/DYAP62\" target=\"_blank\">Micro-USB \u7dda<\/a>\u9023\u63a5 NodeMCU \u8207\u5e36\u96fb\u7684 USB \u57e0\u5c31\u884c\u4e86\uff08\u96fb\u8166\/\u5145\u96fb\u5668\/\u884c\u52d5\u96fb\u6e90\u2026\uff09\u3002<\/p>\n<p>NodeMCU V1.0 \u96fb\u8def\u63a5\u6cd5<\/p>\n<p><img decoding=\"async\" alt=\"687474703a2f2f667269747a696e672e6f72672f6d656469612f667269747a696e672d7265706f2f70726f6a656374732f652f657370383236362d69722d7472616e736d69747465722f696d616765732f49522532305472616e736d69747465725f62622e706e67\" border=\"0\" src=\"https:\/\/pic.pimg.tw\/benjenq\/1504606321-3973306264.png\" title=\"687474703a2f2f667269747a696e672e6f72672f6d656469612f667269747a696e672d7265706f2f70726f6a656374732f652f657370383236362d69722d7472616e736d69747465722f696d616765732f49522532305472616e736d69747465725f62622e706e67\"><\/p>\n<p>WEMOS D1 mini \u7684\u96fb\u8def\u63a5\u6cd5\uff0c\u5176\u5be6\u8207 NodeMCU V1.0 \u76f8\u540c\uff0c\u4f46\u9ad4\u7a4d\u66f4\u5c0f\u3002<\/p>\n<p><img decoding=\"async\" alt=\"WEMOS_D1_mini\" border=\"0\" src=\"https:\/\/pic.pimg.tw\/benjenq\/1526577972-4171854517.png\" title=\"WEMOS_D1_mini\"> &nbsp;<\/p>\n<p>\u518d\u4f86\u662f\u8edf\u9ad4\u64b0\u5beb\u7684\u968e\u6bb5\u3002\u5018\u82e5\u771f\u7684\u4e0d\u6703\u5beb\u7a0b\u5f0f\uff0c\u90a3\u2026\u8acb\u81ea\u884c Google \u5e02\u9762\u4e0a\u5df2\u6574\u5408 WIFI + \u7d05\u5916\u7dda + \u8edf\u9ad4 APP \u7684\u7522\u54c1\uff1a<a href=\"http:\/\/www.broadlink.com.tw\/RMPro.htm\" target=\"_blank\">Broadlink RM Pro<\/a>\uff08\u5e02\u50f9\u7d04 NT 980.-\uff09\uff0c\u4ee5\u53ca\u5982\u4f55\u628a\u9019\u7522\u54c1\u639b\u4e0a Homekit \u7684\u6559\u5b78\uff0c\u5c31\u53ef\u4ee5\u6309\u4e0a\u4e00\u9801\u96e2\u958b\u672c\u6587\u7ae0\u4e86\u3002<\/p>\n<p>\u8edf\u9ad4\u64b0\u5beb\u4f7f\u7528 <a href=\"https:\/\/www.arduino.cc\/en\/Main\/Software\" target=\"_blank\">Arduino IDE<\/a> + <a href=\"https:\/\/github.com\/esp8266\/Arduino\" target=\"_blank\">Arduino Code<\/a> \u958b\u767c\u64b0\u5beb\uff0c\u52a0\u639b\u4ee5\u4e0b\u4e09\u65b9\u5957\u4ef6\uff0c\u81f3\u65bc\u7a0b\u5f0f\u78bc\u5167\u5bb9\u5c31\u4e0d\u8aaa\u660e\u4e86\uff0c\u5957\u4ef6\u7bc4\u4f8b\u90fd\u6709\u3002<\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/markszabo\/IRremoteESP8266\" target=\"_blank\">IRremoteESP8266<\/a>\uff1aESP8266 \u9a45\u52d5\u7d05\u5916\u7dda\u7684\u5957\u4ef6\u3002<\/li>\n<li><a href=\"https:\/\/github.com\/tzapu\/WiFiManager\" target=\"_blank\">WiFiManager<\/a>\uff1aESP8266 \u8d85\u7d1a\u597d\u7528\u7684 Wifi \u9023\u7dda\u5957\u4ef6\u3002<\/li>\n<li>&lt;ESP8266mDNS.h&gt;\u3001&lt;ESP8266WebServer.h&gt;\uff1a<a href=\"https:\/\/github.com\/esp8266\/Arduino\" target=\"_blank\">ESP8266 Arduino Code<\/a> \u5167\u5efa\u3002\u8b93 ESP8266 \u8b8a\u6210\u5177\u5099 DNS Name \u7684 WebServer\uff0c\u8ca0\u8cac\u63a5\u6536 HTTP Request \u5167\u5bb9\u3002<\/li>\n<\/ul>\n<p>\u4e0d\u904e\u4e00\u958b\u59cb\u6211\u5011\u4e0d\u77e5\u9053\u51b7\u6c23\u7684\u7d05\u5916\u7dda\u6307\u4ee4\u7684\u7de8\u78bc\u5167\u5bb9\uff0c\u6240\u4ee5\u8981\u8cb7\u4e00\u9846\u7d05\u5916\u7dda\u63a5\u6536\u5668\uff08\u6211\u662f\u8cb7<a href=\"http:\/\/goods.ruten.com.tw\/item\/show?21551360404821\" target=\"_blank\">\u6a21\u7d44\u5316\u7684\u9019\u500b<\/a>\uff0c\u7406\u8ad6\u4e0a\u53ef\u4ee5\u8cb7\u66f4\u4fbf\u5b9c\u7684 <a href=\"http:\/\/goods.ruten.com.tw\/item\/show?21552427864714\" target=\"_blank\">LED \u578b<\/a>\uff09\uff0c\u518d\u7528 IRremoteESP8266 \u63d0\u4f9b\u7684\u6a19\u6e96\u7bc4\u4f8b\u7a0b\u5f0f\u5beb\u500b ESP8266 \u63a5\u6536\u7d05\u5916\u7dda\u7de8\u78bc\u7684\u7a0b\u5f0f\uff0c\u5b78\u7fd2\u539f\u5ee0\u7684\u6416\u63a7\u5668\u5c31\u53ef\u53d6\u5f97\u7d05\u5916\u7dda\u7684\u7de8\u78bc\u5167\u5bb9\uff0c\u5b58\u6210\u6587\u5b57\u5f8c\u5c31\u53ef\u4ee5\u4f5c\u70ba\u7d05\u5916\u7dda\u767c\u5c04\u5668\u7684\u8cc7\u6599\u4f86\u6e90\uff0c\u53ef\u53c3\u8003<a href=\"http:\/\/yehnan.blogspot.tw\/2013\/05\/arduino.html\" target=\"_blank\">\u9019\u7bc7\u6587\u7ae0<\/a>\u7684\u8aaa\u660e\u3002<\/p>\n<p>\u9019\u500b\u90e8\u5206\u6700\u7d42\u7684\u76ee\u6a19\u70ba\uff1a\u5728\u5bb6\u88e1\u7684\u7db2\u8def\u4e2d\u96a8\u4fbf\u627e\u4e00\u53f0\u96fb\u8166\/\u5e73\u677f\/\u624b\u6a5f\uff0c\u6253\u958b\u700f\u89bd\u5668\uff0c\u8f38\u5165\u7db2\u5740\u5c31\u80fd\u9a45\u52d5\u81ea\u88fd\u7684\u7d05\u5916\u7dda\u767c\u5c04\u5668\u9032\u884c\u6307\u5b9a\u7684\u52d5\u4f5c\uff0c\u4f8b\u5982\u8f38\u5165 http:\/\/esp8266.local\/airconditioner\/on \u5c31\u80fd\u8b93\u81ea\u88fd\u9059\u63a7\u5668\u767c\u5c04\u300c\u958b\u51b7\u6c23\u300d\u7684\u7d05\u5916\u7dda\u7de8\u78bc\uff0chttp:\/\/esp8266.local\/airconditioner\/off&nbsp;\u8b93\u81ea\u88fd\u9059\u63a7\u5668\u767c\u5c04\u300c\u95dc\u51b7\u6c23\u300d\u7684\u7d05\u5916\u7dda\u7de8\u78bc\u3002<\/p>\n<p>\u7576\u9019\u500b\u968e\u6bb5\u5b8c\u6210\u4e4b\u5f8c\uff0c\u53ea\u8981\u628a\u81ea\u88fd\u7d05\u5916\u7dda WIFI \u9059\u63a7\u5668\u64fa\u5728\u51b7\u6c23(\u5bb6\u96fb)\u53ef\u63a5\u6536\u7d05\u5916\u7dda\u8a0a\u865f\u7684\u56fa\u5b9a\u4f4d\u7f6e\uff0c\u5c31\u7b49\u65bc\u53ef\u4ee5\u5728\u5bb6\u88e1\u7528\u96fb\u8166\/\u5e73\u677f\/\u624b\u6a5f\u7b49\u88dd\u7f6e\uff0c\u7528\u900f\u904e\u5bb6\u88e1\u7684\u5340\u57df\u7db2\u8def\u4f86\u63a7\u5236\u5bb6\u88e1\u7684\u51b7\u6c23\u958b\u95dc\uff0c\u6210\u529f\u4e4b\u5f8c\u5c31\u53ef\u4ee5\u5beb\u500b\u7c21\u55ae\u7684 App \uff0c\u900f\u904e\u6309\u6309\u9215\u6216\u5176\u4ed6\u64cd\u4f5c\u65b9\u5f0f\uff0c\u4f86\u547c\u53eb\u7db2\u5740\u5c31\u884c\u4e86\u3002\u4f8b\u5982\u4ee5\u4e0b\u7684\u5e7e\u500b\u7bc4\u4f8b\uff1a<\/p>\n<p>\u624b\u6a5f\u7aef\u7684 Widget \u5de5\u5177\uff1a<\/p>\n<p><img decoding=\"async\" alt=\"IMG_1652\" border=\"0\" src=\"https:\/\/pic.pimg.tw\/benjenq\/1504025350-225335562.png?v=1504025355\" title=\"IMG_1652\"><\/p>\n<p>macOS \u96fb\u8166\u7aef\u7684\u61c9\u7528\u7a0b\u5f0f\uff1a<\/p>\n<p><img decoding=\"async\" alt=\"2017-08-30-1.19.25\" border=\"0\" src=\"https:\/\/pic.pimg.tw\/benjenq\/1504027912-2204012095.png?v=1504027920\" title=\"2017-08-30-1.19.25\"><\/p>\n<p>Windows PC \u7aef\u7684\u61c9\u7528\u7a0b\u5f0f\uff1a<\/p>\n<p><img decoding=\"async\" alt=\"Image2\" border=\"0\" src=\"https:\/\/pic.pimg.tw\/benjenq\/1504816227-3674907426.png\" title=\"Image2\"> <img decoding=\"async\" alt=\"Image\" border=\"0\" src=\"https:\/\/pic.pimg.tw\/benjenq\/1504817063-2783156143.png\" title=\"Image\"><\/p>\n<p>Web \u7248\uff08\u5c07<a href=\"https:\/\/swf.com.tw\/?p=905\" target=\"_blank\">\u7db2\u9801\u7a0b\u5f0f\u4e0a\u50b3\u5230 ESP8266 \u7684 SPIFF \u6a94\u6848\u7a7a\u9593<\/a>\uff09\u3002<\/p>\n<p><img decoding=\"async\" alt=\"esp8266local\" border=\"0\" src=\"https:\/\/pic.pimg.tw\/benjenq\/1523033579-4280121904.png\" title=\"esp8266local\"><\/p>\n<p>\u5176\u5be6\u300c\u7528\u88dd\u7f6e\u9059\u63a7 ESP8266 \u806f\u7db2\u88dd\u7f6e\u300d\u7684\u52d5\u4f5c\u4e0d\u4e00\u5b9a\u8981\u900f\u904e HTTP \u5354\u5b9a\uff0c\u6709\u592a\u591a\u65b9\u5f0f\u4e86\uff0c\u4f8b\u5982\u4f7f\u7528 MQTT \u5354\u5b9a\u642d\u914d\u570b\u5916\u514d\u8cbb\u7684 Broker \u670d\u52d9\uff0c\u9810\u8a2d\u5c31\u80fd\u76f4\u63a5\u8de8\u8d8a\u5bb6\u88e1\u5340\u7db2\u7684\u9650\u5236\uff0c\u4e0d\u8ad6\u4eba\u5728\u4e16\u754c\u7684\u54ea\u500b\u5730\u65b9\uff0c\u62ff\u8d77\u624b\u6a5f\u6216\u5e73\u677f\u57f7\u884c MQTT \u5ba2\u6236\u7aef\u7a0b\u5f0f\uff0c\u5c31\u80fd\u63a7\u5236\u5bb6\u88cf\u7684 ESP8266 \u806f\u7db2\u88dd\u7f6e\uff0c\u4f46\u4e5f\u610f\u5473\u5225\u4eba\u4e5f\u6709\u6a5f\u6703\u99ed\u5165\u4f60\u5bb6\uff0c\u6240\u4ee5\u4f7f\u7528\u7db2\u8def MQTT \u670d\u52d9\u8981\u975e\u5e38\u5c0f\u5fc3\uff0c\u9019\u90e8\u5206\u5c31\u4e0d\u591a\u63d0\u4e86\u3002<\/p>\n<p><strong><span style=\"font-size:14pt\">\u4e8c\u3001\u9023\u7d50 iOS Homekit \u8207\u81ea\u88fd\u7d05\u5916\u7ddaWIFI\u9059\u63a7\u5668<\/span><\/strong><\/p>\n<p>\u9019\u908a\u5c31\u9032\u5165\u91cd\u9ede\u4e86\u3002\u76ee\u524d\u96d6\u7136\u6709&nbsp;<a href=\"https:\/\/github.com\/HomeACcessoryKid\/ESP8266-HomeKit-Demo\" target=\"_blank\">ESP8266-Homekit<\/a> \u65b9\u6848\uff0c\u4f46\u4f3c\u4e4e\u4e26\u6c92\u6709 <a href=\"https:\/\/github.com\/esp8266\/Arduino\" target=\"_blank\">Arduino Code<\/a> \u7684\u5f62\u5f0f\uff0c\u6240\u4ee5\u8981\u5ba2\u88fd\u5316\u5468\u908a\u8a2d\u5099\u6709\u4e0d\u5c0f\u7684\u96e3\u5ea6\u3002\u73fe\u5728\u770b\u5230\u5927\u90e8\u5206\u5be6\u4f5c\u7684\u65b9\u5f0f\u662f\u900f\u904e\u4e00\u500b\u53eb\u300c<a href=\"https:\/\/github.com\/nfarina\/homebridge\" target=\"_blank\">homebridge<\/a>\u300d\u7684\u670d\u52d9\u4f5c\u70ba\u6a4b\u63a5\u5668\uff0c\u7531\u9019\u500b\u6a4b\u63a5\u5668\u8ca0\u8cac\u5468\u908a\u8a2d\u5099\u8207 Homekit \u7684\u6e9d\u901a\uff0c\u5be6\u4f5c\u91cd\u9ede\u5728\u8edf\u9ad4\u670d\u52d9\u7684\u5b89\u88dd\u8207\u8a2d\u5b9a\u3002<\/p>\n<p><strong>(1) \u5b89\u88dd&nbsp;homebridge \u6a4b\u63a5\u5668\u670d\u52d9<\/strong><\/p>\n<p>\u77e5\u9053\u4e0a\u8ff0\u52d5\u4f5c\u539f\u7406\u4e4b\u5f8c\uff0c\u5be6\u4f5c\u904e\u7a0b\u5c31\u662f\u627e\u53f0\u96fb\u8166\u5efa\u7acb\u300chomebridge \u300d\u6a4b\u63a5\u5668\uff0c\u4e26\u5728\u6a4b\u63a5\u5668\u4e0a\u5efa\u7acb\u865b\u64ec\u5468\u908a\u8207\u5305\u542b\u57f7\u884c\u7db2\u5740\u7684\u8a2d\u5b9a\uff08\u958b\/\u95dc\u51b7\u6c23\u7684\u52d5\u4f5c\u7db2\u5740\uff09\u3002\u7db2\u8def\u4e0a\u5927\u90e8\u5206\u7684\u6559\u5b78\u662f\u628a homebridge \u5b89\u88dd\u5728\u300c\u6a39\u8393\u6d3e\uff08Raspberry Pi\uff09\u300d\u4e0a\uff0c\u4e5f\u6709\u5c11\u90e8\u5206\u6559\u5b78\u662f\u5b89\u88dd\u5728 <a href=\"https:\/\/www.ubuntu-tw.org\/modules\/tinyd0\/\" target=\"_blank\">Ubuntu<\/a>\uff0c<a href=\"https:\/\/zhuanlan.zhihu.com\/p\/26484470\" target=\"_blank\">macOS<\/a>\uff0c\u6216 <a href=\"https:\/\/github.com\/nfarina\/homebridge\/wiki\/Install-Homebridge-on-Windows\" target=\"_blank\">Windows<\/a> \u3002\u6bcf\u7a2e\u4f5c\u696d\u7cfb\u7d71\u5b89\u88dd homebridge \u65b9\u5f0f\u96d6\u7136\u4e0d\u592a\u76f8\u540c\uff0c\u4f46\u4e5f\u662f\u5927\u540c\u5c0f\u7570\u3002<\/p>\n<p>\u7531\u65bc\u6211\u6c92\u6709\u6a39\u8393\u6d3e\uff08\u96d6\u7136\u4fbf\u5b9c\uff0c\u4f46\u4e00\u53f0\u4e5f\u8981\u4e00\u5169\u5343\u5143\uff09\uff0c\u6240\u4ee5\u6211\u662f\u63a1\u7528\u5efa\u7acb Ubuntu 14.04 (VirtualBox \u865b\u64ec\u6a5f)\u7684\u65b9\u5f0f\uff0c\u4f86\u5b89\u88dd\u555f\u52d5 homebridge \u670d\u52d9\u3002<a href=\"https:\/\/www.virtualbox.org\/\" target=\"_blank\">VirtualBox<\/a> \u8207 <a href=\"https:\/\/www.ubuntu-tw.org\/modules\/tinyd0\/\" target=\"_blank\">Ubuntu<\/a> \u4f5c\u696d\u7cfb\u7d71\u4e5f\u662f\u514d\u8cbb\u4e0b\u8f09\uff0c\u82b1\u8cbb 0 \u5143\u3002\u8207 Ubuntu \u7cfb\u51fa\u540c\u9580\u7684 <a href=\"https:\/\/www.debian.org\/index.zh-tw.html\" target=\"_blank\">Debian<\/a> \u4f5c\u696d\u7cfb\u7d71\uff08\u6b63\u78ba\u8aaa\u6cd5\u70ba Ubuntu \u662f Debian \u7684\u4e00\u9805\u5206\u652f\uff09\uff0c\u5728\u5b89\u88dd\u5b8c&nbsp;<a href=\"http:\/\/www.mauchiuan.com\/2016\/08\/debian-8-sudo-command-not-found.html\" target=\"_blank\">sudo<\/a> \u8207 \u8a2d\u5b9a <a href=\"http:\/\/uiop7890.pixnet.net\/blog\/post\/29385923\" target=\"_blank\">sudoers<\/a>&nbsp;\u4e4b\u5f8c\uff0c\u4e5f\u80fd\u4f7f\u7528\u4ee5\u4e0b\u76f8\u540c\u7684\u65b9\u5f0f\u5b89\u88dd homebridge \u670d\u52d9\u3002<\/p>\n<p>Ubuntu \u4f5c\u696d\u7cfb\u7d71\u958b\u555f\u7d42\u7aef\u6a5f\u8996\u7a97\uff0c\u4f9d\u5e8f\u57f7\u884c\u6307\u4ee4\u5982\u4e0b\uff1a<\/p>\n<p>1. \u57f7\u884c sudo apt-get update<\/p>\n<p>\u5982\u679c\u51fa\u73fe\u4ee5\u4e0b\u7684\u932f\u8aa4\u8a0a\u606f\uff1a<br \/>\nE: \u7121\u6cd5\u5c07 \/var\/lib\/dpkg\/lock \u9396\u5b9a &#8211; open (11: \u8cc7\u6e90\u66ab\u6642\u7121\u6cd5\u53d6\u5f97)<br \/>\nE: Unable to lock the administration directory (\/var\/lib\/dpkg\/), is another process using it?<\/p>\n<p>\u53ef\u57f7\u884c\u4ee5\u4e0b\u6307\u4ee4<br \/>\nsudo rm -rf \/var\/lib\/dpkg\/lock<\/p>\n<p>2. \u57f7\u884c sudo apt-get upgrade \u7b49\u4e00\u6bb5\u6642\u9593\uff0c\u9019\u908a\u8981\u7b49\u5f88\u4e45\uff0c14.04 \u865b\u64ec\u6a5f\u5927\u6982\u6703\u8dd110\u5e7e\u5206\u9418\u4ee5\u4e0a\uff0c\u751a\u81f3\u534a\u500b\u591a\u5c0f\u6642\u3002<\/p>\n<p>\u5982\u679c\u4e00\u4e0b\u5b50\u8dd1\u5b8c\uff0c\u53c8\u8aaa xx \u672a\u88ab\u5347\u7d1a\u7684\u8a71\uff0c\u53ef\u57f7\u884c<br \/>\napt-get dist-upgrade<\/p>\n<p>3. \u57f7\u884c\u4ee5\u4e0b\u547d\u4ee4<\/p>\n<p>sudo apt-get install -y samba screen git<br \/>\nsudo apt-get install curl<br \/>\ncurl -sL https:\/\/deb.nodesource.com\/setup_6.x | sudo -E bash &#8211;<br \/>\nsudo apt-get install -y nodejs<br \/>\nsudo npm install node-gyp<br \/>\nsudo apt-get install libavahi-compat-libdnssd-dev<\/p>\n<p>\n4. \u5b89\u88dd&nbsp;homebridge<br \/>\n\u57f7\u884c sudo npm install -g &#8211;unsafe-perm homebridge<\/p>\n<p>\u4e0d\u904e&nbsp;Ubuntu 14.04 \u5f88\u53ef\u80fd\u6703\u9047\u5230\u4ee5\u4e0b\u7684\u932f\u8aa4\u8a0a\u606f<\/p>\n<p>nas@nas:~$ sudo npm install -g &#8211;unsafe-perm homebridge<br \/>\n\/usr\/bin\/homebridge -&gt; \/usr\/lib\/node_modules\/homebridge\/bin\/homebridge<\/p>\n<p>&gt; mdns@2.3.3 install \/usr\/lib\/node_modules\/homebridge\/node_modules\/mdns<br \/>\n&gt; node-gyp rebuild<\/p>\n<p>make: Entering directory `\/usr\/lib\/node_modules\/homebridge\/node_modules\/mdns\/build&#8217;<br \/>\nCXX(target) Release\/obj.target\/dns_sd_bindings\/src\/dns_sd.o<br \/>\nmake: g++: Command not found<br \/>\nmake: *** [Release\/obj.target\/dns_sd_bindings\/src\/dns_sd.o] Error 127<br \/>\nmake: Leaving directory `\/usr\/lib\/node_modules\/homebridge\/node_modules\/mdns\/build&#8217;<br \/>\ngyp ERR! build error<br \/>\ngyp ERR! stack Error: `make` failed with exit code: 2<\/p>\n<p>&nbsp;<\/p>\n<p>\u53ef\u57f7\u884c\u4ee5\u4e0b\u4e94\u884c\u6307\u4ee4\u4fee\u6b63\u554f\u984c<\/p>\n<p>sudo rm -rf \/usr\/lib\/node_modules\/<br \/>\nsudo apt-get install build-essential<br \/>\nsudo apt-get install libkrb5-dev<br \/>\nsudo apt-get remove nodejs<br \/>\nsudo apt-get install nodejs<\/p>\n<p>\u4e4b\u5f8c\u518d\u57f7\u884c\u4e00\u6b21 &nbsp;sudo npm install -g &#8211;unsafe-perm homebridge \u8a66\u8a66\u770b\u3002<\/p>\n<p>\n5. \u6e2c\u8a66 homebridge<br \/>\n\u8f38\u5165homebridge<\/p>\n<p>\u56de\u61c9<br \/>\n&#8230;&#8230;<br \/>\nScan this code with your HomeKit App on your iOS device to pair with Homebridge:<\/p>\n<p>\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510<br \/>\n\u2502 031-45-154 \u2502<br \/>\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518<\/p>\n<p>[2017-08-02 16:12:05] Homebridge is running on port 43761.<\/p>\n<p>\u5982\u679c\u51fa\u73fe\u53cd\u767d\u914d\u5c0d\u78bc\u300c XXX-XX-XXX\u300d\u7684\u8a0a\u606f\uff0c\u8868\u793a homebridge \u5b89\u88dd\u5b8c\u6210\u3002<\/p>\n<p><img decoding=\"async\" alt=\"\u87a2\u5e55\u5feb\u7167 2017-08-05 \u4e0a\u534812.51.04\" border=\"0\" src=\"https:\/\/pic.pimg.tw\/benjenq\/1501865493-3094847711.png\" title=\"\u87a2\u5e55\u5feb\u7167 2017-08-05 \u4e0a\u534812.51.04\"><\/p>\n<p>\u9019\u6642\u5019\u5c31\u53ef\u4ee5\u6253\u958b iOS 10 \u624b\u6a5f\u7684\u300c\u5bb6\u5ead App\u300d\u4e86\uff0c\u4e00\u8def\u5faa\u6307\u793a\u958b\u555f iCloud \u7684\u300c\u5bb6\u5ead\u300d\u6b0a\u9650&#8211;&gt;\u65b0\u589e\u914d\u4ef6\uff0c\u5c31\u80fd\u770b\u5230\u6709\u500b\u53eb\u300cHomebridge\u300d\u7684\u88dd\u7f6e\u986f\u793a\u5728\u6e05\u55ae\u4e0a\u3002<\/p>\n<p><img decoding=\"async\" alt=\"IMG_1602\" border=\"0\" src=\"https:\/\/pic.pimg.tw\/benjenq\/1501865800-192860899_l.png\" title=\"IMG_1602\"><\/p>\n<p>\u4e0d\u904e\u9019\u500b\u6642\u5019\u5148\u5225\u6025\u8457\u8a2d\u5b9a\uff0c\u56e0\u70ba\u6a4b\u63a5\u5668\u9084\u6c92\u6709\u639b\u4e0a\u865b\u64ec\u5468\u908a\u53ef\u4f9b\u9078\u53d6\u3002\u5148\u6309\u300c\u53d6\u6d88\u300d\u96e2\u958b\uff0c\u56de\u5230 Ubuntu \u96fb\u8166\u9032\u884c\u64cd\u4f5c\u3002<\/p>\n<p><strong>(2) \u5b89\u88dd homebridge \u63d2\u4ef6<\/strong><\/p>\n<p>homebridge \u63d2\u4ef6\u7684\u76ee\u7684\uff0c\u5c31\u662f\u5efa\u7acb\u865b\u64ec\u5468\u908a\u8a2d\u5099\u639b\u9032&nbsp;homebridge \u6a4b\u63a5\u5668\u670d\u52d9\uff0c\u4e26\u8a2d\u5b9a\u865b\u64ec\u5468\u908a\u7684\u52d5\u4f5c\u6307\u4ee4\u3002\u6709\u4e0a\u767e\u7a2e\u63d2\u4ef6\u4efb\u541b\u6311\u9078\uff0c\u6bcf\u4e00\u7a2e\u63d2\u4ef6\u90fd\u6709\u4e0d\u540c\u7684\u9031\u908a\u8a2d\u5099\u4f5c\u7528\u65b9\u5f0f\u3002\u8981\u9078\u54ea\u500b\u63d2\u4ef6\u53ef\u4ee5\u5230<a href=\"https:\/\/www.npmjs.com\/browse\/keyword\/homebridge-plugin\" target=\"_blank\">\u9019\u88e1\u641c\u5c0b<\/a>\uff1a<\/p>\n<p><img decoding=\"async\" alt=\"homebridge-plugin\" border=\"0\" src=\"https:\/\/pic.pimg.tw\/benjenq\/1501866597-2217463869.png\" title=\"homebridge-plugin\"><\/p>\n<p>\u63d2\u4ef6\u7684\u529f\u80fd\u53ef\u8aaa\u662f\u73b2\u746f\u6eff\u76ee\uff0c\u5766\u767d\u8aaa\u8981\u641e\u61c2\u63d2\u4ef6\u7684\u904b\u4f5c\u8207\u8a2d\u5b9a\u65b9\u5f0f\u5be6\u5728\u4e0d\u5bb9\u6613\uff0c\u56e0\u70ba\u6bcf\u4e00\u7a2e\u7684\u4f5c\u7528\u8207\u76ee\u7684\u90fd\u4e0d\u540c\uff0c\u751a\u81f3\u8d85\u51fa\u300c\u5468\u908a\u5bb6\u96fb\u300d\u7684\u65e2\u5b9a\u5370\u8c61\u3002\u4f8b\u5982\u9019\u500b\u300c<a href=\"https:\/\/www.npmjs.com\/package\/homebridge-openweathermap-temperature\" target=\"_blank\">homebridge-openweathermap-temperature<\/a>\u300d\u63d2\u4ef6\uff0c\u5c31\u662f\u6a21\u64ec\u4e00\u500b\u6eab\u5ea6\u8a08\u5468\u908a\uff0c\u7528\u4f86\u986f\u793a OpenWeather \u5929\u6c23\u670d\u52d9\u7db2\u7ad9\u7684\u67d0\u6307\u5b9a\u57ce\u5e02\u73fe\u5728\u6c23\u6eab\u3002<\/p>\n<p>\u5148\u7528\u9019\u500b\u63d2\u4ef6\u70ba\u4f8b\uff0c\u5b89\u88dd\u7684\u65b9\u5f0f\u70ba\uff1a<\/p>\n<p>A. \u958b\u555f\u7d42\u7aef\u6a5f\uff0c\u57f7\u884c\u547d\u4ee4&nbsp;sudo npm install -g homebridge-openweathermap-temperature<\/p>\n<p>B. \u5728 ~\/.homebridge\/ \u5efa\u7acb\uff08\u6216\u4fee\u6539\uff09config.json\uff0c\u6587\u5b57\u5167\u5bb9\u5982\u4e0b\uff1a<\/p>\n<pre>{\n\"bridge\": {\n\"name\": \"\u63a7\u5236\u4e2d\u5fc3\",\n\"username\": \"AB:CD:EF:12:34:56\",\n\"port\": 51826,\n\"pin\": \"123-45-678\"\n},\n\"description\": \"HomeBridge HTTP Status Control\",\n\"accessories\": [\n{\n\"accessory\": \"OpenweathermapTemperature\",\n\"name\": \"\u53f0\u5357\u5e02\u6eab\u5ea6\",\n\"url\": \"http:\/\/api.openweathermap.org\/data\/2.5\/weather?q=Tainan&amp;appid=[apikey\u9700\u8a3b\u518aOpenWeather\u5e33\u865f\u53d6\u5f97]\"\n}\n]\n}<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"config_json\" border=\"0\" height=\"451\" src=\"https:\/\/pic.pimg.tw\/benjenq\/1501868738-2859720769.png\" title=\"config_json\" width=\"639\"><\/p>\n<p>C.\u7d42\u7aef\u6a5f\u57f7\u884c homebridge \u6307\u4ee4<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\u87a2\u5e55\u5feb\u7167 2017-08-05 \u4e0a\u53482.00.46\" border=\"0\" height=\"508\" src=\"https:\/\/pic.pimg.tw\/benjenq\/1501869713-53193962.png?v=1501869714\" title=\"\u87a2\u5e55\u5feb\u7167 2017-08-05 \u4e0a\u53482.00.46\" width=\"640\"><\/p>\n<p>\u770b\u5230 Load x accessories&#8230; \u4ee5\u53ca\u914d\u5c0d\u7684 XXX-XX-XX \u8a0a\u606f\u6642\uff0c\u5c31\u8868\u793a homebridge \u548c\u914d\u4ef6\u90fd\u6210\u529f\u639b\u8f09\u555f\u52d5\u4e86\u3002<\/p>\n<p>\u82e5\u8981\u8b93 homebridge \u65bc\u6bcf\u6b21 Ubuntu \u958b\u6a5f\u6642\u81ea\u52d5\u57f7\u884c\uff0c\u8acb\u53c3\u8003<a href=\"https:\/\/github.com\/nfarina\/homebridge\/wiki\/Homebridge-autostart-at-boot-(init.d)-on-Ubuntu-(linux)\" target=\"_blank\">\u9019\u88e1<\/a>\u3002<\/p>\n<p>D.&nbsp;\u56de\u5230 iOS 10 \u7684\u300c\u5bb6\u5ead App\u300d\uff0c\u4f9d\u7167\u756b\u9762\u6307\u793a\u8a2d\u5b9a\u5c31\u884c\u4e86\u3002<\/p>\n<p><img decoding=\"async\" alt=\"IMG_1603\" border=\"0\" src=\"https:\/\/pic.pimg.tw\/benjenq\/1501870740-1223229699.png?v=1501870742\" title=\"IMG_1603\"><\/p>\n<p>\u6700\u5f8c\u5c31\u80fd\u5728\u300c\u5bb6\u5ead App\u300d\u770b\u5230\u4e00\u500b\u914d\u4ef6\uff0c\u5167\u5bb9\u986f\u793a OpenWeather \u67e5\u8a62\u7684\u57ce\u5e02\u6eab\u5ea6\u3002<\/p>\n<p>\u4e5f\u53ef\u4ee5\u547c\u53eb Siri \u7528\u8b1b\u7684\u7d66\u4f60\u807d\u3002\u4e0d\u904e\u56e0\u70ba\u662f\u300c\u5bb6\u5ead\u5468\u908a\u914d\u4ef6\u300d\uff0c\u554f Siri \u7684\u6642\u5019\u8981\u554f\u300c\u5bb6\u88cf\u6eab\u5ea6\u300d\u624d\u6703\u986f\u793a\u914d\u4ef6\u6578\u5b57\uff0c\u82e5\u662f\u53ea\u554f\u300c\u6eab\u5ea6\u300d\u6216\u300c\u5ba4\u5916\u6eab\u5ea6\u300d\uff0c\u5b83\u5c31\u6703\u627e iOS \u5167\u5efa\u7684\u5929\u6c23\u9810\u5831\u670d\u52d9\uff0c\u800c\u4e0d\u662f Homekit \u3002<\/p>\n<p><img decoding=\"async\" alt=\"IMG_1609\" border=\"0\" src=\"https:\/\/pic.pimg.tw\/benjenq\/1501871476-2292595896.png\" title=\"IMG_1609\"> &nbsp;<\/p>\n<p>\u641e\u61c2\u5982\u4f55\u639b\u8f09\u63d2\u4ef6\u7684\u65b9\u6cd5\u5f8c\uff0c\u63a5\u8457\u5c31\u53ef\u4ee5\u9078\u64c7\u9069\u5408\u7684\u63d2\u4ef6\uff0c\u900f\u904e HTTP \u7db2\u5740\u4f86\u57f7\u884c\u51b7\u6c23\u7684\u958b\u95dc\u52d5\u4f5c\u4e86\u3002\u6211\u627e\u5230\u7b26\u5408\u6709\u300c\u958b\u300d\u8207\u300c\u95dc\u300d\u5c0d\u61c9\u52d5\u4f5c\u7db2\u5740\u7684\u63d2\u4ef6\u662f\u300c<a href=\"https:\/\/www.npmjs.com\/package\/homebridge-http\" target=\"_blank\">homebridge-http<\/a>\u300d<\/p>\n<p>sudo npm install -g homebridge-http<\/p>\n<p>\u63a5\u8457\u7de8\u8f2f config.json \u5167\u5bb9\uff0c\u5728\u300c&#8221;accessories&#8221;\u300d\u7bc0\u9ede\u5167\u63d2\u5165\u4ee5\u4e0b\u5167\u5bb9\uff1a<\/p>\n<pre>{\n\"accessory\": \"Http\",\n\"name\": \"\u51b7\u6c23\",\n\"switchHandling\": \"realtime\",\n\"http_method\": \"GET\",\n\"on_url\": \"http:\/\/[\u958b\u51b7\u6c23\u7684\u7db2\u5740]\",\n\"off_url\": \"http:\/\/[\u95dc\u51b7\u6c23\u7684\u7db2\u5740]\",\n\"status_on\": \"ON\",\n\"status_off\": \"OFF\",\n\"service\": \"Switch\",\n\"sendimmediately\": \"\",\n\"username\": \"\",\n\"password\": \"\"\n}<\/pre>\n<p><img decoding=\"async\" alt=\"\u87a2\u5e55\u5feb\u7167 2017-08-05 \u4e0a\u53482.52.02\" border=\"0\" src=\"https:\/\/pic.pimg.tw\/benjenq\/1501872915-3925925588.png\" title=\"\u87a2\u5e55\u5feb\u7167 2017-08-05 \u4e0a\u53482.52.02\"><\/p>\n<p>\u91cd\u65b0\u57f7\u884c homebridge \u4e4b\u5f8c\uff0c\u300c\u5bb6\u5ead App\u300d\u5c31\u53ef\u4ee5\u770b\u5230\u5169\u500b\u914d\u4ef6\u6309\u9215\u3002\u53ef\u4ee5\u9ede\u64ca\u51b7\u6c23\u914d\u4ef6\u6309\u9215\u9032\u884c\u958b\u6216\u95dc\u7684\u52d5\u4f5c\u3002<\/p>\n<p><img decoding=\"async\" alt=\"IMG_1613\" border=\"0\" src=\"https:\/\/pic.pimg.tw\/benjenq\/1501873433-4226728783_l.png\" title=\"IMG_1613\"><\/p>\n<p>\u4e0d\u904e\u9019\u500b\u63d2\u4ef6\u9047\u5230\u7db2\u8def\u554f\u984c\u6642\u6703\u767c\u751f\u627e\u4e0d\u5230 callback \u51fd\u6578\u7684 BUG \u800c\u8df3\u51fa\uff0c\u4fee\u6b63\u65b9\u5f0f\uff1a&nbsp;<\/p>\n<pre>\/usr\/lib\/node_modules\/homebridge-http\/index.js\n\u5f9e\u7b2c 11 \u884c\u52a0\u5165\n&nbsp;&nbsp; &nbsp;function callback(error){\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;if(error){\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;console.log('HTTP function failed: %s', error.message);\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;else{\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;console.log('HTTP function done with No Error...');\n&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}\n&nbsp;&nbsp; &nbsp;}\n<\/pre>\n<p>\u63d2\u4ef6\u53ef\u4ee5\u4e00\u76f4\u52a0\u639b\u9032 homebridge \u6a4b\u63a5\u5668\u5167\uff0c\u4f8b\u5982\u518d\u7e7c\u7e8c\u52a0\u639b\u300c<a href=\"https:\/\/www.npmjs.com\/package\/homebridge-httptemperaturehumidity\" target=\"_blank\">homebridge-httptemperaturehumidity<\/a>\u300d\u5c31\u53ef\u4ee5\u900f\u904e HTTP \u5354\u5b9a\u53d6\u5f97\u5bb6\u88cf\u7684 ESP8266+DHT22 \u6eab\u6fd5\u5ea6\u6578\u503c\uff0c\u4e26\u900f\u904e Siri \u8a9e\u97f3\u63a7\u5236\u9019\u4e9b\u5468\u908a\u3002<\/p>\n<p><img decoding=\"async\" alt=\"IMG_1598\" border=\"0\" src=\"https:\/\/pic.pimg.tw\/benjenq\/1501833031-1351108483_l.png\" title=\"IMG_1598\"><\/p>\n<p>sudo&nbsp;npm install -g homebridge-http-temperature-humidity<\/p>\n<p>\u9019\u500b\u63d2\u4ef6\u4e5f\u6709\u985e\u4f3c\u7684\u554f\u984c\uff0c\u4fee\u6b63\u65b9\u5f0f\uff1a&nbsp;<\/p>\n<pre>1. \u4fee\u6539 \/usr\/lib\/node_modules\/homebridge-http-temperature-humidity\/index.js\n\u5728 var res = request(this.http_method, this.url,{}); \u8207 if(res.statusCode &gt; 400){ \u4e4b\u9593\u52a0\u5165\nvar res = request(this.http_method, this.url,{});\nif (typeof res === 'undefined'){\nthis.log('HTTP power function NOT succeeded : undefined');\nthis.temperature = -1;\nthis.humidity = -1;\ncallback(null, this.temperature);\n}\nelse if(res.statusCode &gt; 400){<\/pre>\n<p>&nbsp;<\/p>\n<p>2. \u4fee\u6539&nbsp;\/usr\/lib\/node_modules\/homebridge-http-temperature-humidity\/node_modules\/sync-request\/index.js \uff0c\u76ee\u7684\u662f\u4fee\u6b63\u53ef\u80fd\u56e0\u7db2\u8def\u554f\u984c\u9020\u6210 Javascript \u7a0b\u5f0f\u932f\u8aa4\u6216 JSON.parse \u65b9\u6cd5\u5361\u6b7b\u7684\u73fe\u8c61\uff0c\u4fee\u6539\u5167\u5bb9\u91cd\u9ede\u5728\u300c\u6a19\u8a18 throw error \u65b9\u6cd5\u300d\u8207\u300c\u589e\u52a0 resErr \u8b8a\u6578\u300d\u7684\u5224\u65b7\uff0c\u624d\u4e0d\u81f3\u65bc\u8b93\u932f\u8aa4\u7d50\u679c\u8aa4\u9032 JSON \u89e3\u6790\u7a0b\u5e8f\u7522\u751f\u5176\u4ed6\u554f\u984c\u3002<\/p>\n<pre>'use strict';\nvar fs = require('fs');\nvar spawnSync = require('child_process').spawnSync || require('spawn-sync');\nvar HttpResponse = require('http-response-object');\nrequire('concat-stream');\nrequire('then-request');\nvar JSON = require('.\/lib\/json-buffer');\nFunction('', fs.readFileSync(require.resolve('.\/lib\/worker.js'), 'utf8'));\nmodule.exports = doRequest;\nfunction doRequest(method, url, options) {\nvar req = JSON.stringify({\nmethod: method,\nurl: url,\noptions: options\n});\nvar res = spawnSync(process.execPath, [require.resolve('.\/lib\/worker.js')], {input: req});\n<strong>var resErr = 0;<\/strong>\nif (res.status !== 0) {\nconsole.log('doRequest res.stderr.toString: %s',res.stderr.toString());\n<strong>resErr = 1;<\/strong>\n<strong>\/\/<\/strong>throw new Error(res.stderr.toString());\n}\nif (res.error) {\nif (typeof res.error === 'string') res.error = new Error(res.error);\nconsole.log('doRequest res.error === string ');\n<strong>resErr = 1;<\/strong>\n<strong>\/\/<\/strong>throw res.error;\n}\nif (resErr === 0){\nvar response = JSON.parse(res.stdout);\nif (typeof response === 'undefined'){\nconsole.log('httptemperaturehumidity: response JSON is undefined');\n}\nelse if (response.success) {\nreturn new HttpResponse(response.response.statusCode, response.response.headers, response.response.body, response.response.url);\n} else {\nconsole.log('response not success: %s',response.error.message);\n\/\/throw new Error(response.error.message || response.error || response);\n}\n}\n}<\/pre>\n<p>\u82e5\u662f iPhone 6s \u4ee5\u5f8c\u7684\u8a2d\u5099\uff08\u652f\u63f4\u514d\u63d2\u96fb\u6e90\u7dda\u547c\u53eb Siri\uff09\uff0c\u6216\u662f\u5bb6\u88e1\u64fa\u4e00\u53f0 <a href=\"https:\/\/www.apple.com\/homepod\/\" target=\"_blank\">Homepod<\/a>&nbsp;\uff0c\u5c31\u80fd\u5be6\u73fe\u5b8c\u5168\u4e0d\u9700\u52d5\u624b\uff0c\u56de\u5230\u5bb6\u51fa\u4e00\u5f35\u5634\u558a\u500b Siri \u5c31\u884c\u4e86\uff0c\u6572\u65b9\u4fbf\u3002<\/p>\n<p>\u5be6\u969b\u904b\u4f5c\u5f71\u7247<\/p>\n<p><iframe loading=\"lazy\" allowfullscreen=\"\" class=\"\" frameborder=\"0\" height=\"360\" src=\"https:\/\/www.youtube.com\/embed\/S8nEkaZa_NU?wmode=transparent\" title=\"YouTube video player\" width=\"640\"><\/iframe><\/p>\n<p>\u6210\u672c\u7e3d\u7d50\uff1a<\/p>\n<ul>\n<li>NodeMCU x 1 : NT 120.-<\/li>\n<li>\u7d05\u5916\u7dda LED \/ NPN \u96fb\u6676\u9ad4 x1 \uff1a 10\u5143 \u6709\u627e<\/li>\n<\/ul>\n<p>\u5176\u4ed6\u5fc5\u5099\u689d\u4ef6\uff1a<\/p>\n<ul>\n<li>Micro USB \u9023\u63a5\u7dda<\/li>\n<li>\u500b\u4eba\u96fb\u8166\u4e00\u53f0\uff08\u64b0\u5beb Arduino Code \uff0c\u5efa\u7f6e Homebridge \u74b0\u5883\uff09<\/li>\n<li>\u884c\u52d5\u96fb\u6e90 \u6216 USB \u5145\u96fb\u5668 \u6216 \u96fb\u8166\u7684 USB \u9023\u63a5\u57e0\uff08\u53ef\u63d0\u4f9b 5V USB \u9023\u63a5\u57e0\uff09<\/li>\n<li>iPhone \u624b\u6a5f\u4e00\u652f\u6216 iPad\uff08\u9700\u652f\u63f4 iOS 10\uff0c\u6700\u4f4e\u8981\u6c42\u70ba iPhone 5 \/ iPad 4th \/ iPad min\uff09<\/li>\n<li>\u5bb6\u88e1\u5340\u57df\u7db2\u8def\uff0c\u8207\u53ef\u9023\u4e0a iCloud \u7684\u74b0\u5883\u3002<\/li>\n<\/ul>\n<p>\u88dc\u5145\uff1a<\/p>\n<p>1. \u96fb\u8166\u555f\u52d5\u6642\u57f7\u884c homebridge\uff08\u9069\u7528\u65bc\u6a39\u8393\u6d3e\uff09<\/p>\n<p>\u7d42\u7aef\u6a5f\u4e2d\u57f7\u884c<\/p>\n<p>$ sudo nano \/etc\/xdg\/autostart\/homebridge.desktop<\/p>\n<p>\u586b\u5165\u4ee5\u4e0b\u5167\u5bb9\uff1a<\/p>\n<p>[Desktop Entry]<br \/>\nName=homebridge<br \/>\nType=Application<br \/>\nExec=lxterminal -e &#8220;homebridge&#8221;<br \/>\nTerminal=true<br \/>\nComment=system monitoring tool.<br \/>\nCategories=Utility;<\/p>\n<p>\u6309 Ctrl + X \u5b58\u64cb\u96e2\u958b\u3002<\/p>\n<p>2. \u6a39\u8393\u6d3e\u5347\u7d1a\u5230 Buster \u7248\u672c\u5f8c\uff0cnodejs \u88ab\u5f37\u5236\u5347\u7d1a\u5230 10 \u7248\uff0cnpm \u4e0d\u6703\u96a8 nodejs \u5b89\u88dd\u3002\u7528 apt \u5b89\u88dd npm \u7684\u7248\u672c\u662f 5.x \uff0c\u5fc5\u9808\u5347\u7d1a\u5230 npm 6.x \u624d\u80fd\u652f\u63f4&nbsp;nodejs 10 \u3002<\/p>\n<p>$ sudo apt install npm<br \/>\n$ sudo npm install -g npm@6<\/p>\n<p>3.&nbsp;homebridge \u6307\u5b9a\u7db2\u5361\u670d\u52d9<\/p>\n<p>\u4ee5\u6a39\u8393\u6d3e 3B\/+\/4 \u70ba\u4f8b\uff1a\u6a39\u8393\u6d3e\u4e3b\u6a5f\u4e0a\u6709\u7121\u7dda\u7db2\u8def\u548c\u6709\u7dda\u7db2\u8def\uff0chomebridge \u53ea\u80fd\u5728\u5176\u4e2d\u4e00\u500b\u7db2\u8def\u4e0a\u555f\u52d5\u3002\u82e5\u5e0c\u671b\u5f37\u5236\u5728\u6307\u5b9a\u7684\u7db2\u5361\u4e0a\u555f\u7528\u670d\u52d9\u6642\uff0c\u5fc5\u9808\u5728&nbsp;config.json \u5167\u6307\u5b9a mdns \u53c3\u6578\uff0c\u5982\u4e0b<\/p>\n<pre>{\n\"mdns\":{ \"interface\": \"\u7db2\u8def\u5361\u7684 IP \u4f4d\u5740\uff0c\u4f8b\u5982 192.168.1.100\" },\n\"bridge\": {\n... \u7701\u7565...\n},\n}\n<\/pre>\n<p>4. \u5176\u4ed6\u53ef\u7528\u63d2\u4ef6<\/p>\n<p>4.1&nbsp;homebridge-http-temperature-sensor (<a href=\"https:\/\/www.npmjs.com\/package\/homebridge-http-temperature-sensor\" target=\"_blank\">\u7db2\u5740<\/a>)<\/p>\n<p>\u529f\u80fd\u8aaa\u660e\uff1a\u900f\u904e\u7db2\u5740\u53d6\u5f97\u6eab\u5ea6\u6578\u5b57\u3002<\/p>\n<p>\u5b89\u88dd\uff1a<br \/>\nsudo npm install -g homebridge-http-temperature-sensor<\/p>\n<p>config.json \u7bc4\u4f8b<\/p>\n<pre>    {\n\"accessory\": \"HTTP-TEMPERATURE\",\n\"name\": \"\u88dd\u7f6e\u6eab\u5ea6\",\n\"unit\": \"celsius\",\n\"getUrl\": \"API \u7db2\u5740\",\n\"pullInterval\": 5000\n}\n<\/pre>\n<p>API \u7db2\u5740\u56de\u61c9\uff1a\u6eab\u5ea6\u6d6e\u9ede\u6578<\/p>\n<p>\u61c9\u7528\uff1a\u6a39\u8393\u6d3e\u7684\u6eab\u5ea6\uff08\u8b80\u53d6&nbsp;\/sys\/class\/thermal\/thermal_zone0\/temp \u5167\u5bb9\u4e26\u8f49\u63db\u70ba\u7db2\u5740\u670d\u52d9\uff09\u3002<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e0d\u4e45\u524d\u5728 Youtube \u4e0a\u770b\u5230\u4e00\u5247\u5f71\u7247\uff0c\u4e3b\u89d2\u53ea\u51fa\u4e00\u5f35\u5634\uff0c\u5c31\u80fd\u900f\u904e Siri \u8b93\u5bb6\u88e1\u7684\u96fb\u5668\u7528\u54c1\u4e56\u4e56\u807d\u8a71\uff0c\u5c31\u50cf\u5c0f [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-container-style":"default","site-container-layout":"default","site-sidebar-layout":"default","disable-article-header":"default","disable-site-header":"default","disable-site-footer":"default","disable-content-area-spacing":"default","footnotes":""},"categories":[55],"tags":[],"class_list":["post-3823","post","type-post","status-publish","format-standard","hentry","category-55"],"_links":{"self":[{"href":"http:\/\/benjenq.ddns.net\/blog\/wp-json\/wp\/v2\/posts\/3823","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/benjenq.ddns.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/benjenq.ddns.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/benjenq.ddns.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/benjenq.ddns.net\/blog\/wp-json\/wp\/v2\/comments?post=3823"}],"version-history":[{"count":0,"href":"http:\/\/benjenq.ddns.net\/blog\/wp-json\/wp\/v2\/posts\/3823\/revisions"}],"wp:attachment":[{"href":"http:\/\/benjenq.ddns.net\/blog\/wp-json\/wp\/v2\/media?parent=3823"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/benjenq.ddns.net\/blog\/wp-json\/wp\/v2\/categories?post=3823"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/benjenq.ddns.net\/blog\/wp-json\/wp\/v2\/tags?post=3823"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}