Note: I have only a part of these devices, so some devices don't have tested. If you find bugs, please submit them to issues or QQ Group: 107927710. 注意: 我只有一部分设备, 所以一些设备没有得到充分的测试。 如果你发现Bug,请提交到 issues 或 QQ群: 107927710。
Note: According to aqara local network protocol use UDP port 9898, please notice the relevant configuration of firewall. 注意: 绿米的局域网协议使用的是UDP的9898端口,请配置好防火墙的相关配置。
Note: About AcPartner, This project only provides gateway functionality. If you want the use air conditioning function, please refer to the project for homebridge-mi-acPartner. 注意: 有关空调伴侣,这个项目只提供网关的功能,如果你需要使用空调的功能,请参考项目homebridge-mi-acPartner。
Supported Devices(支持的设备)
Device Name 设备名称
Protocol Model Value 协议Model值
1
Gateway(网关)
gateway gateway.v3
2
ContactSensor(门磁感应)
magnet sensor_magnet
3
MotionSensor(人体感应)
motion
4
Button(按钮)
switch sensor_switch
5
TemperatureAndHumiditySensor(温度湿度传感器)
sensor_ht
6
SingleSwitch(单按钮墙壁开关)
ctrl_neutral1
7
DuplexSwitch(双按钮墙壁开关)
ctrl_neutral2
8
SingleSwitchLN(单按钮墙壁开关零火版)
ctrl_ln1 ctrl_ln1.aq1
9
DuplexSwitchLN(双按钮墙壁开关零火版)
ctrl_ln2 ctrl_ln2.aq1
10
SingleButton86(86型无线单按钮开关)
86sw1 sensor_86sw1.aq1 sensor_86sw1
11
DuplexButton86(86型无线双按钮开关)
86sw2 sensor_86sw2.aq1 sensor_86sw2
12
PlugBase(插座)
plug
13
PlugBase86(86型墙壁插座)
86plug ctrl_86plug ctrl_86plug.aq1
14
MagicSquare(魔方)
cube sensor_cube sensor_cube.aqgl01
15
SmokeDetector(烟雾报警器)
smoke sensor_smoke
16
NatgasDetector(天然气报警器)
natgas sensor_natgas
17
ElectricCurtain(电动窗帘)
curtain
18
ContactSensor2(门磁感应第二代)
sensor_magnet.aq2
19
MotionSensor2(人体感应第二代)
sensor_motion.aq2
20
Button2(按钮第二代)
sensor_switch.aq2 remote.b1acn01
21
TemperatureAndHumiditySensor2(温度湿度传感器第二代)
weather.v1 weather
22
WaterDetector(水浸传感器)
sensor_wleak.aq1
23
Lock(门锁)
lock.aq1
24
AcPartner(空调伴侣升级版)
acpartner.v3
25
Button3(按钮第二代升级版)
sensor_switch.aq3
26
DuplexButton862(86型无线双按钮开关升级版)
remote.b286acn01
27
VibrationSensor(动静贴)
vibration
28
ElectricCurtainBattery(电动窗帘锂电池版)
curtain.hagl04
Pre-Requirements(前置要求)
Make sure your IOS version is IOS11 or later.
确保你的IOS设备版本高于IOS11。
Make sure you have gateway v2 or acpartner v3. gateway v1 has limited space so can't support this feature.
确保你的小米网关是二代版本/空调伴侣是三代。小米网关一代不支持此插件。
Update gateway firmware to 1.4.1_155.0143(gateway v2), 1.4.1_148.019(acpartner v3) or later.
确保你的网关的固件版本高于1.4.1_155.0143(小米网关二代), 1.4.1_148.019(空调伴侣三代)。
Press the top right (…) Settings button
点击右上角的(…)按钮
Select About
选择关于
Tap five times in the blank area to reveal the hidden menu items
在空白区域中点击五次以显示隐藏菜单项
Below the version numbers, choose the first: LAN Communication Protocol
在版本号下面,选择第一个:局域网通信协议
Toggle the LAN Communication Protocol switch to on
将“LAN通信协议”开关切换到开
Take note of the alphanumeric code beside Password
记下密码旁边的字母数字代码
Press OK
点击OK
Go back to the previous menu (About) and select the next option: Gateway Information
返回上一个菜单(关于)并选择下一个选项:网关信息
Take note of the MAC address at mac=
记下mac=上的MAC地址
To control the devices, put gateway's MAC address (lower case without colon) and password (keep original and case sensitive) to ~/.homebridge/config.json.
将网关的mac地址(小写字母 去掉冒号)和密码(保持原始 区分大小写)写入到配置文件 ~/.homebridge/config.json。
Warning: gateway's MAC address (lower case without colon) and password (keep original and case sensitive).
警告: 网关的MAC地址 (全部小写 去掉冒号) 密码 (保持原始 区分大小写) 。
Warning: gateway's MAC address (lower case without colon) and password (keep original and case sensitive).
警告: 网关的MAC地址 (全部小写 去掉冒号) 密码 (保持原始 区分大小写) 。
Warning: gateway's MAC address (lower case without colon) and password (keep original and case sensitive).
警告: 网关的MAC地址 (全部小写 去掉冒号) 密码 (保持原始 区分大小写) 。
Important things are to be repeated for 3 times.
重要的事情说三遍。
Here is a way to search for gateways instead of multicast, because of some friends do not respond to information from gateway in their network environment.
有一些朋友的网络环境有一些问题,无法正常使用组播,这里提供一种配置方式来替代通过组播的方式寻找网关。
That is to say, we can config the IP address of the gateway to replace search gateway by multicast.
也就是说,可以通过配置网关的IP来替换通过组播的方式寻找网关。
It can also be mixed config, but without full configuration of ip, multicast packets will still be sent to search for other gateways which do not config ip.
也可以混合配置,不过只要有一个网关没有配置IP,程序就会发送组播信息来寻找未配置IP的网关。若所有网关全部配置了IP,则程序不发送组播包寻找网关。
If your device(which running homebridge) has multiple network, please add the bindAddress configuration item to decide to listen which network, like below:
如果你运行HomeBridge的设备有多块网卡并且在多个网络中,可以通过这个配置来指定使用哪一个网络,配置如下:
If this configuration item is not to configure, it will be send whois command every hour by default.
如果该配置项不填写,默认情况下,每小时发送一次。
If your network has some problems and you can't receive the heartbeat packet, you can use send whois command to replace the heartbeat function. If you use it in this way, you can set the value of the configuration item to 5 seconds, that is 5000. example:
如果你的网络有一些问题,无法收到心跳包,那么你可以使用发送a来替代心跳功能,如果这样使用,可以将配置项的值设为5秒,即5000,例子如下:
If you want the plugin to help you automatically delete devices that have not received heartbeat for a long time, you can configure this item. The value is how often to detect. If you don't need to automatically delete accessories, you can not configure this configuration.
如果你希望插件帮你自动删除长时间收不到心跳的设备,则可以配置此项目,该值为多久检测一次。如果不需要自动删除配件功能,可以不配置此配置。 note: long time is defined as: no heartbeat received in more than 7 days. 注:长时间的定义为:超过7天未收到心跳。
If you want to specify the default value, such as specify the name of the accessory, hide the accessory, any other configs. You can add a defaultValue mapping table to your config.json.
如果你想要指定默认值,比如配件的名字,是否隐藏配件以及其他一些配置,你可以在你的配置文件config.json中增加defaultValue配置项。
The config supported are as follows:
这个配置支持如下功能:
set accessory type for Switch or Lightbulb. 设置配件类型是开关或者灯。 Currently only supported: SingleSwitch, DuplexSwitch, SingleSwitchLN, DuplexSwitchLN. 当前只支持如下设备:单火线单键墙壁开关,单火线双键墙壁开关,零火单键墙壁开关,零火双键墙壁开关。
About Global:
有关全局配置方式:
Some similar configurations and repeated multiple copies are boring things. So I provided a global writing method.
一些类似的配置和重复的多次拷贝是件比较烦的事情,所以我提供了一个全局的功能:
The following two methods of writing are equivalent:
下面两段配置的效果是等同的:
请发表评论