{"id":293498,"date":"2019-08-16T21:00:42","date_gmt":"2019-08-16T21:00:42","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=293498"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=293498","title":{"rendered":"\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f homebridge \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Node-Red"},"content":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\">\u041d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u0433\u043b\u0430\u0432\u043d\u044b\u0445 \u043c\u0438\u043d\u0443\u0441\u043e\u0432 homebridge \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0442\u0441\u0443\u0442\u0441\u0432\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u044b\u0435 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438. \u0412\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u0432\u043e\u0437\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0434\u043e\u043c\u0430\u0448\u043d\u0438\u0439 \u0446\u0435\u043d\u0442\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c Ipad (\u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044b\u0439 \u043a \u0437\u0430\u0440\u044f\u0434\u043a\u0435), Apple TV \u0438\u043b\u0438 HomePod. \u041d\u0435 \u0443 \u0432\u0441\u0435\u0445 \u044d\u0442\u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0435\u0441\u0442\u044c, \u0432\u0434\u043e\u0431\u0430\u0432\u043e\u043a \u0443 HomeKit \u043e\u0447\u0435\u043d\u044c \u0441\u043a\u0443\u0434\u043d\u0430\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f. \u0418\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u0443\u044e \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e \u043c\u043e\u0436\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"https:\/\/nodered.org\/\">Node-Red<\/a>. \u0421\u0442\u0430\u0442\u044c\u044f \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043d\u0430 \u043d\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439, \u0443 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0443\u0436\u0435 <a href=\"https:\/\/sprut.ai\/client\/article\/86\">\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d<\/a> homebridge. <\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/cn\/lp\/ee\/cnlpeethm72qkefjk71tiyeuq2k.png\"><br \/>  <a name=\"habracut\"><\/a><br \/>  \u041a\u043e\u0440\u043e\u0442\u043a\u043e: Node-RED \u2014 \u044d\u0442\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u0441\u0432\u044f\u0437\u0438 \u0436\u0435\u043b\u0435\u0437\u0430, API-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 \u0438 \u043e\u043d\u043b\u0430\u0439\u043d-\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432\u044b\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u043d\u0438\u044f \u0446\u0435\u043f\u043e\u0447\u0435\u043a \u0441\u0432\u044f\u0437\u0435\u0439 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0443\u0437\u043b\u043e\u0432 (\u0431\u043b\u043e\u043a\u043e\u0432).<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043d\u0430 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u0430\u0439\u0442\u0435:<\/b><\/p>\n<div class=\"spoiler_text\">\n<blockquote><p>Node-RED is a programming tool for wiring together hardware devices, APIs and online services in new and interesting ways.<br \/>  It provides a browser-based editor that makes it easy to wire together flows using the wide range of nodes in the palette that can be deployed to its runtime in a single-click. <\/p><\/blockquote>\n<p>  <\/div>\n<\/div>\n<p>  \u041d\u0430 Raspbian \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u0430\u043a:<\/p>\n<pre><code class=\"bash\">sudo apt-get install nodered sudo systemctl enable nodered.service sudo service nodered start<\/code><\/pre>\n<p>  \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e Node-Red \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 \u043f\u043e\u0440\u0442\u0443 1880.<\/p>\n<p>  \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043e\u0433\u0440\u043e\u043c\u043d\u0430\u044f <a href=\"https:\/\/flows.nodered.org\/\">\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430<\/a> \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0441 \u043d\u0430\u0431\u043e\u0440\u0430\u043c\u0438 \u0431\u043b\u043e\u043a\u043e\u0432 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u043e\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430. \u041d\u0435 \u043e\u0431\u043e\u0448\u043b\u0438 \u0441\u0442\u043e\u0440\u043e\u043d\u043e\u0439 \u0438 homebridge. \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c <a href=\"https:\/\/github.com\/NorthernMan54\/node-red-contrib-homebridge-automation\">node-red-contrib-homebridge-automation<\/a>:<\/p>\n<pre><code class=\"bash\">cd ~\/.node-red npm install node-red-contrib-homebridge-automation sudo service nodered restart<\/code><\/pre>\n<p>  \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043b\u0430\u043c\u043f\u043e\u0447\u043a\u0443. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u0442\u0430\u0449\u0438\u043c \u043d\u0430 \u0440\u0430\u0431\u043e\u0447\u0443\u044e \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u0431\u043b\u043e\u043a <i>hb-control<\/i>, <i>function<\/i> (\u044d\u0442\u043e\u0442 \u0431\u043b\u043e\u043a \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0441\u044b\u043b\u0430\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f) \u0438 <i>inject<\/i> (\u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u043d\u0443\u0436\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0440\u0443\u0447\u043d\u043e\u0439 \u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u0438 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f). \u041f\u0435\u0440\u0432\u044b\u0439 \u0440\u0430\u0437 \u0434\u043b\u044f <i>hb-\u0431\u043b\u043e\u043a\u043e\u0432<\/i> \u043d\u0435\u043e\u0431\u0445\u043e\u0438\u043c\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c <b>PIN<\/b> \u0438 \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432. \u041f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u0443\u0436\u043d\u044b\u0435 \u0431\u043b\u043e\u043a\u0438:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/rw\/nb\/my\/rwnbmya0zffihpzgkjn18g7bbog.gif\"><\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e \u043d\u0430\u0436\u0430\u0442\u0438\u044e \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443 \u0432 \u0431\u043b\u043e\u043a\u0435 <i>inject<\/i> \u0434\u043e\u043b\u0436\u043d\u0430 \u0437\u0430\u0433\u043e\u0440\u0435\u0442\u044c\u0441\u044f \u043b\u0430\u043c\u043f\u043e\u0447\u043a\u0430. \u041f\u043e \u043c\u0438\u043c\u043e <i>hb-contoll<\/i> \u0435\u0441\u0442\u044c \u0442\u0430\u043a \u0436\u0435 \u0431\u043b\u043e\u043a\u0438 <i>hb-event, hb-status \u0438 hb-resume<\/i>. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0431\u043b\u043e\u043a\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c <a href=\"https:\/\/github.com\/NorthernMan54\/node-red-contrib-homebridge-automation\">\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438<\/a>.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434 \u0431\u043b\u043e\u043a\u0430 function<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\">var ret_msg={}; ret_msg.payload = {}; ret_msg.payload.On = true; return ret_msg;<\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0411\u043b\u043e\u043a <i>function<\/i> \u0441\u043e\u0437\u0434\u0430\u043d \u0434\u043b\u044f \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u044f\u0437\u044b\u043a\u0430 JavaScript. \u0411\u043b\u043e\u043a \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043d\u0430 \u0432\u0445\u043e\u0434 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <i>msg<\/i> \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c <i>payload<\/i>, \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0431\u043b\u043e\u043a\u043e\u0432 \u0432 Node-Red \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0438\u043c\u0435\u043d\u043d\u043e \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c <i>payload<\/i>.<\/p>\n<p>  \u0421\u0442\u043e\u0438\u0442 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0440\u043e \u0431\u043b\u043e\u043a <i>Debug<\/i>, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043d\u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c, \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0431\u043b\u043e\u043a\u043e\u0432, \u0447\u0442\u043e \u0431\u044b \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c \u0432 \u0447\u0435\u043c \u043e\u0448\u0438\u0431\u043a\u0430, \u0435\u0441\u043b\u0438 \u0432\u0430\u0448\u0430 \u0437\u0430\u0434\u0443\u043c\u043a\u0430 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0447\u0442\u043e \u043d\u0438\u0431\u0443\u0434\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u043c \u0441\u0432\u0435\u0442 \u043c\u0435\u043d\u044f\u0442\u044c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043f\u043e\u0441\u043b\u0435 \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u0430 <a href=\"https:\/\/xiaomi-smarthome.ru\/aqara-cube-controller\/\">MagicCube<\/a> \u043d\u0430 90 \u0433\u0440\u0430\u0434\u0443\u0441\u043e\u0432. \u0412 \u043f\u0440\u043e\u0448\u043b\u043e\u0439 <a href=\"https:\/\/habr.com\/ru\/post\/462459\/\">\u0441\u0442\u0430\u0442\u044c\u0435<\/a>, \u044f \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u043b \u043a\u0430\u043a \u043f\u043e\u0434\u0440\u0443\u0436\u0438\u0442\u044c zigbee \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0441 homebridge. MagicCube, \u043a\u0430\u043a \u0438 \u043f\u0440\u043e\u0447\u0438\u0435 zigbee \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430, \u043f\u043e\u0441\u043b\u0435 \u043f\u0430\u0440\u0438\u043d\u0433\u0430 \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u0432 MQTT \u0431\u0440\u043e\u043a\u0435\u0440\u0435. <\/p>\n<p>  Node-Red \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 MQTT \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b \u00ab\u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438\u00bb. \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0431\u043b\u043e\u043a MQTT, \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0430\u0434\u0440\u0435\u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0438 Topic \u043a\u0443\u0431\u0438\u043a\u0430. <\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/qk\/7u\/uk\/qk7uuktlctg3qihziwznchjubvk.gif\"><\/p>\n<p>  \u041a\u0443\u0431\u0438\u043a \u043c\u043e\u0436\u0435\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f:<br \/>  <i>flip90, flip180, shake, rotate, move, tap, wake<\/i><\/p>\n<p>  \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0431\u043b\u043e\u043a <i>switch<\/i>, \u0447\u0442\u043e\u0431\u044b \u043e\u0442\u0434\u0435\u043b\u0438\u0442\u044c \u043e\u0434\u043d\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043e\u0442 \u0434\u0440\u0443\u0433\u043e\u0433\u043e. \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u0432 <i>switch<\/i> \u0443\u0441\u043b\u043e\u0432\u0438\u044f <i>flip90<\/i>, <i>shake<\/i> \u0438 <i>tap<\/i>. \u0412\u0435\u0440\u0445\u043d\u0438\u0439 \u0432\u044b\u0445\u043e\u0434 \u0441\u043e\u0435\u0434\u0438\u043d\u0438\u043c \u0441 <i>hb-status<\/i>, \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043b\u0430\u043c\u043f\u043e\u0447\u043a\u0438. \u0411\u043b\u043e\u043a <i>hb-status<\/i> \u0441\u043e\u0435\u0434\u0438\u043d\u0438\u043c \u0441 \u0431\u043b\u043e\u043a\u043e\u043c <i>Invert On Value<\/i> \u0438\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u0443\u044e\u0449\u0438\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435, \u0430 \u0435\u0433\u043e \u0432\u044b\u0445\u043e\u0434 \u0441\u043e\u0435\u0434\u0438\u043d\u0438\u043c \u0441 <i>hb-controll<\/i> \u0438 \u043f\u0440\u0438 \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u0435 \u043a\u0443\u0431\u0438\u043a\u0430 \u043b\u0430\u043c\u043f\u043e\u0447\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u043c\u0435\u043d\u044f\u0442\u044c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0432\u043a\u043b\/\u0432\u044b\u043a\u043b. \u0414\u043e\u043b\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/jn\/oz\/bg\/jnozbgpenmlh3_o0e6tqkrko85e.png\"><\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434 Invert On Value<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\">var ret_msg=msg; ret_msg.payload.On = !msg.payload.On; return ret_msg;<\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>   Flow \u043c\u043e\u0436\u043d\u043e \u0438\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0442 \u0441\u044e\u0434\u0430:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">Flow<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"json\">[     {         \"id\": \"f0f31eb6.22f16\",         \"type\": \"tab\",         \"label\": \"Flow 1\",         \"disabled\": false,         \"info\": \"\"     },     {         \"id\": \"e0f72465.9e4fb8\",         \"type\": \"mqtt in\",         \"z\": \"f0f31eb6.22f16\",         \"name\": \"\",         \"topic\": \"zigbee2mqtt\/0x00158d00010f0528\",         \"qos\": \"2\",         \"datatype\": \"auto\",         \"broker\": \"8ec472b.e73e29\",         \"x\": 160,         \"y\": 80,         \"wires\": [             [                 \"43f74679.730588\"             ]         ]     },     {         \"id\": \"8539109.d872ff\",         \"type\": \"debug\",         \"z\": \"f0f31eb6.22f16\",         \"name\": \"\",         \"active\": true,         \"tosidebar\": true,         \"console\": false,         \"tostatus\": false,         \"complete\": \"false\",         \"x\": 670,         \"y\": 60,         \"wires\": []     },     {         \"id\": \"c5db7c5b.399f4\",         \"type\": \"hb-status\",         \"z\": \"f0f31eb6.22f16\",         \"name\": \"Room1\",         \"Homebridge\": \"HomeBridge\",         \"Manufacturer\": \"YeeLight\",         \"Service\": \"Lightbulb\",         \"device\": \"HomeBridgeA1:23:AD:E3:CD:32YeeLightRoom100000043\",         \"conf\": \"7948a496.505c2c\",         \"x\": 340,         \"y\": 180,         \"wires\": [             [                 \"9ef696d9.51a378\"             ]         ]     },     {         \"id\": \"43f74679.730588\",         \"type\": \"switch\",         \"z\": \"f0f31eb6.22f16\",         \"name\": \"CubeActions\",         \"property\": \"payload\",         \"propertyType\": \"msg\",         \"rules\": [             {                 \"t\": \"cont\",                 \"v\": \"flip90\",                 \"vt\": \"str\"             },             {                 \"t\": \"cont\",                 \"v\": \"tap\",                 \"vt\": \"str\"             },             {                 \"t\": \"cont\",                 \"v\": \"shake\",                 \"vt\": \"str\"             }         ],         \"checkall\": \"true\",         \"repair\": false,         \"outputs\": 3,         \"x\": 150,         \"y\": 240,         \"wires\": [             [                 \"c5db7c5b.399f4\"             ],             [],             []         ]     },     {         \"id\": \"f476dcba.a6511\",         \"type\": \"hb-control\",         \"z\": \"f0f31eb6.22f16\",         \"name\": \"Room1\",         \"Homebridge\": \"HomeBridge\",         \"Manufacturer\": \"YeeLight\",         \"Service\": \"Lightbulb\",         \"device\": \"HomeBridgeA1:23:AD:E3:CD:32YeeLightRoom100000043\",         \"conf\": \"7948a496.505c2c\",         \"x\": 700,         \"y\": 180,         \"wires\": []     },     {         \"id\": \"9ef696d9.51a378\",         \"type\": \"function\",         \"z\": \"f0f31eb6.22f16\",         \"name\": \"Invert On Value\",         \"func\": \"var ret_msg=msg;\\nret_msg.payload.On = !msg.payload.On;\\nreturn ret_msg;\",         \"outputs\": 1,         \"noerr\": 0,         \"x\": 520,         \"y\": 180,         \"wires\": [             [                 \"f476dcba.a6511\"             ]         ]     },     {         \"id\": \"8ec472b.e73e29\",         \"type\": \"mqtt-broker\",         \"z\": \"\",         \"name\": \"mosquitto\",         \"broker\": \"127.0.0.1\",         \"port\": \"1883\",         \"clientid\": \"\",         \"usetls\": false,         \"compatmode\": true,         \"keepalive\": \"60\",         \"cleansession\": true,         \"birthTopic\": \"\",         \"birthQos\": \"0\",         \"birthPayload\": \"\",         \"closeTopic\": \"\",         \"closeQos\": \"0\",         \"closePayload\": \"\",         \"willTopic\": \"\",         \"willQos\": \"0\",         \"willPayload\": \"\"     },     {         \"id\": \"7948a496.505c2c\",         \"type\": \"hb-conf\",         \"z\": \"\",         \"username\": \"111-11-111\"     } ]<\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u00ab\u043b\u0435\u043f\u0438\u0442\u044c\u00bb \u0438\u0437 \u0431\u043b\u043e\u043a\u043e\u0432 \u0441\u043b\u043e\u0436\u043d\u0435\u0439\u0448\u0438\u0435 \u0441\u0445\u0435\u043c\u044b \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438. \u0412 <a href=\"https:\/\/flows.nodered.org\/\">\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435<\/a> \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043c\u043e\u0434\u0443\u043b\u0438 \u0441 \u043d\u0430\u0431\u043e\u0440\u0430\u043c\u0438 \u0431\u043b\u043e\u043a\u043e\u0432 \u043f\u043e\u0434 \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u0440\u0430\u0437\u043d\u044b\u0435 \u0437\u0430\u0434\u0430\u0447\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u0441 \u043a\u0430\u043c\u0435\u0440 \u0432\u0438\u0434\u0435\u043e \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f \u0438\u043b\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0444\u0430\u0439\u043b\u0430\u043c\u0438.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">P.S. \u041c\u044b\u0441\u043b\u0438 \u0432\u0441\u043b\u0443\u0445:<\/b><\/p>\n<div class=\"spoiler_text\">\u042f \u043d\u0430\u0447\u0430\u043b \u0443\u0432\u043b\u0435\u043a\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0432 \u0448\u043a\u043e\u043b\u0435. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u044d\u0442\u043e \u043f\u044b\u043b Pascal, \u0437\u0430\u0442\u0435\u043c Delphi. \u041f\u043e\u0437\u0436\u0435 \u0443\u0432\u043b\u0435\u043a\u0441\u044f \u00ab\u043e\u043b\u0438\u043c\u043f\u0438\u0430\u0434\u043d\u044b\u043c\u00bb \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0438 \u043c\u043d\u0435 \u043e\u0431\u044a\u044f\u0441\u043d\u0438\u043b\u0438, \u0447\u0442\u043e \u043d\u0430 Pascal \u0434\u0430\u043b\u0435\u043a\u043e \u043d\u0435 \u0443\u0435\u0434\u0435\u0448\u044c. \u041d\u0430\u0447\u0430\u043b \u0438\u0437\u0443\u0447\u0430\u0442\u044c C++. \u041f\u043e\u0442\u043e\u043c \u043f\u043e\u0448\u043b\u043e-\u043f\u043e\u0435\u0445\u0430\u043b\u043e \u0438 \u043f\u0440\u0438\u0448\u043b\u043e \u043e\u0441\u043e\u0437\u043d\u0430\u043d\u0438\u0435 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u044f \u0437\u044b\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043e\u0441\u043e\u0431\u043e \u043d\u0435 \u0432\u0430\u0436\u0435\u043d, \u0435\u0433\u043e \u0432\u044b\u0431\u0438\u0440\u0430\u044e\u0442 \u043f\u043e\u0434 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u0437\u0430\u0434\u0430\u0447\u0438. <br \/>  <i>\u041a\u043e\u043d\u0435\u0447\u043d\u043e \u0435\u0441\u0442\u044c \u0433\u0443\u0440\u0443 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u00ab\u0441\u043e\u0431\u0430\u043a\u0443 \u0441\u044a\u0435\u043b\u0438\u00bb \u0438 \u043c\u043e\u0433\u0443\u0442 \u043d\u0430 \u043b\u044e\u0431\u0438\u043c\u043e\u043c \u044f\u0437\u044b\u043a\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0447\u0442\u043e \u0443\u0433\u043e\u0434\u043d\u043e <\/i><\/p>\n<p>  \u041c\u043d\u0435 \u043d\u0435 \u0434\u0430\u0435\u0442 \u043f\u043e\u043a\u043e\u044f \u043c\u044b\u0441\u043b\u044c \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043a\u0430\u043a \u0431\u044b \u043d\u0435 \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438, \u043f\u043e \u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u043c\u043d\u043e\u0433\u0438\u0435 \u043e\u0447\u0435\u043d\u044c \u0434\u0430\u043b\u0435\u043a\u0438 \u043e\u0442 \u0431\u0430\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0440\u0430\u0431\u043e\u0447\u0438\u0445 \u0438 \u0436\u0438\u0437\u043d\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u042f \u043e\u0447\u0435\u043d\u044c \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e \u0441 \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u0442\u0430\u043a\u0438\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043a\u0430\u043a <a href=\"https:\/\/nodered.org\/\">Node-Red<\/a> \u0438\u043b\u0438 <a href=\"https:\/\/developers.google.com\/blockly\/\">Blockly<\/a>, \u043f\u043e\u0440\u043e\u0433 \u0432\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0441\u0438\u043b\u044c\u043d\u043e \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u0441\u044f. \u041d\u0430\u0443\u0447\u0438\u0432\u0448\u0438\u0441\u044c, \u0432 \u0442\u043e\u043c \u0436\u0435 Node-Red \u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0438\u0437 \u043a\u0443\u0431\u0438\u043a\u043e\u0432, \u043b\u044e\u0434\u0438, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0431\u0443\u0434\u0443\u0442 \u0434\u043e\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u0434\u043e \u0431\u043b\u043e\u043a\u0430 <i>function<\/i> \u0438 \u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043e\u043c \u0443\u0447\u0438\u0442\u044c JS, \u0430 \u0434\u0430\u043b\u044c\u0448\u0435 \u0432\u0441\u0435 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0435\u0442 \u0441\u0430\u043c\u043e \u0441\u043e\u0431\u043e\u0439.  <\/div>\n<\/div>\n<\/div>\n<p>               <script class=\"js-mediator-script\">!function(e){function t(t,n){if(!(n in e)){for(var r,a=e.document,i=a.scripts,o=i.length;o--;)if(-1!==i[o].src.indexOf(t)){r=i[o];break}if(!r){r=a.createElement(\"script\"),r.type=\"text\/javascript\",r.async=!0,r.defer=!0,r.src=t,r.charset=\"UTF-8\";var d=function(){var e=a.getElementsByTagName(\"script\")[0];e.parentNode.insertBefore(r,e)};\"[object Opera]\"==e.opera?a.addEventListener?a.addEventListener(\"DOMContentLoaded\",d,!1):e.attachEvent(\"onload\",d):d()}}}t(\"\/\/mediator.mail.ru\/script\/2820404\/\",\"_mediator\")}(window);<\/script>     <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:\/\/habr.com\/ru\/post\/462775\/\"> https:\/\/habr.com\/ru\/post\/462775\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\">\u041d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u0433\u043b\u0430\u0432\u043d\u044b\u0445 \u043c\u0438\u043d\u0443\u0441\u043e\u0432 homebridge \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0442\u0441\u0443\u0442\u0441\u0432\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u044b\u0435 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438. \u0412\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u0432\u043e\u0437\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0434\u043e\u043c\u0430\u0448\u043d\u0438\u0439 \u0446\u0435\u043d\u0442\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c Ipad (\u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044b\u0439 \u043a \u0437\u0430\u0440\u044f\u0434\u043a\u0435), Apple TV \u0438\u043b\u0438 HomePod. \u041d\u0435 \u0443 \u0432\u0441\u0435\u0445 \u044d\u0442\u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0435\u0441\u0442\u044c, \u0432\u0434\u043e\u0431\u0430\u0432\u043e\u043a \u0443 HomeKit \u043e\u0447\u0435\u043d\u044c \u0441\u043a\u0443\u0434\u043d\u0430\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f. \u0418\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u0443\u044e \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e \u043c\u043e\u0436\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"https:\/\/nodered.org\/\">Node-Red<\/a>. \u0421\u0442\u0430\u0442\u044c\u044f \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043d\u0430 \u043d\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439, \u0443 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0443\u0436\u0435 <a href=\"https:\/\/sprut.ai\/client\/article\/86\">\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d<\/a> homebridge. <\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/cn\/lp\/ee\/cnlpeethm72qkefjk71tiyeuq2k.png\">  <\/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-293498","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/293498","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=293498"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/293498\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=293498"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=293498"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=293498"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}