{"id":686,"date":"2017-04-29T21:25:34","date_gmt":"2017-04-29T13:25:34","guid":{"rendered":"https:\/\/xujiwei.com\/blog\/?p=686"},"modified":"2017-04-29T21:25:34","modified_gmt":"2017-04-29T13:25:34","slug":"homeautomation-espeasy","status":"publish","type":"post","link":"https:\/\/xujiwei.com\/blog\/2017\/04\/homeautomation-espeasy\/","title":{"rendered":"\u73a9\u73a9\u667a\u80fd\u5bb6\u5c452\uff1aESPEasy"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_65 ez-toc-wrap-right counter-hierarchy ez-toc-counter ez-toc-light-blue ez-toc-container-direction\">\n<p class=\"ez-toc-title\">\u6587\u7ae0\u76ee\u5f55<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-69e41b86af182\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-69e41b86af182\"  aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/xujiwei.com\/blog\/2017\/04\/homeautomation-espeasy\/#1_ESP8266\" title=\"1. ESP8266\">1. ESP8266<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/xujiwei.com\/blog\/2017\/04\/homeautomation-espeasy\/#2_NodeMCU\" title=\"2. NodeMCU\">2. NodeMCU<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/xujiwei.com\/blog\/2017\/04\/homeautomation-espeasy\/#3_ESPEasy\" title=\"3. ESPEasy\">3. ESPEasy<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/xujiwei.com\/blog\/2017\/04\/homeautomation-espeasy\/#31_%E5%A4%9A%E7%A7%8D%E6%9C%8D%E5%8A%A1%E5%99%A8%E6%94%AF%E6%8C%81\" title=\"3.1 \u591a\u79cd\u670d\u52a1\u5668\u652f\u6301\">3.1 \u591a\u79cd\u670d\u52a1\u5668\u652f\u6301<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/xujiwei.com\/blog\/2017\/04\/homeautomation-espeasy\/#32_%E6%8F%92%E4%BB%B6%E5%8A%9F%E8%83%BD\" title=\"3.2 \u63d2\u4ef6\u529f\u80fd\">3.2 \u63d2\u4ef6\u529f\u80fd<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/xujiwei.com\/blog\/2017\/04\/homeautomation-espeasy\/#33_%E4%BA%8B%E4%BB%B6%E8%A7%84%E5%88%99\" title=\"3.3 \u4e8b\u4ef6\u89c4\u5219\">3.3 \u4e8b\u4ef6\u89c4\u5219<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/xujiwei.com\/blog\/2017\/04\/homeautomation-espeasy\/#34_%E8%AE%BE%E5%A4%87%E9%85%8D%E7%BD%91\" title=\"3.4 \u8bbe\u5907\u914d\u7f51\">3.4 \u8bbe\u5907\u914d\u7f51<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/xujiwei.com\/blog\/2017\/04\/homeautomation-espeasy\/#4_ESPEasy_Plugin\" title=\"4. ESPEasy Plugin\">4. ESPEasy Plugin<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/xujiwei.com\/blog\/2017\/04\/homeautomation-espeasy\/#41_Task_Pin\" title=\"4.1 Task Pin\">4.1 Task Pin<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/xujiwei.com\/blog\/2017\/04\/homeautomation-espeasy\/#42_Configuration\" title=\"4.2 Configuration\">4.2 Configuration<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/xujiwei.com\/blog\/2017\/04\/homeautomation-espeasy\/#43_Timer\" title=\"4.3 Timer\">4.3 Timer<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/xujiwei.com\/blog\/2017\/04\/homeautomation-espeasy\/#5_PlatformIO\" title=\"5. PlatformIO\">5. PlatformIO<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/xujiwei.com\/blog\/2017\/04\/homeautomation-espeasy\/#6_Plugins\" title=\"6. Plugins\">6. Plugins<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/xujiwei.com\/blog\/2017\/04\/homeautomation-espeasy\/#61_MH-Z19\" title=\"6.1 MH-Z19\">6.1 MH-Z19<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/xujiwei.com\/blog\/2017\/04\/homeautomation-espeasy\/#62_PMS5003\" title=\"6.2 PMS5003\">6.2 PMS5003<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/xujiwei.com\/blog\/2017\/04\/homeautomation-espeasy\/#63_Switch\" title=\"6.3 Switch\">6.3 Switch<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-17\" href=\"https:\/\/xujiwei.com\/blog\/2017\/04\/homeautomation-espeasy\/#7_%E5%8F%82%E8%80%83%E8%B5%84%E6%96%99\" title=\"7. \u53c2\u8003\u8d44\u6599\">7. \u53c2\u8003\u8d44\u6599<\/a><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"1_ESP8266\"><\/span>1. ESP8266<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>ESP8266 \u662f\u4e50\u946b\u63a8\u51fa\u7684\u4e00\u6b3e\u4f4e\u529f\u8017\u9ad8\u96c6\u6210\u5ea6\u7684 Wi-Fi \u82af\u7247\uff0c\u4ef7\u683c\u4f4e\uff0cI2C\u3001SPI\u3001ADC \u7b49\u63a5\u53e3\u4e00\u5e94\u5177\u5168\uff0c\u975e\u5e38\u9002\u5408\u4f5c\u4e3a\u4e2a\u4eba DIY \u7684\u5355\u7247\u673a\u4f7f\u7528\u3002<\/p>\n<h2><span class=\"ez-toc-section\" id=\"2_NodeMCU\"><\/span>2. NodeMCU<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>NodeMCU \u662f\u57fa\u4e8e ESP8266 ESP-12E \u505a\u7684\u4e00\u4e2a\u5f00\u53d1\u677f\uff0c\u96c6\u6210\u4e86 Micro USB \u8f93\u5165\uff0c4M Flash\uff0c\u5f00\u53d1\u65f6\u4f7f\u7528\u8d77\u6765\u66f4\u65b9\u4fbf\u3002<\/p>\n<p>NodeMCU \u9ed8\u8ba4\u662f\u4f7f\u7528 Lua \u4f5c\u4e3a\u5f00\u53d1\u8bed\u8a00\u7684\uff0c\u4f46\u662f\u501f\u52a9\u4e8e ESP8266 Arduino \u9879\u76ee\uff0c\u5c31\u53ef\u4ee5\u62ff NodeMCU \u5f53 Arduino \u5f00\u53d1\u677f\u6765\u4f7f\u7528\u4e86\uff0c\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528 Arduino IDE \u6216\u8005 PlatformIO \u6765\u5f00\u53d1\u3002<\/p>\n<p><img src=\"https:\/\/xujiwei.com\/blog\/wp-content\/uploads\/2017\/04\/espeasy2-nodemcu.png\" alt=\"\" width=\"356\" class=\"alignnone size-full wp-image-688\" \/><\/p>\n<h2><span class=\"ez-toc-section\" id=\"3_ESPEasy\"><\/span>3. ESPEasy<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>ESPEasy \u662f LetsControlIt.com \u5f00\u53d1\u7684\u4e00\u4e2a\u5f00\u6e90 MCU \u56fa\u4ef6\uff0c\u4e13\u95e8\u7528\u4e8e IoT \u8bbe\u5907\u3002\u901a\u8fc7 ESPEasy\uff0c\u53ef\u4ee5\u5f88\u65b9\u4fbf\u5730\u4f7f\u7528 ESP8266 \u7cfb\u5217 MCU \u6765\u7ec4\u6210\u5bb6\u5ead\u4f20\u611f\u5668\u7f51\u7edc\uff0c\u51e0\u4e4e\u4e0d\u9700\u8981\u7f16\u5199\u4ee3\u7801\u5c31\u53ef\u4ee5\u5b9e\u73b0\u3002\u7ed3\u5408\u4e00\u4e9b\u5f00\u6e90 Home Automation System\uff0c\u5c31\u53ef\u4ee5\u5b9e\u73b0\u5bb6\u5ead\u8bbe\u5907\u7684\u81ea\u52a8\u5316\u3002<\/p>\n<h3><span class=\"ez-toc-section\" id=\"31_%E5%A4%9A%E7%A7%8D%E6%9C%8D%E5%8A%A1%E5%99%A8%E6%94%AF%E6%8C%81\"><\/span>3.1 \u591a\u79cd\u670d\u52a1\u5668\u652f\u6301<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>ESPEasy \u5185\u7f6e\u4e86\u591a\u79cd\u5f00\u6e90 Home Automation System \u7684\u652f\u6301\uff0c\u4f8b\u5982\u5e38\u89c1\u7684\u6709\uff1a<\/p>\n<ul>\n<li>Domoticz<\/li>\n<li>ThingSpeak<\/li>\n<li>OpenHAB<\/li>\n<\/ul>\n<p>\u5728 ESPEasy \u4e2d\uff0c\u53ea\u9700\u8981\u914d\u7f6e Home Automation System \u7684\u670d\u52a1\u5668\u5730\u5740\u7aef\u53e3\u7b49\uff0c\u5c31\u53ef\u4ee5\u81ea\u52a8\u5c06 ESPEasy \u91c7\u96c6\u5230\u7684\u6570\u636e\u53d1\u9001\u5230\u670d\u52a1\u5668\uff0c\u5e76\u4e14\u53ef\u4ee5\u5f88\u5bb9\u6613\u5b9a\u5236\u53d1\u9001\u65f6\u95f4\u95f4\u9694\uff0c\u683c\u5f0f\u7b49\u3002<\/p>\n<h3><span class=\"ez-toc-section\" id=\"32_%E6%8F%92%E4%BB%B6%E5%8A%9F%E8%83%BD\"><\/span>3.2 \u63d2\u4ef6\u529f\u80fd<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u5728 ESPEasy \u4e2d\uff0c\u5bf9\u4e8e\u5404\u79cd\u4f20\u611f\u5668\u7684\u652f\u6301\u90fd\u662f\u901a\u8fc7\u63d2\u4ef6\u7684\u65b9\u5f0f\u6765\u5b9e\u73b0\u7684\uff0c\u5728\u5b98\u65b9\u56fa\u4ef6\u4e2d\u5c31\u5df2\u7ecf\u96c6\u6210\u4e86\u76f8\u5f53\u591a\u7684\u4f20\u611f\u5668\u7b49\u5143\u4ef6\u7684\u652f\u6301\u3002<\/p>\n<p><img src=\"https:\/\/xujiwei.com\/blog\/wp-content\/uploads\/2017\/04\/espeasy1-input.png\" alt=\"\" width=\"811\" class=\"alignnone size-full wp-image-687\" \/><\/p>\n<p>\u53e6\u5916\u8fd8\u6709\u4e00\u4e2a ESPEasyPluginPlayground \u4e2d\u6709\u7231\u597d\u8005\u7f16\u5199\u7684\u8bd5\u9a8c\u6027\u7684\u4f20\u611f\u5668\u63d2\u4ef6\u3002<\/p>\n<p>\u5bf9\u4e8e\u6709\u80fd\u529b\u5f00\u53d1\u7684\u4eba\u6765\u8bf4\uff0c\u78b0\u5230\u5b98\u65b9\u56fa\u4ef6\u6ca1\u6709\u652f\u6301\u7684\u4f20\u611f\u5668\u6216\u5143\u4ef6\uff0c\u5b8c\u5168\u53ef\u4ee5\u81ea\u884c\u7f16\u5199\u63d2\u4ef6\u6765\u652f\u6301\u3002<\/p>\n<h3><span class=\"ez-toc-section\" id=\"33_%E4%BA%8B%E4%BB%B6%E8%A7%84%E5%88%99\"><\/span>3.3 \u4e8b\u4ef6\u89c4\u5219<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Rules \u5728 ESPEasy \u4e2d\u662f\u4e00\u4e2a\u8bd5\u9a8c\u6027\u7684\u529f\u80fd\uff0c\u9700\u8981\u5355\u72ec\u5728 Tools > Advanced \u4e2d\u5f00\u542f\u3002<\/p>\n<p>\u901a\u8fc7 Rules \u529f\u80fd\uff0c\u5c31\u53ef\u4ee5\u65b9\u4fbf\u5728\u4e00\u4e2a ESPEasy \u8282\u70b9\u4e0a\u5b9e\u73b0\u4e8b\u4ef6\u5904\u7406\u800c\u4e0d\u9700\u8981\u901a\u8fc7\u4e2d\u5fc3\u5316\u7684 Domoticz \u53bb\u5904\u7406\u4e8b\u4ef6\u8054\u52a8\u4ec0\u4e48\u7684\uff0c\u907f\u514d\u56e0\u4e3a\u4e2d\u5fc3\u670d\u52a1\u5668\u5931\u6548\u800c\u5bfc\u81f4\u7c7b\u4f3c\u8b66\u62a5\u529f\u80fd\u5931\u6548\u7684\u95ee\u9898\u3002<\/p>\n<p>\u4f8b\u5982\u6211\u505a\u4e86\u4e00\u4e2a\u53a8\u623f\u6f0f\u6c34\u68c0\u6d4b\uff0c\u5e0c\u671b\u5728\u68c0\u6d4b\u5230\u6f0f\u6c34\u65f6\u76f4\u63a5\u901a\u8fc7\u8702\u9e23\u5668\u53d1\u73b0\u8b66\u62a5\u58f0\uff0c\u800c\u4e0d\u662f\u89e6\u53d1\u5230 Domoticz \u4e2d\u7684 Switch \u503c\u6539\u53d8\uff0c\u518d\u7531 Domoticz \u53bb\u53d1\u51fa\u8b66\u62a5\u58f0\uff0c\u5c31\u53ef\u4ee5\u76f4\u63a5\u5728 Rules \u4e2d\u7f16\u5199\u76f8\u5e94\u7684\u89c4\u5219\u6765\u5b9e\u73b0\u3002<\/p>\n<pre><code>on WATER#VAL=1 do\n    buzzer,2,1\nendon\non WATER#VAL=0 do\n    buzzer,2,0\nendon\n<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"34_%E8%AE%BE%E5%A4%87%E9%85%8D%E7%BD%91\"><\/span>3.4 \u8bbe\u5907\u914d\u7f51<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u5bf9\u4e8e\u4e00\u4e2a ESPEasy \u8282\u70b9\u6765\u8bf4\uff0c\u5982\u679c\u5728\u56fa\u4ef6\u9ed8\u8ba4\u914d\u7f6e\u597d\u7684 Wi-Fi \u73af\u5883\u4e2d\uff0c\u90a3\u4e48\u5b83\u4f1a\u81ea\u52a8\u8fde\u63a5\u4e0a Wi-Fi \u7f51\u7edc\uff0c\u4f46\u662f\u5982\u679c\u79fb\u52a8\u5230\u4e86\u4e00\u4e2a\u964c\u751f\u7684 Wi-Fi \u73af\u5883\u4e2d\uff0c\u90a3\u4e48\u5982\u4f55\u8ba9\u5b83\u8fde\u63a5\u4e0a Wi-Fi \u7f51\u7edc\u5c31\u662f\u4e00\u4e2a\u95ee\u9898\u4e86\u3002<\/p>\n<p>\u5f88\u65b9\u4fbf\u7684\u662f\uff0cESPEasy \u672c\u8eab\u63d0\u4f9b\u4e86 AP \u65b9\u5f0f\u7684\u914d\u7f51\u529f\u80fd\u3002<\/p>\n<p>\u5728\u65e0\u6cd5\u8fde\u63a5\u5230 Wi-Fi \u7f51\u7edc\u65f6\uff0cESPEasy \u4f1a\u5c06 ESP8266 \u7684 Wi-Fi \u5de5\u4f5c\u6a21\u5f0f\u5207\u6362\u5230 AP Station \u65b9\u5f0f\uff0c\u63d0\u4f9b\u4e86\u4e00\u4e2a\u540d\u79f0\u4e3a ESP_0 \u8fd9\u6837\u5f62\u5f0f SSID \u7684 Wi-Fi \u7f51\u7edc\uff0c\u8fde\u63a5\u5230\u8fd9\u4e2a\u7f51\u7edc\uff0c\u8bbf\u95ee 192.168.4.1 \u5c31\u53ef\u4ee5\u8fdb\u5165 ESPEasy \u7684\u914d\u7f6e\u754c\u9762\u4e86\uff0c\u5728\u8fd9\u91cc\uff0c\u53ef\u4ee5\u914d\u7f6e\u771f\u6b63\u5b9e\u9645\u4f7f\u7528\u65f6\u7684 Wi-Fi \u7f51\u7edc SSID \u548c\u5bc6\u7801\u3002<\/p>\n<h2><span class=\"ez-toc-section\" id=\"4_ESPEasy_Plugin\"><\/span>4. ESPEasy Plugin<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>ESPEasy \u7684 Plugin \u673a\u5236\u662f\u4e00\u4e2a\u5f88\u6709\u7528\u7684\u4e1c\u897f\uff0c\u5bf9\u4e8e\u6211\u8fd9\u6837\u7684 Arduino \u521d\u5b66\u8005\u6765\u8bf4\uff0c\u5b83\u53ef\u4ee5\u89e3\u51b3\u6211\u76f8\u5f53\u4e00\u90e8\u5206\u5f00\u53d1\u4e0a\u7684\u95ee\u9898\uff0c\u4f8b\u5982\u914d\u7f6e\u7684\u4fdd\u5b58\uff0c\u7cfb\u7edf\u67b6\u6784\u7684\u8bbe\u8ba1\uff0c\u5b9a\u65f6\u5668\u7684\u4f7f\u7528\u7b49\u7b49\u3002<\/p>\n<h3><span class=\"ez-toc-section\" id=\"41_Task_Pin\"><\/span>4.1 Task Pin<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u5bf9\u4e8e ESPEasy Plugin \u6765\u8bf4\uff0c\u5b83\u7684\u4e3b\u8981\u804c\u8d23\u5c31\u662f\u53bb\u4e0e\u4f20\u611f\u5668\u6c9f\u901a\uff0c\u800c\u4e0e\u4f20\u611f\u5668\u6c9f\u901a\u6700\u4e3b\u8981\u7684\u65b9\u5f0f\u5c31\u662f\u901a\u8fc7\u9488\u811a\u6765\u901a\u4fe1\u4e86\u3002ESPEasy Plugin \u9ed8\u8ba4\u652f\u6301 Single Pin\uff0cDual Pin\uff0cI2C \u7b49\u65b9\u5f0f\u6765\u4e0e\u4f20\u611f\u5668\u901a\u4fe1\u3002<\/p>\n<p>\u5f53\u7136\uff0c\u8fd9\u4e2a\u53ea\u662f\u7528\u6765\u4fdd\u5b58\u63d2\u4ef6\u4e0e\u4f20\u611f\u5668\u901a\u4fe1\u6240\u7528\u7684\u9488\u811a\uff0c\u4ee5\u53ca\u7528\u6765\u51b3\u5b9a\u5728 Web \u754c\u9762\u4e0a\u914d\u7f6e\u4f20\u611f\u5668\u65f6\u63d0\u4f9b\u4ec0\u4e48\u6837\u7684\u5f62\u5f0f\u53bb\u7ed9\u7528\u6237\u9009\u62e9\uff0c\u771f\u6b63\u5982\u4f55\u4e0e\u4f20\u611f\u5668\u901a\u4fe1\u8fd8\u662f\u9700\u8981\u7531\u63d2\u4ef6\u7684\u4ee3\u7801\u53bb\u5b9e\u73b0\u3002<\/p>\n<h3><span class=\"ez-toc-section\" id=\"42_Configuration\"><\/span>4.2 Configuration<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>ESPEasy Plugin \u9ed8\u8ba4\u63d0\u4f9b\u4e86\u4e09\u79cd\u7c7b\u578b int16\u3001float \u4ee5\u53ca long \u81ea\u5b9a\u4e49\u914d\u7f6e\u5b58\u50a8\u9879\uff0c\u5176\u4e2d int16 \u6700\u591a 8 \u4e2a\uff0cfloat \u548c long \u6700\u591a 4 \u4e2a\u3002<\/p>\n<p>\u53e6\u5916\uff0cESPEasy Plugin \u8fd8\u4e3a\u6bcf\u4e2a\u63d2\u4ef6\u51c6\u5907\u4e86 512 \u5b57\u8282\u7684\u81ea\u5b9a\u4e49\u914d\u7f6e\u5b58\u50a8\u533a\u57df\uff0c\u5728\u8fd9 512 \u5b57\u8282\u4e2d\uff0c\u53ef\u4ee5\u6839\u636e\u81ea\u5df1\u7684\u9700\u8981\u5b58\u50a8\u4f8b\u5982\u5b57\u7b26\u4e32\u7b49\u914d\u7f6e\u4fe1\u606f\u3002\u5728 ESPEasy \u81ea\u5e26\u7684 OLED \u63d2\u4ef6\u4e2d\uff0c\u5c31\u662f\u4f7f\u7528\u4e86\u8fd9 512 \u5b57\u8282\u6765\u5b58\u50a8\u9700\u8981\u663e\u793a\u7684\u5b57\u7b26\u4e32\u4fe1\u606f\u3002<\/p>\n<h3><span class=\"ez-toc-section\" id=\"43_Timer\"><\/span>4.3 Timer<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u5b9a\u65f6\u5668\u662f\u4e2a\u597d\u4e1c\u897f\uff0c\u4f46\u662f\u6211\u4e0d\u4f1a\u7528\u3002\u4e0d\u8fc7\u6709\u4e86 ESPEasy Plugin\uff0c\u53ea\u9700\u8981\u5728 PLUGIN_ONCE_A_SECOND \u6216 PLUGIN_TEN_PER_SECOND \u5199\u4ee3\u7801\u5c31\u884c\u4e86\uff0c\u6bcf\u79d2\u4e00\u6b21\u8fd8\u662f\u6bcf\u79d2\u5341\u6b21\u4efb\u541b\u9009\u62e9\u3002\u60f3\u8981\u81ea\u5b9a\u4e49\u65f6\u95f4\uff1f\u52a0\u4e2a\u53d8\u91cf\u7d2f\u52a0\u4e00\u4e0b\u89e6\u53d1\u6b21\u6570\u5c31\u53ef\u4ee5\u5b9e\u73b0\u4efb\u610f 100 \u6beb\u79d2\u500d\u6570\u65f6\u95f4\u7684\u5b9a\u65f6\u5668\u4e86\u3002<\/p>\n<h2><span class=\"ez-toc-section\" id=\"5_PlatformIO\"><\/span>5. PlatformIO<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>ESPEasy \u662f\u4e00\u4e2a\u5f88\u8001\u7684\u9879\u76ee\uff0c\u53ef\u80fd\u4ee5\u524d\u662f\u7528 Arduino IDE \u5f00\u53d1\u7684\uff0c\u867d\u7136 Arduino IDE \u662f\u4e00\u4e2a\u597d\u4e1c\u897f\uff0c\u4f46\u662f\u6bd5\u7adf\u6bd4\u8f83\u4e0d\u73b0\u4ee3\uff0c\u5728\u4f7f\u7528\u8fc7\u7a0b\u4e2d\u8fd8\u662f\u6709\u5404\u79cd\u4e0d\u4fbf\u3002<\/p>\n<p>\u800c PlatformIO IDE \u5c31\u6bd4\u8f83\u73b0\u4ee3\u4e86\uff0c\u8fd9\u662f\u4e00\u4e2a\u57fa\u4e8e Atom \u5b9e\u73b0\u7684\u8de8\u5e73\u53f0 IDE\uff0c\u652f\u6301\u591a\u79cd\u5f00\u53d1\u5e73\u53f0\uff0c\u4f8b\u5982 Arduino\u3001mbed \u7b49\u3002<\/p>\n<p>\u5f53\u7136 PlatformIO \u5bf9\u6211\u6700\u591a\u7684\u5438\u5f15\u529b\u662f\u5b83\u6bd4\u8f83\u5b8c\u5584\u7684\u9879\u76ee\u6587\u4ef6\u5217\u8868\u3001\u8bed\u6cd5\u989c\u8272\u4ee5\u53ca\u81ea\u52a8\u8865\u5168\u529f\u80fd\u3002Arduino IDE \u4e0e\u4e4b\u76f8\u6bd4\u5c31\u50cf\u662f\u5728\u7528\u8bb0\u4e8b\u672c\u5728\u5199\u4ee3\u7801\u3002<\/p>\n<p>PlatformIO \u662f\u76f4\u63a5\u53ef\u4ee5\u517c\u5bb9 Arduino \u9879\u76ee\u4ee3\u7801\u7684\uff0c\u56e0\u4e3a\u4ece Arduino IDE \u5207\u6362\u5b8c\u5168\u6ca1\u6709\u538b\u529b\uff0c\u5e76\u4e14\u5728\u6253\u5f00\u9879\u76ee\u65f6\u4e5f\u53ef\u4ee5\u4fdd\u6301\u4e0e Arduino \u9879\u76ee\u7684\u517c\u5bb9\u6027\uff0c\u8fd9\u6837\u5982\u679c\u6709\u4e00\u4e9b\u7279\u6b8a\u9700\u6c42\u4e5f\u53ef\u4ee5\u76f4\u63a5\u7528 Arduino IDE \u6765\u6253\u5f00\u9879\u76ee\u6765\u5f00\u53d1\u3002<\/p>\n<h2><span class=\"ez-toc-section\" id=\"6_Plugins\"><\/span>6. Plugins<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"61_MH-Z19\"><\/span>6.1 MH-Z19<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>MH-Z19 \u662f\u4e00\u6b3e\u56fd\u4ea7\u7684\u4e8c\u6c27\u5316\u78b3\u4f20\u611f\u5668\uff0c\u91cf\u7a0b\u4e3a 0~5000ppm\uff0c\u7cbe\u5ea6\u4e3a 50ppm+5% \u8bfb\u6570\u503c\uff0c\u6307\u6807\u548c\u8fdb\u53e3 SenseAir S8 \u5dee\u4e0d\u592a\u591a\uff0c\u4f46\u662f\u4ef7\u683c\u53ea\u9700\u8981\u4e09\u5206\u4e4b\u4e00\uff0c\u76f8\u5f53\u5b9e\u60e0\u3002<\/p>\n<p>\u5728\u5b9e\u9645\u4f7f\u7528\u8fc7\u7a0b\u4e2d\uff0c\u53d1\u73b0 MH-Z19 \u7684\u6570\u636e\u4e5f\u8fd8\u7b97\u7a33\u5b9a\uff0c\u4e0e SenseAir S8 \u5e76\u6ca1\u6709\u592a\u5927\u5dee\u8ddd\uff0c\u4e0e Netatmo Weather Station \u7684\u6570\u636e\u4e5f\u8fd8\u7b97\u7b26\u5408\uff0c\u56e0\u6b64\u7528\u6765\u4f5c\u4e3a\u770b\u5ba4\u5185\u4e8c\u6c27\u5316\u78b3\u6d53\u5ea6\u53d8\u5316\u8d8b\u52bf\u662f\u4e00\u4e2a\u4e0d\u9519\u7684\u9009\u62e9\u3002<\/p>\n<h3><span class=\"ez-toc-section\" id=\"62_PMS5003\"><\/span>6.2 PMS5003<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>PMS5003 \u662f\u6500\u817e\u79d1\u6280\u51fa\u7684\u4e00\u6b3e\u6fc0\u5149 PM 2.5 \u9897\u7c92\u7269\u4f20\u611f\u5668\uff0c\u4fbf\u5b9c\u53c8\u597d\u7528\uff0c\u4f7f\u7528 <a href=\"https:\/\/github.com\/jbanaszczyk\/pms5003\">pms5003<\/a> \u8fd9\u4e2a\u5e93\u53ef\u4ee5\u5f88\u65b9\u4fbf\u7684\u8bfb\u53d6\u6570\u636e\uff0c\u7136\u540e\u53d1\u9001\u5230 Domoticz \u4e0a\u7684 Custom Sensor \u8bbe\u5907\uff0c\u53ef\u4ee5\u65b9\u4fbf\u7684\u8ffd\u8e2a\u5bb6\u91cc\u7684 PM 2.5 \u6d53\u5ea6\u53d8\u5316\uff0c\u6216\u8005\u6765\u68c0\u6d4b\u7a7a\u6c14\u51c0\u5316\u5668\u7684\u51c0\u5316\u6548\u679c\u3002<\/p>\n<h3><span class=\"ez-toc-section\" id=\"63_Switch\"><\/span>6.3 Switch<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u5f88\u591a\u4e00\u4e9b\u901a\u65ad\u6027\u8d28\u7684\u4f20\u611f\u5668\uff0c\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528 Switch Plugin \u6765\u8bfb\u53d6\u72b6\u6001\uff0c\u5e76\u5b9e\u73b0\u4e00\u4e9b\u76f8\u5173\u7684\u8054\u52a8\u4e8b\u4ef6\u5904\u7406\u3002<\/p>\n<p>\u4f8b\u5982\u68c0\u6d4b\u6f0f\u6c34\uff0c\u53ef\u4ee5\u76f4\u63a5\u5728\u6dd8\u5b9d\u4e0a\u8d2d\u4e70\u96e8\u6c34\u4f20\u611f\u5668\u6a21\u5757\uff0c\u5b83\u6709\u4e00\u4e2a\u6570\u5b57\u8f93\u51fa DO\uff0c\u6709\u6c34\u65f6\u5c31\u4f1a\u8f93\u51fa\u4f4e\u7535\u5e73\uff0c\u68c0\u6d4b\u5230\u4f4e\u7535\u5e73\u65f6\u5c31\u53ef\u4ee5\u901a\u8fc7\u8702\u9e23\u5668\u53d1\u51fa\u8b66\u62a5\u63d0\u793a\u68c0\u67e5\u6f0f\u6c34\u60c5\u51b5\u4e86\u3002<\/p>\n<h2><span class=\"ez-toc-section\" id=\"7_%E5%8F%82%E8%80%83%E8%B5%84%E6%96%99\"><\/span>7. \u53c2\u8003\u8d44\u6599<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ol>\n<li><a href=\"https:\/\/www.letscontrolit.com\/wiki\/index.php\/ESPEasy\">ESPEasy Wiki<\/a><\/li>\n<li><a href=\"http:\/\/espressif.com\/zh-hans\/products\/hardware\/esp8266ex\/overview\">ESP8266<\/a><\/li>\n<li><a href=\"https:\/\/en.wikipedia.org\/wiki\/ESP8266\">Wikipedia: ESP8266<\/a><\/li>\n<li><a href=\"http:\/\/www.nodemcu.com\/index_cn.html\">NodeMCU<\/a><\/li>\n<li><a href=\"http:\/\/platformio.org\/\">PlatformIO<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/letscontrolit\/ESPEasy\">GitHub: ESPEasy<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/letscontrolit\/ESPEasyPluginPlayground\">GitHub: ESPEasyPluginPlayground<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/jbanaszczyk\/pms5003\">GitHub: pms5003<\/a><\/li>\n<\/ol>\n<p><strong>\u672a\u7ecf\u8bb8\u53ef\uff0c\u7981\u6b62\u8f6c\u8f7d<\/strong><\/p>\n<p>--- EOF ---<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. ESP8266 ESP8266 \u662f\u4e50\u946b\u63a8\u51fa\u7684\u4e00\u6b3e\u4f4e\u529f\u8017\u9ad8\u96c6\u6210\u5ea6\u7684 Wi-F &hellip;<\/p>\n<p class=\"read-more\"><a href=\"https:\/\/xujiwei.com\/blog\/2017\/04\/homeautomation-espeasy\/\">\u7ee7\u7eed\u9605\u8bfb &raquo;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[167],"tags":[251,256,259,255,254],"_links":{"self":[{"href":"https:\/\/xujiwei.com\/blog\/wp-json\/wp\/v2\/posts\/686"}],"collection":[{"href":"https:\/\/xujiwei.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xujiwei.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xujiwei.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/xujiwei.com\/blog\/wp-json\/wp\/v2\/comments?post=686"}],"version-history":[{"count":0,"href":"https:\/\/xujiwei.com\/blog\/wp-json\/wp\/v2\/posts\/686\/revisions"}],"wp:attachment":[{"href":"https:\/\/xujiwei.com\/blog\/wp-json\/wp\/v2\/media?parent=686"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xujiwei.com\/blog\/wp-json\/wp\/v2\/categories?post=686"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xujiwei.com\/blog\/wp-json\/wp\/v2\/tags?post=686"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}