Skip to content

XiaoMi GateWay/Aqara/Lumi/Mijia/小米网关/绿米/米家 SDK For Golang

Notifications You must be signed in to change notification settings

pkgplus/migateway

Repository files navigation

migateway

API DOC

小米网关协议文档参考

原版

修正格式版

绿米网关局域网通讯API V1.0.7

FEATURES

  • 支持网关自动发现(whois)
  • 支持设备自动发现(get_id_list,read)
  • 支持设备状态自动更新(report/heartbeat)
  • 支持网关彩灯控制,并支持颜色、闪烁等控制(write)
  • 支持智能插座的控制
  • 服务运行树莓派3上树莓派安装文档

Homekit

Document

migateway for homekit

Screenshot

手机

EXAMPLE

package main

import (
    "github.com/bingbaba/tool/color"
    "github.com/bingbaba/util/logs"
    "github.com/xuebing1110/migateway"
    "time"
)

var (
    LOGGER = logs.GetBlogger()
)

func init() {
    logs.SetDebug(true)
}

func main() {
    manager, err := migateway.NewAqaraManager(nil)
    if err != nil {
        panic(err)
    }
    manager.SetAESKey("t7ew6r4y612eml0f")

    gateway := manager.GateWay
    for _, color := range color.COLOR_ALL {
        err = gateway.ChangeColor(color)
        if err != nil {
            panic(err)
        }
        time.Sleep(time.Second)
    }

    err = gateway.Flashing(color.COLOR_RED)
    if err != nil {
        panic(err)
    }

    //do something...
    time.Sleep(10 * time.Second)
}

TODO LIST

  • 支持无线开关的控制
  • 支持86开关的控制
  • 支持场景自动化联动

Updating...

About

XiaoMi GateWay/Aqara/Lumi/Mijia/小米网关/绿米/米家 SDK For Golang

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages