{"id":293053,"date":"2019-08-06T15:01:35","date_gmt":"2019-08-06T15:01:35","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=293053"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=293053","title":{"rendered":"\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c ZigBee \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0432 Homebridge \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f CC2531"},"content":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\">\u041d\u0430 \u0425\u0430\u0431\u0440\u0435 <a href=\"https:\/\/habr.com\/ru\/company\/iobroker\/blog\/433340\/\">\u0443\u0436\u0435 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u043b\u0438\u0441\u044c<\/a> <a href=\"https:\/\/habr.com\/ru\/post\/430882\/\">\u0441\u0442\u0430\u0442\u044c\u0438<\/a> \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u043f\u043e\u0434\u0440\u0443\u0436\u0438\u0442\u044c ZigBee \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u0435\u0439 \u0441 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u043c\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0443\u043c\u043d\u044b\u043c \u0434\u043e\u043c\u043e\u043c, \u0431\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0444\u0438\u0440\u043c\u0435\u043d\u043d\u044b\u0445 \u0445\u0430\u0431\u043e\u0432, \u0432\u0440\u043e\u0434\u0435 Xiaomi Gateway. \u041e\u0434\u043d\u0430\u043a\u043e, \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0434\u043b\u044f <a href=\"https:\/\/homebridge.io\/\">homebridge<\/a>, \u044f \u043d\u0435 \u043d\u0430\u0448\u0435\u043b \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u0425\u0430\u0431\u0440\u0435, \u043d\u043e \u0438 \u043d\u0430 \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u0440\u043e\u0441\u0442\u043e\u0440\u0430\u0445 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0445\u043e\u0447\u0443 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u043e\u043f\u044b\u0442\u043e\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f ZigBee \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u0432 homebridge. \u041e\u0433\u0440\u043e\u043c\u043d\u0443\u044e \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u043d\u043e\u0441\u0442\u044c \u043d\u0430\u0434\u043e \u0432\u044b\u0440\u0430\u0437\u0438\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u0442\u0435\u043b\u044e \u0440\u0435\u0441\u0443\u0440\u0441\u0430 <a href=\"https:\/\/www.zigbee2mqtt.io\/\">zigbee2mqtt.io<\/a>, \u0442\u0430\u043c \u0443\u0436\u0435 \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u044b \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0438 \u043c\u043e\u0434\u0435\u043c\u0430 CC2531 \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u0442\u0430\u043a\u0438\u043c \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u043c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0443\u043c\u043d\u044b\u043c \u0434\u043e\u043c\u043e\u043c \u043a\u0430\u043a <a href=\"https:\/\/www.home-assistant.io\/\">Home Assistant<\/a>, <a href=\"http:\/\/www.domoticz.com\/\">Domoticz<\/a> \u0438 <a href=\"https:\/\/mjdm.ru\/\">Majordomo<\/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:\/\/habr.com\/ru\/company\/e-legion\/blog\/350312\/\">\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d <\/a>homebridge. <br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ks\/8v\/ed\/ks8vedjib2uzaobxsshhhgfrm0g.jpeg\"><br \/>  <a name=\"habracut\"><\/a><br \/>  \u0412\u0441\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043d\u0430\u0431\u043e\u0440\u043e\u043c \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u044f: <\/p>\n<ul>\n<li>Raspberry Pi 3 B+ (OS Raspbian)<\/li>\n<li><a href=\"https:\/\/ru.aliexpress.com\/item\/33011691700.html?spm=a2g0o.productlist.0.0.5d143db34eOPUW&amp;algo_pvid=1caa81cb-0229-4709-8510-af107d0f3641&amp;algo_expid=1caa81cb-0229-4709-8510-af107d0f3641-10&amp;btsid=f8a43113-0c72-4f13-af64-30b6cc790432&amp;ws_ab_test=searchweb0_0,searchweb201602_5,searchweb201603_52\">CC2531 Dongle<\/a> (\u041f\u0440\u043e\u0448\u0438\u0442\u044b\u0439)<\/li>\n<li>\u0423\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 Xiaomi (wireless switch, temperature &amp; humidity sensor&#8230;)<\/li>\n<li>MacBook Pro (OSX 10.14)<\/li>\n<\/ul>\n<p>  \u0418\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043f\u043e \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0435 CC2531 \u043d\u0430 \u0440\u0443\u0441\u0441\u043a\u043e\u043c \u044f\u0437\u044b\u043a\u0435 \u0435\u0441\u0442\u044c <a href=\"https:\/\/kvvhost.ru\/2019\/05\/29\/zigbee2mqtt-cc2531-raspberry-pi\/\">\u0442\u0443\u0442 (\u0447\u0435\u0440\u0435\u0437 Pi)<\/a> \u0438 <a href=\"https:\/\/tech-geek.ru\/zwave-and-zigbee-control\/\">\u0442\u0443\u0442 (\u0447\u0435\u0440\u0435\u0437 CCDebuger)<\/a>.<\/p>\n<p>  \u0421\u0445\u0435\u043c\u0430\u0442\u0438\u0447\u043d\u043e \u0432\u0441\u044e \u0446\u0435\u043f\u043e\u0447\u043a\u0443 \u0440\u0430\u0431\u043e\u0442\u044b \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u0442\u0430\u043a:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/2-\/6w\/-t\/2-6w-tvahvt1zxxhk6ivodtyuya.png\"><\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443.<\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0438 \u043c\u043e\u0434\u0435\u043c\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c <a href=\"https:\/\/habr.com\/ru\/post\/388231\/\">MQTT \u0431\u0440\u043e\u043a\u0435\u0440<\/a> (\u0435\u0441\u043b\u0438 \u0435\u0449\u0435 \u043d\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d).<\/p>\n<p>  \u042f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e Mosquitto, \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 install -y mosquitto mosquitto-clients #\u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043a\u0430 sudo services mosquitto start # \u0437\u0430\u043f\u0443\u0441\u043a sudo systemctl enable mosquitto.service #\u0430\u0432\u0442\u043e\u0437\u0430\u043f\u0443\u0441\u043a<\/code><\/pre>\n<p>  \u0411\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0443\u044e \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e \u043f\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c <a href=\"https:\/\/leodev.ru\/blog\/misc\/%D1%83%D1%81%D1%82%D0%B0%D0%BD%D0%BE%D0%B2%D0%BA%D0%B0-%D0%B8-%D0%BD%D0%B0%D1%81%D1%82%D1%80%D0%BE%D0%B9%D0%BA%D0%B0-mosquitto-%D0%B2-ubuntu\/\">\u0442\u0443\u0442<\/a>.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441 zigbee2mqtt, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442 \u0441 \u043c\u043e\u0434\u0435\u043c\u043e\u043c CC2531 \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 Mosquitto:<\/p>\n<pre><code class=\"bash\">sudo git clone https:\/\/github.com\/Koenkk\/zigbee2mqtt.git \/opt\/zigbee2mqtt sudo chown -R pi:pi \/opt\/zigbee2mqtt cd \/opt\/zigbee2mqtt npm install<\/code><\/pre>\n<p>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c zigbee2mqtt \u043a\u0430\u043a \u0441\u0435\u0440\u0432\u0438\u0441, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0444\u0430\u0439\u043b:<br \/>  <code>\/etc\/systemd\/system\/zigbee2mqtt.service<\/code><\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u044b\u043c:<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"plaintext\">[Unit] Description=zigbee2mqtt After=network.target  [Service] ExecStart=\/usr\/bin\/npm start WorkingDirectory=\/opt\/zigbee2mqtt StandardOutput=inherit StandardError=inherit Restart=always User=pi  [Install] WantedBy=multi-user.target<\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <i>\u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0443\u0436\u0435 \u0431\u044b\u043b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d MQTT \u0431\u0440\u043e\u043a\u0435\u0440 \u0442\u043e \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u043d\u0435\u043c\u0443 \u043d\u0443\u0436\u043d\u043e \u0432 \u0444\u0430\u0439\u043b\u0435:<\/i><\/p>\n<pre><code class=\"plaintext\">\/opt\/zigbee2mqtt\/data\/configuration.yaml<\/code><\/pre>\n<p>  \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0441\u0435\u0440\u0432\u0438\u0441 \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0435\u0433\u043e \u0432 \u0430\u0432\u0442\u043e\u0437\u0430\u043f\u0443\u0441\u043a:<\/p>\n<pre><code class=\"bash\">sudo systemctl start zigbee2mqtt sudo systemctl enable zigbee2mqtt.service<\/code><\/pre>\n<p>  \u0421\u043c\u043e\u0442\u0440\u0438\u043c \u043b\u043e\u0433:<\/p>\n<pre><code class=\"bash\">sudo journalctl -u zigbee2mqtt.service -f<\/code><\/pre>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0415\u0441\u043b\u0438 \u0432\u0441\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0434\u043e\u043b\u0436\u043d\u044b \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u0441\u0442\u0440\u043e\u043a\u0438:<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"plaintext\">`permit_join` set to  `true` in configuration.yaml. Allowing new devices to join. Set `permit_join` to `false` once you joined all devices. Zigbee: allowing new devices to join. Connecting to MQTT server at mqtt:\/\/localhost zigbee-shepherd ready Connected to MQTT server<\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0442\u044c \u043a \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0441 homebridge. \u041d\u0430 \u0440\u0435\u0441\u0443\u0440\u0441\u0435 <a href=\"https:\/\/www.zigbee2mqtt.io\/\">zigbee2mqtt.io<\/a> \u0435\u0441\u0442\u044c <a href=\"https:\/\/www.zigbee2mqtt.io\/information\/supported_devices.html\">\u0441\u043f\u0438\u0441\u043e\u043a \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u044b\u0445<\/a> \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043f\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u043f\u0430\u0440\u044b. \u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 Xiaomi Wireless Switch. <\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/9e\/ju\/w0\/9ejuw0kiyvyaaki1uztk-4ir3re.jpeg\"><\/p>\n<p>  \u0414\u043b\u044f \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0432 Mosquitto \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043e\u0439 <a href=\"http:\/\/mqtt-explorer.com\/\">MQTT Explorer<\/a>. \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c, \u0432\u0432\u043e\u0434\u0438\u043c \u0430\u0434\u0440\u0435\u0441 MQTT \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u0432 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u043d \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 <code>192.168.1.104<\/code>. \u0415\u0441\u043b\u0438 \u0432\u0441\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e, \u0442\u043e \u0432 \u0434\u0435\u0440\u0435\u0432\u0435 \u0443\u0432\u0438\u0434\u0438\u043c \u0432\u0435\u0442\u043a\u0443 zigbee2mqtt. \u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 \u043d\u0435\u0435. \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430 Xiaomi Wireless Switch \u0437\u0430\u0436\u0438\u043c\u0430\u0435\u043c \u043a\u043d\u043e\u043f\u043a\u0443 Reset \u0434\u043e \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u043c\u0438\u0433\u0430\u043d\u0438\u044f \u0434\u0438\u043e\u0434\u0430 (\u043e\u043a\u043e\u043b\u043e 5 \u0441\u0435\u043a\u0443\u043d\u0434). \u041f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0447\u0435\u0440\u0435\u0437 10 \u0441\u0435\u043a\u0443\u043d\u0434 \u0432 \u0432\u0435\u0442\u043a\u0435 zigbee2mqtt \u043c\u044b \u0443\u0432\u0438\u0434\u0438\u043c \u043d\u0430\u0448\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043e\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442.<\/p>\n<p>  <i> \u0415\u0441\u043b\u0438 \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442, \u0442\u043e \u043f\u043e\u0441\u043b\u0435 \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u043c\u0438\u0433\u0430\u043d\u0438\u044f \u0434\u0438\u043e\u0434\u0430, \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u043e\u0434\u043d\u043e\u043a\u0440\u0430\u0442\u043d\u043e \u043d\u0430\u0436\u0438\u043c\u0430\u0442\u044c Reset \u0441 \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u043d\u043e\u0441\u0442\u044c\u044e \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0443. \u0414\u043e\u043b\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u0442\u0430\u043a:<\/i><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/gt\/fh\/xx\/gtfhxx2stlsj0j33n-latewekyw.gif\"><\/p>\n<p>  \u0420\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435:<\/p>\n<pre><code class=\"json\">{   \"linkquality\":110,   \"battery\":100,   \"voltage\":3052,   \"click\":\"single\" }<\/code><\/pre>\n<p>  \u041f\u043e\u043b\u0435 Click \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0442\u0438\u043f \u043d\u0430\u0436\u0430\u0442\u0438\u044f, \u0438\u0445 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u044f\u0442\u044c:<br \/>  <code>Click, double click, triple click, long, long_release<\/code><\/p>\n<p>  \u0414\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u043d\u0430\u0443\u0447\u0438\u043b\u0438\u0441\u044c, \u0442\u0435\u043f\u0435\u0440\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u043c Xiaomi Wireless Switch \u0432 homebrdige. \u0414\u043b\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 MQTT \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u043c\u043e\u0434\u0443\u043b\u0435\u043c <a href=\"https:\/\/www.npmjs.com\/package\/homebridge-mqttthing\">homebridge-mqttthing<\/a>. \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u0438 \u0434\u0440\u0443\u0433\u0438\u0435:<\/p>\n<pre><code class=\"bash\">(sudo) npm install -g homebridge-mqttthing<\/code><\/pre>\n<p>  \u041c\u043e\u0434\u0443\u043b\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u0432\u044b\u043a\u043b\u044e\u0447\u0430\u0442\u0435\u043b\u0435\u0439 \u0438 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u044f \u0442\u0435\u0440\u043c\u043e\u0441\u0442\u0430\u0442\u0430\u043c\u0438. \u0414\u043b\u044f Xiaomi Wireless Switch \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u043a\u043b\u0430\u0441\u0441 <code>StatelessProgramableSwitch<\/code>. \u0414\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u0443\u0436\u043d\u043e \u0437\u043d\u0430\u0442\u044c Topic <code>(0x00158d00022c85ea)<\/code> \u0438 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u043c\u0430\u043d\u0434. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433:<\/p>\n<pre><code class=\"json\">{        \"accessory\": \"mqttthing\",        \"type\": \"statelessProgrammableSwitch\",         \"name\": \"Xiaomi Single Button\",         \"topics\": {             \"getSwitch\": {                \"topic\": \"zigbee2mqtt\/0x00158d00022c85ea\",                 \"apply\": \"return JSON.parse(message).click;\"             }         },         \"switchValues\": [             \"single\",             \"double\",              \"long_release\"         ] }<\/code><\/pre>\n<p>  \u041f\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0438 \u044f \u0434\u043e\u0431\u0430\u0432\u0438\u043b: <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0434\u0430\u0442\u0447\u0438\u043a \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b \u0438 \u0432\u043b\u0430\u0436\u043d\u043e\u0441\u0442\u0438, \u0434\u0430\u0442\u0447\u0438\u043a \u043a\u0430\u0441\u0430\u043d\u0438\u044f, \u0434\u0430\u0442\u0447\u0438\u043a \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u044f \u0438 \u0432\u044b\u043a\u043b\u044e\u0447\u0430\u0442\u0435\u043b\u044c.<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"json\">\"accessories\":  [     {         \"accessory\": \"mqttthing\",         \"type\": \"occupancySensor\",         \"name\": \"Xiaomi Occupancy Sencor\",         \"topics\": {             \"getOccupancyDetected\": {                 \"topic\": \"zigbee2mqtt\/0x00158d000236b492\",                 \"apply\": \"return JSON.parse(message).occupancy;\"             }         },         \"integerValue\": true     },     {         \"accessory\": \"mqttthing\",         \"type\": \"contactSensor\",         \"name\": \"Xiaomi Contatc Sencor\",         \"topics\": {             \"getContactSensorState\": {                 \"topic\": \"zigbee2mqtt\/0x00158d000278db8c\",                 \"apply\": \"return !JSON.parse(message).contact;\"             }         },         \"integerValue\": true     },     {         \"accessory\": \"mqttthing\",         \"type\": \"statelessProgrammableSwitch\",         \"name\": \"Xiaomi Single Button\",         \"topics\": {             \"getSwitch\": {                 \"topic\": \"zigbee2mqtt\/0x00158d00022c85ea\",                 \"apply\": \"return JSON.parse(message).click;\"             }         },         \"switchValues\": [             \"single\",             \"double\",            \"long_release\"         ]     },     {         \"accessory\": \"mqttthing\",         \"type\": \"temperatureSensor\",         \"name\": \"Xiaomi Temperature Sencor\",         \"topics\": {             \"getCurrentTemperature\": {                 \"topic\": \"zigbee2mqtt\/0x00158d000201842c\",                 \"apply\": \"return parseFloat(JSON.parse(message).temperature);\"             }         },         \"history\": true     },     {         \"accessory\": \"mqttthing\",         \"type\": \"humiditySensor\",         \"name\": \"Xiaomi Humidity Sencor\",         \"topics\": {             \"getCurrentRelativeHumidity\": {                 \"topic\": \"zigbee2mqtt\/0x00158d000201842c\",                 \"apply\": \"return parseFloat(JSON.parse(message).humidity);\"             }         },         \"history\": true     } ]<\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ej\/s1\/vh\/ejs1vhvxug4sbbwql-cwekquerk.gif\"><\/p>\n<p>  \u0420\u0430\u043d\u044c\u0448\u0435 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u043c\u043e\u0434\u0443\u043b\u044c homebridge-mi-aqara, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 ZigBee \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430, \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044f \u0441 Xiaomi Gateway. \u041f\u0440\u0438 \u043e\u0442\u043a\u0430\u0437\u0435 \u043e\u0442 Gateway \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u043b\u043e\u0441\u044c \u0432\u0440\u0435\u043c\u044f \u043e\u0442\u043a\u043b\u0438\u043a\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432, \u0432\u0434\u043e\u0431\u0430\u0432\u043e\u043a \u044f \u0438\u0437\u0431\u0430\u0432\u0438\u043b\u0441\u044f \u043e\u0442 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0441\u0438\u0434\u0438\u0442 \u043d\u0430 \u043c\u043e\u0435\u043c WiFi \u0438 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u043b\u0435\u0437\u0435\u0442 \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442.<\/p><\/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\/462459\/\"> https:\/\/habr.com\/ru\/post\/462459\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\">\u041d\u0430 \u0425\u0430\u0431\u0440\u0435 <a href=\"https:\/\/habr.com\/ru\/company\/iobroker\/blog\/433340\/\">\u0443\u0436\u0435 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u043b\u0438\u0441\u044c<\/a> <a href=\"https:\/\/habr.com\/ru\/post\/430882\/\">\u0441\u0442\u0430\u0442\u044c\u0438<\/a> \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u043f\u043e\u0434\u0440\u0443\u0436\u0438\u0442\u044c ZigBee \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u0435\u0439 \u0441 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u043c\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0443\u043c\u043d\u044b\u043c \u0434\u043e\u043c\u043e\u043c, \u0431\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0444\u0438\u0440\u043c\u0435\u043d\u043d\u044b\u0445 \u0445\u0430\u0431\u043e\u0432, \u0432\u0440\u043e\u0434\u0435 Xiaomi Gateway. \u041e\u0434\u043d\u0430\u043a\u043e, \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0434\u043b\u044f <a href=\"https:\/\/homebridge.io\/\">homebridge<\/a>, \u044f \u043d\u0435 \u043d\u0430\u0448\u0435\u043b \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u0425\u0430\u0431\u0440\u0435, \u043d\u043e \u0438 \u043d\u0430 \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u0440\u043e\u0441\u0442\u043e\u0440\u0430\u0445 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0445\u043e\u0447\u0443 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u043e\u043f\u044b\u0442\u043e\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f ZigBee \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u0432 homebridge. \u041e\u0433\u0440\u043e\u043c\u043d\u0443\u044e \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u043d\u043e\u0441\u0442\u044c \u043d\u0430\u0434\u043e \u0432\u044b\u0440\u0430\u0437\u0438\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u0442\u0435\u043b\u044e \u0440\u0435\u0441\u0443\u0440\u0441\u0430 <a href=\"https:\/\/www.zigbee2mqtt.io\/\">zigbee2mqtt.io<\/a>, \u0442\u0430\u043c \u0443\u0436\u0435 \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u044b \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0438 \u043c\u043e\u0434\u0435\u043c\u0430 CC2531 \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u0442\u0430\u043a\u0438\u043c \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u043c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0443\u043c\u043d\u044b\u043c \u0434\u043e\u043c\u043e\u043c \u043a\u0430\u043a <a href=\"https:\/\/www.home-assistant.io\/\">Home Assistant<\/a>, <a href=\"http:\/\/www.domoticz.com\/\">Domoticz<\/a> \u0438 <a href=\"https:\/\/mjdm.ru\/\">Majordomo<\/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:\/\/habr.com\/ru\/company\/e-legion\/blog\/350312\/\">\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d <\/a>homebridge. <br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ks\/8v\/ed\/ks8vedjib2uzaobxsshhhgfrm0g.jpeg\">  <\/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-293053","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/293053","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=293053"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/293053\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=293053"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=293053"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=293053"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}