Skip to content

Aqara Hub E1 China

Sergey edited this page Oct 10, 2025 · 3 revisions

Before working with this gateway you need to open telnet port, please follow these instructions.
Worked for me on firmwares 4.0.1_0001 and 4.0.1_0006.

To be able to utilise gateway features like led control/accidental deletion control/wifi repeater you need to find out "did" (device id).
Check code bellow as an example

var did = MiotGenericDevice.GetDeviceIdByIp("<device ip here>");

Get devices attached to the gateway

public static void Main()
{
    using var gw = new AqaraHubE1China("ip", "token", "did");
    {
        gw.OnDeviceDiscoveredAsync += d =>
        {
            Console.WriteLine($"Detected device {d}");
            return Task.CompletedTask;
        };

        gw.DiscoverDevices();
    }

    Console.ReadLine();
}

MioT functions

// Get device uptime
Console.WriteLine(gw.UptimeSeconds);

// Get device miio protocol version
Console.WriteLine(gw.MiioVersion);

// Get device miio protocol version
Console.WriteLine(gw.FirmwareVersion);

// Get device hardware version
Console.WriteLine(gw.Hardware);

// Get accidental deletion lock state
Console.WriteLine(gw.AccidentalDeletionEnabled);

// Set accidental deletion lock state
gw.AccidentalDeletionEnabled = true;

// Get night mode state (led will be turned off during 'night mode' hours)
Console.WriteLine(gw.NightModeEnabled);

// Set night mode state    
gw.NightModeEnabled = true;

// Get night mode effective hours
Console.WriteLine(gw.NigtModeEffectiveHours);

// Set night mode effective hours from 22:05 till 08:10
gw.NigtModeEffectiveHours = (22, 5, 8, 10);

// Get wifi hotspot mode state
Console.WriteLine(gw.HotspotModeEnabled);

// Set wifi hotspot mode state 
gw.HotspotModeEnabled = true;

// Get wifi hotspot name
Console.WriteLine(gw.HotspotName);

// Set wifi hotspot name
gw.HotspotName = "Aqara_Hub_D657";

// Get wifi hotspot password
Console.WriteLine(gw.HotspotPassword);

// Set wifi hotspot password
gw.HotspotPassword = "password";

// Get wifi clients connected to hotspot in format (ip, mac, name)
Console.WriteLine(gw.HotspotClients);

Clone this wiki locally