{"id":37058206,"url":"https://github.com/sergey-brutsky/mi-home","last_synced_at":"2026-01-14T06:34:42.335Z","repository":{"id":51231373,"uuid":"101484873","full_name":"sergey-brutsky/mi-home","owner":"sergey-brutsky","description":"С# API for Xiaomi Mi Home devices","archived":false,"fork":false,"pushed_at":"2025-09-14T10:25:47.000Z","size":527,"stargazers_count":153,"open_issues_count":0,"forks_count":37,"subscribers_count":22,"default_branch":"master","last_synced_at":"2025-09-15T00:47:03.939Z","etag":null,"topics":["airhumidifier","aqara","csharp","dgnwg02lm","door-window-sensor","gateway","mi-robot-vacuum","motion-sensor","multimode-gateway","multimode-gateway-2","smoke-sensor","temperature-sensor","water-sensor","xiaomi","xiaomi-gateway","xiaomi-smart-home","zndmwg03lm","zndmwg04lm"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sergey-brutsky.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":null}},"created_at":"2017-08-26T12:39:04.000Z","updated_at":"2025-09-14T10:25:24.000Z","dependencies_parsed_at":"2024-06-26T21:16:47.684Z","dependency_job_id":"876babaf-09fb-4b0e-84d3-5701db16104c","html_url":"https://github.com/sergey-brutsky/mi-home","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/sergey-brutsky/mi-home","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergey-brutsky%2Fmi-home","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergey-brutsky%2Fmi-home/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergey-brutsky%2Fmi-home/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergey-brutsky%2Fmi-home/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sergey-brutsky","download_url":"https://codeload.github.com/sergey-brutsky/mi-home/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergey-brutsky%2Fmi-home/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28412211,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T05:26:33.345Z","status":"ssl_error","status_checked_at":"2026-01-14T05:21:57.251Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["airhumidifier","aqara","csharp","dgnwg02lm","door-window-sensor","gateway","mi-robot-vacuum","motion-sensor","multimode-gateway","multimode-gateway-2","smoke-sensor","temperature-sensor","water-sensor","xiaomi","xiaomi-gateway","xiaomi-smart-home","zndmwg03lm","zndmwg04lm"],"created_at":"2026-01-14T06:34:41.814Z","updated_at":"2026-01-14T06:34:42.327Z","avatar_url":"https://github.com/sergey-brutsky.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# C# Library for using xiaomi/aqara gateways in your automation scenarious\n\n[![Build project](https://github.com/sergey-brutsky/mi-home/actions/workflows/main.yml/badge.svg)](https://github.com/sergey-brutsky/mi-home/actions/workflows/main.yml)\n[![Tests](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/sergey-brutsky/d70d7e06eb53484b7514bfd63cec6885/raw/test_results.json)](https://github.com/sergey-brutsky/mi-home/actions/workflows/main.yml)\n[![Code coverage](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/sergey-brutsky/d70d7e06eb53484b7514bfd63cec6885/raw/code_cov.json)](https://github.com/sergey-brutsky/mi-home/actions/workflows/main.yml)\n[![CodeQL](https://github.com/sergey-brutsky/mi-home/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/sergey-brutsky/mi-home/actions/workflows/github-code-scanning/codeql)\n[![Nuget](https://img.shields.io/nuget/v/mihomelib)](https://www.nuget.org/packages/MiHomeLib)\n[![Nuget](https://img.shields.io/nuget/dt/mihomelib)](https://www.nuget.org/packages/MiHomeLib)\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/sergey-brutsky/mi-home/blob/master/LICENSE.md)\n\nThis library provides simple and flexible C# API for Xiaomi/Aqara gateways and smart devices.\n\n![xiaomi-gateway-2](https://user-images.githubusercontent.com/5664637/118375593-46751980-b5cb-11eb-81f9-93b095401737.jpeg)\n\n## Supported gateways\n\n| Gateway | Market Model | Model |\n|:--- |:---|:---|\n[Xiaomi Gateway 2 China](https://github.com/sergey-brutsky/mi-home/wiki/Xiaomi-Gateway-2) | DGNWG02LM | lumi.gateway.v3 |\n[Multimode Gateway](https://github.com/sergey-brutsky/mi-home/wiki/Multimode-Gateway) | ZNDMWG03LM | lumi.gateway.mgl03 |\n[Multimode Gateway 2 Global](https://github.com/sergey-brutsky/mi-home/wiki/Multimode-Gateway-2-Global) | ZNDMWG04LM | lumi.gateway.mgl001 |\n[Multimode Gateway 2 China](https://github.com/sergey-brutsky/mi-home/wiki/Multimode-Gateway-2-China) | DMWG03LM | lumi.gateway.mcn001 |\n[Aqara Hub E1 China](https://github.com/sergey-brutsky/mi-home/wiki/Aqara-Hub-E1-China) | ZHWG16LM | lumi.gateway.aqcn02 |\n\n## Supported wifi devices\n\n| Device | Market Model | Model |\n|:--- |:---|:---|\n\u003cbr\u003e\u003cimg src=\"https://github.com/user-attachments/assets/ad53bb54-8fff-4ee4-b169-ccf2e4d76ec3\" width=\"150\"\u003e\u003cbr\u003e[Xiaomi Mijia Smart Sterilization](https://github.com/sergey-brutsky/mi-home/wiki/Air-Humidifier-(MJJSQ03DY)) | MJJSQ03DY | zhimi.humidifier.v1 |\n\u003cbr\u003e\u003cimg src=\"https://github.com/user-attachments/assets/03b9b58b-0fc8-4f12-a4bb-e3e2fff12adf\" width=\"150\"\u003e\u003cbr\u003e[Xiaomi Mi Robot Vacuum Cleaner](https://github.com/sergey-brutsky/mi-home/wiki/Mi-Robot-Vacuum-(SDJQR02RR)) | SDJQR02RR | rockrobo.vacuum.v1 |\n\u003cbr\u003e\u003cimg src=\"https://github.com/user-attachments/assets/8d619a4a-f3a9-46c8-afe9-825827cb6c4e\" width=\"150\"\u003e\u003cbr\u003e[Mi Robot Mop 3C](https://github.com/sergey-brutsky/mi-home/wiki/Mi-Robot-Mop3C-(B106CN)) | B106CN | ijai.vacuum.v18 |\n\u003cbr\u003e\u003cimg src=\"https://github.com/user-attachments/assets/ec77bd4c-fd61-4522-8135-d0197cb32849\" width=\"150\"\u003e\u003cbr\u003e[Xiaomi Smart Plug 2 Euro](https://github.com/sergey-brutsky/mi-home/wiki/Xiaomi-Smart-Plug-2-Euro-(ZNCZ302KK)) | ZNCZ302KK | cuco.plug.v2eur |\n\u003cbr\u003e\u003cimg src=\"https://github.com/user-attachments/assets/70bfda35-7ab4-484e-9441-98b4bd5a7c40\" width=\"150\"\u003e\u003cbr\u003e[Mijia Smart Socket 2 China](https://github.com/sergey-brutsky/mi-home/wiki/Mijia-Smart-Socket-2-China-(ZNCZ07CM)) | ZNCZ07CM | chuangmi.plug.212a01 |\n\n## Supported zigbee/ble devices\n\n| Device support | Gateway 2 | Multimode Gateway | Multimode Gateway 2| Aqara Hub E1\n|:---: |:---: |:---: |:---: |:---: |\n| [Aqara Vibration Sensor](https://github.com/sergey-brutsky/mi-home/wiki/Aqara-Vibration-sensor-(DJT11LM))\u003cbr\u003e\u003cimg src=\"https://www.zigbee2mqtt.io/images/devices/DJT11LM.png\" width=\"150\"\u003e\u003cbr\u003eDJT11LM | yes | yes | yes | yes\n| [Xiaomi Door/Window Sensor](https://github.com/sergey-brutsky/mi-home/wiki/Xiaomi-Door-Window-sensor-(MCCGQ01LM))\u003cbr\u003e\u003cimg src=\"https://www.zigbee2mqtt.io/images/devices/MCCGQ01LM.png\" width=\"150\"\u003e\u003cbr\u003eMCCGQ01LM | yes | yes | yes | yes\n| [Xiaomi Door/Window Sensor 2](https://github.com/sergey-brutsky/mi-home/wiki/Xiaomi-Door-Window-sensor-2-(MCCGQ02HL))\u003cbr\u003e\u003cimg src=\"https://github.com/sergey-brutsky/mi-home/assets/5664637/4ac8671c-394d-4ef1-ba7a-be5f670ca103\" width=\"150\"\u003e\u003cbr\u003eMCCGQ02HL | no | yes | yes | no\n| [Aqara Door/Window Sensor](https://github.com/sergey-brutsky/mi-home/wiki/Aqara-Door-Window-sensor-(MCCGQ11LM))\u003cbr\u003e\u003cimg src=\"https://www.zigbee2mqtt.io/images/devices/MCCGQ11LM.png\" width=\"150\"\u003e\u003cbr\u003eMCCGQ11LM | yes | yes | yes | yes\n| [Xiaomi TH Sensor](https://github.com/sergey-brutsky/mi-home/wiki/Xiaomi-TH-sensor-(WSDCGQ01LM))\u003cbr\u003e\u003cimg src=\"https://www.zigbee2mqtt.io/images/devices/WSDCGQ01LM.png\" width=\"150\"\u003e\u003cbr\u003eWSDCGQ01LM | yes | yes | yes | yes\n| [Xiaomi TH Sensor 2](https://github.com/sergey-brutsky/mi-home/wiki/Xiaomi-TH-sensor-2-(LYWSD03MMC))\u003cbr\u003e\u003cimg src=\"https://www.zigbee2mqtt.io/images/devices/LYWSD03MMC.png\" width=\"150\"\u003e\u003cbr\u003eLYWSD03MMC | no | yes | yes | no\n| [Aqara TH Sensor](https://github.com/sergey-brutsky/mi-home/wiki/Aqara-TH-sensor-(WSDCGQ11LM))\u003cbr\u003e\u003cimg src=\"https://www.zigbee2mqtt.io/images/devices/WSDCGQ11LM.png\" width=\"150\"\u003e\u003cbr\u003eWSDCGQ11LM | yes | yes | yes | yes\n| [Aqara Water Leak Sensor](https://github.com/sergey-brutsky/mi-home/wiki/Aqara-Water-Leak-sensor-(SJCGQ11LM))\u003cbr\u003e\u003cimg src=\"https://www.zigbee2mqtt.io/images/devices/SJCGQ11LM.png\" width=\"150\"\u003e\u003cbr\u003eSJCGQ11LM | yes | yes | yes | yes\n| [Xiaomi Motion Sensor](https://github.com/sergey-brutsky/mi-home/wiki/Xiaomi-Motion-sensor-(RTCGQ01LM))\u003cbr\u003e\u003cimg src=\"https://www.zigbee2mqtt.io/images/devices/RTCGQ01LM.png\" width=\"150\"\u003e\u003cbr\u003eRTCGQ01LM | yes | yes | yes | yes\n| [Xiaomi Motion Sensor 2](https://github.com/sergey-brutsky/mi-home/wiki/Xiaomi-Motion-sensor-2-(RTCGQ02LM))\u003cbr\u003e\u003cimg src=\"https://www.zigbee2mqtt.io/images/devices/RTCGQ12LM.png\" width=\"150\"\u003e\u003cbr\u003eRTCGQ02LM | no | yes | yes | no\n| [Aqara Relay T1 EU (with N)](https://github.com/sergey-brutsky/mi-home/wiki/Aqara-Relay-T1-EU-(SSM%E2%80%90U01))\u003cbr\u003e\u003cimg src=\"https://www.zigbee2mqtt.io/images/devices/SSM-U01.png\" width=\"150\"\u003e\u003cbr\u003eSSM-U01 | no | yes | yes | yes\n| [Aqara Relay CN](https://github.com/sergey-brutsky/mi-home/wiki/Aqara-Relay-CN-(LLKZMK11LM))\u003cbr\u003e\u003cimg src=\"https://www.zigbee2mqtt.io/images/devices/LLKZMK11LM.png\" width=\"150\"\u003e\u003cbr\u003eLLKZMK11LM | no | yes | yes | yes\n| [Aqara Opple Switch (2 buttons)](https://github.com/sergey-brutsky/mi-home/wiki/Aqara-Opple-Switch-(2-buttons)-(WXCJKG11LM))\u003cbr\u003e\u003cimg src=\"https://www.zigbee2mqtt.io/images/devices/WXCJKG11LM.png\" width=\"150\"\u003e\u003cbr\u003eWXCJKG11LM | no | yes | yes | yes\n| [Aqara Opple Switch (4 buttons)](https://github.com/sergey-brutsky/mi-home/wiki/Aqara-Opple-Switch-(4-buttons)-(WXCJKG12LM))\u003cbr\u003e\u003cimg src=\"https://www.zigbee2mqtt.io/images/devices/WXCJKG12LM.png\" width=\"150\"\u003e\u003cbr\u003eWXCJKG12LM | no | yes | yes | yes\n| [Honeywell Smoke Sensor](https://github.com/sergey-brutsky/mi-home/wiki/Honeywell-Smoke-Sensor-(JTYJ%E2%80%90GD%E2%80%9001LM-BW))\u003cbr\u003e\u003cimg src=\"https://www.zigbee2mqtt.io/images/devices/JTYJ-GD-01LM-BW.png\" width=\"150\"\u003e\u003cbr\u003eJTYJ-GD-01LM/BW | yes | yes | yes | yes\n| [Honeywell Smoke Alarm](https://github.com/sergey-brutsky/mi-home/wiki/Honeywell-Smoke-Alarm-(JTYJ%E2%80%90GD%E2%80%9003MI))\u003cbr\u003e\u003cimg src=\"https://www.zigbee2mqtt.io/images/devices/JTYJ-GD-01LM-BW.png\" width=\"150\"\u003e\u003cbr\u003eJTYJ-GD-03MI | no | yes | yes | no\n| [Xiaomi Wireless Button](https://github.com/sergey-brutsky/mi-home/wiki/Xiaomi-Wireless-Button-(WXKG01LM))\u003cbr\u003e\u003cimg src=\"https://www.zigbee2mqtt.io/images/devices/WXKG01LM.png\" width=\"150\"\u003e\u003cbr\u003eWXKG01LM | yes | yes | yes | yes\n| [Xiaomi Plug CN](https://github.com/sergey-brutsky/mi-home/wiki/Xiaomi-Plug-CN-(ZNCZ02LM))\u003cbr\u003e\u003cimg src=\"https://www.zigbee2mqtt.io/images/devices/ZNCZ02LM.png\" width=\"150\"\u003e\u003cbr\u003eZNCZ02LM | yes | yes | yes | yes\n| [Aqara Double Wall Switch (no N)](https://github.com/sergey-brutsky/mi-home/wiki/Aqara-Double-Wall-Switch-(no-N)-(QBKG03LM))\u003cbr\u003e\u003cimg src=\"https://www.zigbee2mqtt.io/images/devices/QBKG03LM.png\" width=\"150\"\u003e\u003cbr\u003eQBKG03LM | yes | no | no | no\n| [Aqara Double Wall Button CN](https://github.com/sergey-brutsky/mi-home/wiki/Aqara-Double-Wall-Button-CN-(WXKG02LM))\u003cbr\u003e\u003cimg src=\"https://www.zigbee2mqtt.io/images/devices/WXKG02LM_rev2.png\" width=\"150\"\u003e\u003cbr\u003eWXKG02LM | yes | no | no | no\n| [Aqara Cube EU](https://github.com/sergey-brutsky/mi-home/wiki/Aqara-Cube-EU-(MFKZQ01LM))\u003cbr\u003e\u003cimg src=\"https://www.zigbee2mqtt.io/images/devices/MFKZQ01LM.png\" width=\"150\"\u003e\u003cbr\u003eMFKZQ01LM | yes | no | no | no\n\n## \u003ca name=\"installation\"\u003eInstallation\u003c/a\u003e\n\nvia nuget package manager\n\n```nuget\nInstall-Package MiHomeLib\n```\n\nor\n\n```nuget\ndotnet add package MiHomeLib\n```\n\nor install via [GitHub packages](https://github.com/sergey-brutsky/mi-home/pkgs/nuget/MiHomeLib)\n\n## \u003ca name=\"setup-gateway\"\u003eSetup Xiaomi Gateway 2\u003c/a\u003e\n\nBefore using this library you should setup **development mode** on your gateway, [instructions how to do this](https://www.domoticz.com/wiki/Xiaomi_Gateway_(Aqara)).\\\nThis mode allows to work with the gateway via UDP multicast protocol.\n\n**Warning 1**:\nIf you bought a newer revision of Xiaomi Gateway 2 (labels in a circle)\n\u003cimg src=\"https://user-images.githubusercontent.com/5664637/75097306-451c9300-55ba-11ea-90f9-f99b5ea883c1.png\" width=\"450\"\u003e\n\nIt could be possible that ports on your gateway required for UDP multicast traffic are **closed**.\\\nBefore using this library **ports must be opened**. [Check this instruction](https://community.openhab.org/t/solved-openhab2-xiaomi-mi-gateway-does-not-respond/52963/114).\n\n**Warning 2**: Mi Home Gateway uses udp multicast for messages handling, so your app **must** be hosted in the same LAN as your gateway.\nIf it is not you **have to** use multicast routers like [udproxy](https://github.com/pcherenkov/udpxy) or [igmpproxy](https://github.com/pali/igmpproxy) or [vpn bridging](https://forums.openvpn.net/viewtopic.php?t=21509).\n\n**Warning 3**: If your app is running on windows machine, make sure that you disabled virtual network adapters like VirtualBox, Hyper-V, Npcap, pcap etc.\nBecause these adapters may prevent proper work of multicast traffic between your machine and gateway\n\n## \u003ca name=\"setup-gateway\"\u003eSetup Xiaomi Multimode Gateway (same for Multimode Gateway 2)\u003c/a\u003e\n\nBefore using this library:\n\n1. Open telnet on your gateway\n2. Expose MQTT broker to the world\n3. Extract token to work with your gateway\n\nThe easisest way is to setup/configure [this HA integration](https://github.com/AlexxIT/XiaomiGateway3/) (it does all aforementioned things automatically).\n\nThe way of warrior:\n\n1. [Enable telnet on your gateway](https://gist.github.com/zvldz/1bd6b21539f84339c218f9427e022709)\n2. Download this [openmiio_agent](http://github.com/AlexxIT/openmiio_agent/releases/download/v1.2.1/openmiio_agent_mips) and upload it to your gateway (for example to /data/openmiio_agent) via telnet\n3. Login to your gateway via telnet `telnet \u003cgateway ip\u003e 23` (login: admin or root, pwd: empty)\n4. Kill embedded mosquitto mqtt broker and run openmiio_agent (it will expose mqtt port 1883 to the world) `kill -9 \u003cpid of mosquitto\u003e \u0026\u0026 /data/openmiio_agent mqtt \u0026`\n5. Check that mosquitto is binded to `0.0.0.0 1883` `netstat -ntlp | grep mosquitto`\n6. [Extract token instructions](https://github.com/jghaanstra/com.xiaomi-miio/blob/master/docs/obtain_token.md)\n\n## \u003ca name=\"setup-gateway\"\u003eSetup Aqara Hub E1 Gateway\u003c/a\u003e\n\nBefore using this library you need:\n\n1. [Open telnet on your gateway](https://gist.github.com/zvldz/1bd6b21539f84339c218f9427e022709#aqara-hub-e1-zhwg16lm-usb-stick)\n2. [Find out device id (did) of the gateway](https://github.com/sergey-brutsky/mi-home/wiki/Aqara-Hub-E1-China)\n3. [Find ip and token of the gateway](https://blog.matterxiaomi.com/blog/how-get-mi-home-devices-token/)\n\nMore details in the [project's WIKI](https://github.com/sergey-brutsky/mi-home/wiki/Aqara-Hub-E1-China)\n\n## \u003ca name=\"basic-scenario\"\u003eBasic scenarios\u003c/a\u003e\n\nGet all devices in the network from the **Xiaomi Gateway 2**\n\n```csharp\npublic static void Main(string[] args)\n{\n    // gateway sid is optional, use only when you have 2 or more gateways in your LAN\n    // using var gw2 = new XiaomiGateway2(\"ip\", \"token\", \"gateway sid\");\n    using var gw2 = new XiaomiGateway2(\"\u003cgateway ip\u003e\", \"\u003cgateway token\u003e\");\n    {\n        gw2.OnDeviceDiscoveredAsync += d =\u003e\n        {\n            Console.WriteLine(d.ToString());\n            return Task.CompletedTask;\n        };\n\n        gw2.DiscoverDevices();\n    }\n}\n```\n\nGet all devices in the network from the **Xiaomi Multimode Gateway**\n\n```csharp\npublic static void Main(string[] args)\n{\n    using var multimodeGw = new MultimodeGateway(\"\u003cgateway ip\u003e\", \"\u003cgateway token\u003e\", \"\u003cdid\u003e\");\n    {\n        multimodeGw.OnDeviceDiscoveredAsync += d =\u003e\n        {\n            Console.WriteLine(d.ToString());\n            return Task.CompletedTask;\n        };\n\n        multimodeGw.DiscoverDevices();\n    }\n}\n```\n\nGet all devices in the network from the **Xiaomi Multimode Gateway 2 Global**\n\n```csharp\npublic static void Main(string[] args)\n{\n    using var multimodeGw2 = new MultimodeGateway2Global(\"\u003cgateway ip\u003e\", \"\u003cgateway token\u003e\", \"\u003cdid\u003e\");\n    {\n        multimodeGw2.OnDeviceDiscoveredAsync += d =\u003e\n        {\n            Console.WriteLine(d.ToString());\n            return Task.CompletedTask;\n        };\n\n        multimodeGw2.DiscoverDevices();\n    }\n}\n```\n\nGet all devices in the network from the **Xiaomi Multimode Gateway 2 China**\n\n```csharp\npublic static void Main(string[] args)\n{\n    using var multimodeGw2 = new MultimodeGateway2China(\"\u003cgateway ip\u003e\", \"\u003cgateway token\u003e\", \"\u003cdid\u003e\");\n    {\n        multimodeGw2.OnDeviceDiscoveredAsync += d =\u003e\n        {\n            Console.WriteLine(d.ToString());\n            return Task.CompletedTask;\n        };\n\n        multimodeGw2.DiscoverDevices();\n    }\n}\n```\n\nGet all devices in the network from the **Aqara Hub E1 Gateway**\n\n```csharp\npublic static void Main()\n{       \n    using var gw = new AqaraHubE1China(\"ip\", \"token\", \"did\");\n    {\n        gw.OnDeviceDiscoveredAsync += d =\u003e\n        {\n            Console.WriteLine(d.ToString());\n            return Task.CompletedTask;\n        };\n\n        gw.DiscoverDevices();\n    }\n    Console.ReadLine();\n}\n```\n\n## \u003ca name=\"documentation\"\u003eDocumentation\u003c/a\u003e\n\nCheck detailed documentation on how to work with different devices in the [project's WIKI](https://github.com/sergey-brutsky/mi-home/wiki)\n\n## \u003ca name=\"contribution\"\u003eContribution\u003c/a\u003e\n\nYour pull requests are welcome to replenish the database of supported devices\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsergey-brutsky%2Fmi-home","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsergey-brutsky%2Fmi-home","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsergey-brutsky%2Fmi-home/lists"}