{"id":284315,"date":"2017-04-02T22:25:02","date_gmt":"2017-04-02T18:25:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=284315"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=284315","title":{"rendered":"Noolite MTRF-32 + Arduino + Domoticz"},"content":{"rendered":"<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u044f Noolite MTRF-32 \u043a \u0441\u0432\u043e\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0443\u043c\u043d\u044b\u043c \u0434\u043e\u043c\u043e\u043c \u043d\u0430 \u0431\u0430\u0437\u0435 <a href=\"http:\/\/www.domoticz.com\/\">Domoticz<\/a>.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h3>\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043e \u0441\u0430\u043c\u043e\u043c \u0434\u043e\u043c\u0435<\/h3>\n<p>  \u0414\u043e\u043c \u0443 \u043c\u0435\u043d\u044f \u0447\u0430\u0441\u0442\u043d\u044b\u0439. \u0412 \u043d\u0435\u043c \u0443\u0436\u0435 \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u044b \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u0447\u0430\u0442\u043a\u0438 \u0443\u043c\u043d\u043e\u0433\u043e \u0434\u043e\u043c\u0430 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 Domoticz \u0438 \u0431\u0435\u0441\u043f\u0440\u043e\u0432\u043e\u0434\u043d\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u043d\u0430 MySensors.<\/p>\n<p>  \u041d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u0434\u0430\u0442\u0447\u0438\u043a\u0438 \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u044f \u0434\u0432\u0435\u0440\u0435\u0439, \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043f\u0440\u0438\u0434\u043e\u043c\u043e\u0432\u043e\u0433\u043e \u043e\u0441\u0432\u0435\u0449\u0435\u043d\u0438\u044f, \u0434\u0430\u0442\u0447\u0438\u043a\u0438 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b \u0438 \u0432\u043b\u0430\u0436\u043d\u043e\u0441\u0442\u0438 \u0434\u043e\u043c\u0430 \u0438 \u043d\u0430 \u0443\u043b\u0438\u0446\u0435, \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043e \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u0445 \u0438 \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0435 \u043f\u043e\u0433\u043e\u0434\u044b.<\/p>\n<p>  \u0414\u043e\u043c \u0434\u0435\u0440\u0435\u0432\u044f\u043d\u043d\u044b\u0439, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043e\u0441\u0432\u0435\u0449\u0435\u043d\u0438\u0435\u043c \u0437\u0430\u043c\u044b\u043a\u0430\u043d\u0438\u0435\u043c \u0440\u0435\u043b\u044e\u0448\u0435\u043a \u0438\u0437 \u043a\u0438\u0442\u0430\u044f \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c. \u0422\u044f\u043d\u0443\u0442\u044c \u043f\u0440\u043e\u0432\u043e\u0434\u0430 \u0433\u0434\u0435 \u043f\u043e\u043f\u0430\u043b\u043e \u0442\u043e\u0436\u0435 \u043d\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442. \u041f\u043e\u0441\u043b\u0435 \u0434\u043e\u043b\u0433\u0438\u0445 \u0440\u0430\u0437\u0434\u0443\u043c\u0438\u0439 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0432\u0435\u0442\u043e\u043c \u0441\u0434\u0435\u043b\u0430\u043b \u043d\u0430 \u0441\u0438\u043b\u043e\u0432\u044b\u0445 \u0431\u043b\u043e\u043a\u0430\u0445 \u0438 \u043f\u0443\u043b\u044c\u0442\u0430\u0445 noolite \u0438 \u043e\u0441\u0442\u0430\u0432\u0430\u043b\u043e\u0441\u044c \u043a\u0430\u043a-\u0442\u043e \u043f\u043e\u0434\u0440\u0443\u0436\u0438\u0442\u044c \u044d\u0442\u043e \u0441 Domoticz.<\/p>\n<p>  \u0412 \u044d\u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430 \u0433\u043b\u0430\u0437\u0430 \u043f\u043e\u043f\u0430\u043b\u0430\u0441\u044c <a href=\"https:\/\/geektimes.ru\/post\/281962\/\">\u0441\u0442\u0430\u0442\u044c\u044f<\/a> \u043f\u0440\u043e \u043c\u043e\u0434\u0443\u043b\u044c MTRF-32 \u043e\u0442 Noolite. Domoticz \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0443 HTTP GET \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432. \u041f\u0435\u0440\u0441\u043f\u0435\u043a\u0442\u0438\u0432\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0441 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0441\u0432\u044f\u0437\u044c\u044e \u0442\u0430\u043a \u0436\u0435 \u043c\u0430\u043d\u0438\u043b\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u043e\u0434\u0443\u043b\u044c \u0431\u044b\u043b \u0437\u0430\u043a\u0430\u0437\u0430\u043d.<\/p>\n<h3>\u041e \u0442\u043e\u043c \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e 7 \u0440\u0430\u0437 \u043e\u0442\u043c\u0435\u0440\u0438\u0442\u044c \u043f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043e\u0442\u0440\u0435\u0437\u0430\u0442\u044c<\/h3>\n<p>  \u041a\u0430\u043a \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u043a\u0443\u043f\u0438\u043b \u044f \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u0442\u043e \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e. \u041d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u043e\u043a\u0443\u043f\u043a\u0438 \u0431\u044b\u043b \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043e\u0434\u0438\u043d \u043c\u043e\u0434\u0443\u043b\u044c MTRF-32. \u0414\u0430 \u0438 \u0447\u0438\u0442\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044e \u044f \u043d\u0435 \u0443\u0432\u0438\u0434\u0435\u043b \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0440\u0430\u0437\u043d\u043e\u0432\u0438\u0434\u043d\u043e\u0441\u0442\u044f\u0445 \u044d\u0442\u0438\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439. \u0412 \u043e\u0431\u0449\u0435\u043c \u043c\u043d\u0435 \u043d\u0443\u0436\u0435\u043d \u0431\u044b\u043b USB \u0432\u0430\u0440\u0438\u0430\u043d\u0442 MTRF-32-USB. <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0421\u043b\u0435\u0434\u0443\u0435\u0442 \u043f\u043e\u044f\u0441\u043d\u0438\u0442\u044c<\/b><\/p>\n<div class=\"spoiler_text\">32 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u043e 32-\u043c \u043a\u0430\u043d\u0430\u043b\u0430\u043c. \u041d\u0430 \u0441\u0435\u0433\u043e\u0434\u043d\u044f\u0448\u043d\u0438\u0439 \u0434\u0435\u043d\u044c \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 noolite \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043c\u043e\u0434\u0443\u043b\u044c \u0441 64 \u043a\u0430\u043d\u0430\u043b\u0430\u043c\u0438, \u043f\u0440\u0438\u0447\u0435\u043c \u043e\u0431\u0430 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u043a\u0430\u043a \u0441 USB \u0442\u0430\u043a \u0438 \u0431\u0435\u0437. \u0412\u043e\u043f\u0440\u043e\u0441 \u043a \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044f\u043c MTRF-32 \u043a\u0430\u043a-\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0434\u043e MTRF-64?  <\/div>\n<\/div>\n<p>  \u0427\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u043d\u043e, \u0442\u043e \u0441\u0434\u0435\u043b\u0430\u043d\u043e. \u041f\u043b\u0430\u0442\u043a\u0430 \u0431\u044b\u043b\u0430 \u043e\u0442\u043b\u043e\u0436\u0435\u043d\u0430 \u0434\u043e <s>\u0442\u043e\u0433\u043e \u043a\u0430\u043a \u043a\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u043d\u0435 \u0432\u044b\u043b\u043e\u0436\u0438\u0442 \u0433\u043e\u0442\u043e\u0432\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443<\/s> \u043b\u0443\u0447\u0448\u0438\u0445 \u0432\u0440\u0435\u043c\u0435\u043d.<\/p>\n<p>  \u041f\u043e\u0447\u0435\u043c\u0443-\u0442\u043e \u043b\u0443\u0447\u0448\u0438\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0430 \u043d\u0435 \u043d\u0430\u0441\u0442\u0430\u043b\u0438. \u0425\u043e\u0442\u044f \u044f \u0434\u0443\u043c\u0430\u043b \u0447\u0442\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u0430\u044f.<\/p>\n<h3>\u041f\u0435\u0440\u0432\u0430\u044f \u043f\u043e\u043f\u044b\u0442\u043a\u0430<\/h3>\n<p>  \u041f\u043e\u0445\u043e\u0434\u0438\u0432 \u043f\u043e \u0441\u0430\u0439\u0442\u0443 Noolite \u043d\u0430\u0448\u0435\u043b \u041f\u041e NooliteOne \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 MTRF-64-USB. \u041e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0447\u0442\u043e \u043e\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0447\u0435\u0440\u0435\u0437 com-\u043f\u043e\u0440\u0442 \u0438 \u044f \u043f\u043e\u043d\u044f\u043b \u0447\u0442\u043e MTRF-64 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 MTRF-64-USB \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u043c USB-COM \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u043e\u043c. \u0412 \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0442\u0435 \u0441 \u041f\u041e \u0431\u044b\u043b\u0438 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430 \u043e\u0442 \u0447\u0438\u043f\u0430 FTDI, \u0430 \u043d\u0430 \u043c\u043e\u0435\u0439 \u043f\u043b\u0430\u0442\u0435 \u0431\u044b\u043b\u0430 \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u043d\u0430\u044f \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0430\u044f \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u043d\u0430\u044f \u043f\u043b\u043e\u0449\u0430\u0434\u043a\u0430.<\/p>\n<p>  \u041f\u0430\u044f\u0442\u044c \u0447\u0438\u043f \u044f \u043d\u0435 \u0441\u0442\u0430\u043b. \u041d\u043e \u0441\u0434\u0435\u043b\u0430\u043b \u0438\u0437 \u043a\u0438\u0442\u0430\u0439\u0441\u043a\u043e\u0433\u043e Arduino Nano \u0441 FTDI USB-COM \u0430\u0434\u0430\u043f\u0442\u0435\u0440 \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043b \u043a \u043f\u043b\u0430\u0442\u0435.<\/p>\n<p>  \u041d\u0435 \u0432\u0437\u043b\u0435\u0442\u0435\u043b\u043e. \u041f\u043e \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0435 NooliteOne \u043d\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u043b \u043c\u043e\u0439 \u0430\u0434\u0430\u043f\u0442\u0435\u0440. \u042f \u0443\u0436\u0435 \u043d\u0430\u0447\u0430\u043b \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 \u0434\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438, \u043a\u043e\u0433\u0434\u0430 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b <a href=\"https:\/\/github.com\/zhum\/ardunoo#ardunoo\">\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443<\/a> \u0434\u043b\u044f \u043c\u043e\u0434\u0443\u043b\u044f MT1132.<\/p>\n<h3>\u0412\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u043f\u044b\u0442\u043a\u0430<\/h3>\n<p>  \u042f \u0441\u0440\u0430\u0432\u043d\u0438\u043b \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0438 \u043f\u043e\u043d\u044f\u043b, \u0447\u0442\u043e \u0432 \u0447\u0430\u0441\u0442\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u043d\u0438 \u043f\u043e\u0447\u0442\u0438 \u043d\u0435 \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f. \u0420\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 \u0434\u043b\u044f MT1132 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u043c\u043d\u0435 \u0431\u044b\u043b \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u0435\u043d (\u041e\u0431\u0440\u0430\u0442\u043d\u0430\u044f \u0441\u0432\u044f\u0437\u044c \u043f\u043e\u043a\u0430 \u043d\u0435 \u043d\u0443\u0436\u043d\u0430 \u2014 \u043d\u0435\u0442 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u0441\u0438\u043b\u043e\u0432\u044b\u0445 \u0431\u043b\u043e\u043a\u043e\u0432). <\/p>\n<p>  \u041f\u043e\u0434\u043f\u0440\u0430\u0432\u0438\u0432 \u043a\u043e\u0434 \u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435, \u044f \u043d\u0430\u0447\u0430\u043b \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u043e\u0442\u0432\u0435\u0442\u044b \u043e\u0442 MTRF-32. \u041a\u0430\u043a \u043d\u0438 \u0441\u0442\u0440\u0430\u043d\u043d\u043e \u0432\u0441\u0435 \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e \u0441 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0440\u0430\u0437\u0430. \u0418 \u0432\u043e\u0442 \u0447\u0442\u043e \u0432 \u0438\u0442\u043e\u0433\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">Ardunoo.H<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\">\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434<\/code><\/pre>\n<p>  #ifndef ARDUNOO_H<br \/>  #define ARDUNOO_H<\/p>\n<p>  #if defined(ARDUINO) &#038;&#038; ARDUINO &gt;= 100<br \/>  #include \u00abArduino.h\u00bb<br \/>  #else<br \/>  #include \u00abWProgram.h\u00bb<br \/>  #endif<\/p>\n<p>  #include &lt;SoftwareSerial.h&gt;<\/p>\n<p>  class ArduNoo {<\/p>\n<p>  byte chnl;<br \/>   SoftwareSerial ns;<\/p>\n<p>  public:<br \/>   ArduNoo(byte rx, byte tx, byte ch=0);<br \/>   void on(byte ch=-1);<br \/>   void off(byte ch=-1);<br \/>   void onoff(byte ch=-1);<br \/>   void bind(byte ch=-1);<br \/>   void unbind(byte ch=-1);<\/p>\n<p>  bool command(byte channel, byte command);<br \/>  };<\/p>\n<p>  #endif   <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">Ardunoo.cpp<\/b><\/p>\n<div class=\"spoiler_text\">#include &lt;ardunoo.h&gt;<\/p>\n<p>  ArduNoo::ArduNoo(byte rx, byte tx, byte ch): ns(rx,tx){<br \/>   chnl=ch;<br \/>   ns.begin(9600);<br \/>  }<\/p>\n<p>  void ArduNoo::off(byte ch){ <br \/>   command(ch, 0);<br \/>  }<\/p>\n<p>  void ArduNoo::on(byte ch){ <br \/>   command(ch, 2);<br \/>  }<\/p>\n<p>  void ArduNoo::onoff(byte ch){ <br \/>   command(ch, 4);<br \/>  }<\/p>\n<p>  void ArduNoo::unbind(byte ch){ <br \/>   command(ch, 9);<br \/>  }<\/p>\n<p>  void ArduNoo::bind(byte ch){ <br \/>   command(ch, 15);<br \/>  }<\/p>\n<p>  bool ArduNoo::command(byte chnl, byte command){<br \/>   static byte i, r, buf[17]={171,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,172};<br \/>   int sum = 0;<\/p>\n<p>  memset(buf+2,0,14); \/* clear message body *\/ <br \/>   buf[4] = chnl;<br \/>   buf[5] = command; <\/p>\n<p>  for(i = 0; i&lt;15; ++i) {\/\/10<br \/>   sum+= buf[i];<br \/>   }<br \/>   buf[15] = lowByte(sum);\/\/10<br \/>   buf[16] = 172;\/\/11<\/p>\n<p>  for(i=0; i&lt;17; ++i){<br \/>   ns.write(buf[i]);<br \/>   }<br \/>   \/\/debug code<br \/>   for(i=0;i&lt;17;++i){<br \/>   while(!ns.available()) delay(10);<br \/>   r=ns.read();<br \/>   Serial.print&reg;; <br \/>   }<br \/>   Serial.println();<\/p>\n<p>   return true;<br \/>  }  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">Ardunoo.ino<\/b><\/p>\n<div class=\"spoiler_text\">#include &lt;SoftwareSerial.h&gt;<br \/>  #include &lt;ardunoo.h&gt;<\/p>\n<p>  #define RXpin 10<br \/>  #define TXpin 11<\/p>\n<p>  ArduNoo noo(RXpin, TXpin);<br \/>  String readString, chString;<\/p>\n<p>  void setup() {<br \/>   Serial.begin(9600);<br \/>  }<\/p>\n<p>  void loop() {<br \/>   readString = &quot;&quot;;<br \/>   chString = &quot;&quot;;<br \/>   while (Serial.available()) {<br \/>   delay(3); \/\/delay to allow buffer to fill<br \/>   if (Serial.available() &gt; 0) {<br \/>   char c = Serial.read(); \/\/gets one byte from serial buffer<br \/>   readString += c; \/\/makes the string readString<br \/>   }<br \/>   }<br \/>   if (readString.length() &gt; 1 &#038;&#038; readString.length() &lt; 4) { \/\/we expect 1 letter and 1 or 2 digits (ch = 0-31)<br \/>   for (int i = 1; i &lt; readString.length(); i++) {<br \/>   if (isDigit(readString[i])) {<br \/>   chString.concat(readString[i]);<br \/>   }<br \/>   }<br \/>   \/\/Serial.println(readString[0]);<br \/>   int ch = chString.toInt();<br \/>   switch (readString[0]) {<br \/>   case &#8216;n&#8217;: \/\/on<br \/>   noo.on(ch);<br \/>   break;<br \/>   case &#8216;f&#8217;: \/\/off<br \/>   noo.off(ch);<br \/>   break;<br \/>   case &#8216;x&#8217;: \/\/ toggle<br \/>   noo.onoff(ch);<br \/>   break;<br \/>   case &#8216;b&#8217;: \/\/bind<br \/>   noo.bind(ch);<br \/>   break;<br \/>   case &#8216;u&#8217;: \/\/unbind<br \/>   noo.unbind(ch);<br \/>   break;<br \/>   case &#8216;y&#8217;: \/\/on all channels <br \/>   for(int i = 0; i &lt; 32; i++) {<br \/>   noo.on(i);<br \/>   delay(100); <br \/>   }<br \/>   break;<br \/>   case &#8216;z&#8217;: \/\/off all channels <br \/>   for(int i = 0; i &lt; 32; i++) {<br \/>   noo.off(i);<br \/>   delay(100); <br \/>   } <br \/>   break;<br \/>   }<br \/>   }<br \/>  }  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041b\u0438\u0446\u0435\u043d\u0437\u0438\u044f \u043d\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043e\u0442 Zhumatiy Sergey<\/b><\/p>\n<div class=\"spoiler_text\">The MIT License (MIT)<\/p>\n<p>  Copyright &copy; 2014 Zhumatiy Sergey<\/p>\n<p>  Permission is hereby granted, free of charge, to any person obtaining a copy<br \/>  of this software and associated documentation files (the \u00abSoftware\u00bb), to deal<br \/>  in the Software without restriction, including without limitation the rights<br \/>  to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell<br \/>  copies of the Software, and to permit persons to whom the Software is<br \/>  furnished to do so, subject to the following conditions:<\/p>\n<p>  The above copyright notice and this permission notice shall be included in all<br \/>  copies or substantial portions of the Software.<\/p>\n<p>  THE SOFTWARE IS PROVIDED \u00abAS IS\u00bb, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR<br \/>  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,<br \/>  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE<br \/>  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER<br \/>  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,<br \/>  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE<br \/>  SOFTWARE.  <\/div>\n<\/div>\n<p>  \u0420\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0432\u044b\u043a\u043b\u044e\u0447\u0438\u0442\u044c, \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c, \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0438\u0442\u044c, \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0432\u0441\u0435, \u0432\u044b\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0432\u0441\u0435.<\/p>\n<p>  \u0414\u0435\u043b\u043e \u0437\u0430 \u043c\u0430\u043b\u044b\u043c, \u043d\u0443\u0436\u043d\u043e \u043e\u0442\u0434\u0430\u0432\u0430\u0442\u044c \u0432 com \u043f\u043e\u0440\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u044b. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0438\u0437 Domoticz \u043d\u0430 Windows \u044d\u0442\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u0442\u0438\u0447\u043d\u043e, \u0440\u0435\u0448\u0438\u043b \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0431\u0443\u0434\u0435\u0442 \u0442\u0440\u0430\u043d\u0441\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0438\u0437 lua \u0441\u043a\u0440\u0438\u043f\u0442\u0430. \u041a\u043e\u043c\u0430\u043d\u0434\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 \u0432\u0438\u0434\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0437\u0430\u043f\u0443\u0441\u043a\u0430.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">noo.cs<\/b><\/p>\n<div class=\"spoiler_text\">using System;<br \/>  using System.Collections.Generic;<br \/>  using System.Linq;<br \/>  using System.Text;<br \/>  using System.IO.Ports;<\/p>\n<p>  namespace noo<br \/>  { <br \/>   class Program<br \/>   { <br \/>   static void Main(string[] args)<br \/>   { <br \/>   if (args.Length == 2)<br \/>   { <br \/>   SerialPort COM = new SerialPort(args[0]); <br \/>   COM.Open();<br \/>   COM.WriteLine(args[1]);<br \/>   COM.Close();<br \/>   }<br \/>   }<br \/>   }<br \/>  }  <\/div>\n<\/div>\n<p>  <\/p>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u043c\u0430\u043d\u0434\u044b:<\/h3>\n<p>  noo.exe com5 n4 \u2014 \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0441\u0432\u0435\u0442 \u043d\u0430 4 \u043a\u0430\u043d\u0430\u043b\u0435, \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043f\u043b\u0430\u0442\u0443 Arduino \u043d\u0430 \u043f\u043e\u0440\u0442\u0443 COM5. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430:<\/p>\n<ul>\n<li>nX \u2014 \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043a\u0430\u043d\u0430\u043b X<\/li>\n<li>fX \u2014 \u0432\u044b\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043a\u0430\u043d\u0430\u043b X<\/li>\n<li>xX \u2014 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043a\u0430\u043d\u0430\u043b X<\/li>\n<li>bX \u2014 \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u0442\u044c \u0441\u0438\u043b\u043e\u0432\u043e\u0439 \u0431\u043b\u043e\u043a \u043a \u043a\u0430\u043d\u0430\u043b\u0443 X<\/li>\n<li>uX \u2014 \u043e\u0442\u0432\u044f\u0437\u0430\u0442\u044c \u0441\u0438\u043b\u043e\u0432\u043e\u0439 \u0431\u043b\u043e\u043a \u043e\u0442 \u043a\u0430\u043d\u0430\u043b\u0430 X<\/li>\n<li>yX \u2014 \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0432\u0441\u0435 \u043a\u0430\u043d\u0430\u043b\u044b, X \u043b\u044e\u0431\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435<\/li>\n<li>zX \u2014 \u0432\u044b\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0432\u0441\u0435 \u043a\u0430\u043d\u0430\u043b\u044b, X \u043b\u044e\u0431\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435<\/li>\n<\/ul>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">lua \u0441\u043a\u0440\u0438\u043f\u0442<\/b><\/p>\n<div class=\"spoiler_text\">local sensor1 = &#8216;SWHallWay&#8217;<br \/>  local sensor2 = &#8216;SWHall&#8217;<br \/>  local sensor3 = &#8216;SWKitchen&#8217;<br \/>  local sensor4 = &#8216;SWBedroom&#8217;<br \/>  local sensor5 = &#8216;BTNLiteOff&#8217;<br \/>  commandArray = {}<br \/>  if (devicechanged[sensor1] == &#8216;On&#8217;) then<br \/>   os.execute (\u00abc:\\\\PROGRA~1\\\\Domoticz\\\\scripts\\\\noo.exe com4 n3\u00bb) <br \/>  end<br \/>  if (devicechanged[sensor1] == &#8216;Off&#8217;) then<br \/>   os.execute (\u00abc:\\\\PROGRA~1\\\\Domoticz\\\\scripts\\\\noo.exe com4 f3\u00bb) <br \/>  end<br \/>  if (devicechanged[sensor2] == &#8216;On&#8217;) then<br \/>   os.execute (\u00abc:\\\\PROGRA~1\\\\Domoticz\\\\scripts\\\\noo.exe com4 n0\u00bb) <br \/>  end<br \/>  if (devicechanged[sensor2] == &#8216;Off&#8217;) then<br \/>   os.execute (\u00abc:\\\\PROGRA~1\\\\Domoticz\\\\scripts\\\\noo.exe com4 f0\u00bb) <br \/>  end<br \/>  if (devicechanged[sensor3] == &#8216;On&#8217;) then<br \/>   os.execute (\u00abc:\\\\PROGRA~1\\\\Domoticz\\\\scripts\\\\noo.exe com4 n1\u00bb) <br \/>  end<br \/>  if (devicechanged[sensor3] == &#8216;Off&#8217;) then<br \/>   os.execute (\u00abc:\\\\PROGRA~1\\\\Domoticz\\\\scripts\\\\noo.exe com4 f1\u00bb) <br \/>  end<br \/>  if (devicechanged[sensor4] == &#8216;On&#8217;) then<br \/>   os.execute (\u00abc:\\\\PROGRA~1\\\\Domoticz\\\\scripts\\\\noo.exe com4 n2\u00bb) <br \/>  end<br \/>  if (devicechanged[sensor4] == &#8216;Off&#8217;) then<br \/>   os.execute (\u00abc:\\\\PROGRA~1\\\\Domoticz\\\\scripts\\\\noo.exe com4 f2\u00bb) <br \/>  end<br \/>  if (devicechanged[sensor5] == &#8216;Off&#8217;) then<br \/>   os.execute (\u00abc:\\\\PROGRA~1\\\\Domoticz\\\\scripts\\\\noo.exe com4 z9\u00bb) <br \/>  end<br \/>  return commandArray  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u043b\u0430\u043d \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u044d\u0442\u0430\u0436\u0430 \u0432 Domoticz<\/b><\/p>\n<div class=\"spoiler_text\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/9b9\/300\/3b5\/9b93003b5232474da997a3bf950765b1.PNG\"\/>  <\/div>\n<\/div>\n<p>  \u041a\u043e\u0440\u043e\u0442\u043a\u043e\u0435 <a href=\"https:\/\/youtu.be\/M1AZG00RTbA\">\u0432\u0438\u0434\u0435\u043e<\/a><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/geektimes.ru\/post\/287586\/\"> https:\/\/geektimes.ru\/post\/287586\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u044f Noolite MTRF-32 \u043a \u0441\u0432\u043e\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0443\u043c\u043d\u044b\u043c \u0434\u043e\u043c\u043e\u043c \u043d\u0430 \u0431\u0430\u0437\u0435 <a href=\"http:\/\/www.domoticz.com\/\">Domoticz<\/a>.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-284315","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/284315","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=284315"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/284315\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=284315"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=284315"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=284315"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}