欢迎光临
我们一直在努力

树莓派通过Homebridge链接HomeKit+Siri声控家里小米空气净化器(二)


支持的设备
1.
小型空气净化器2.
小型空气净化器2 3.小型空气净化器
2.MiAirPurifier2S(小米空气净化器2S)2.
小型空气净化器MAX – – 快来了

前要求
1.确保您的IOS版本是ios11或更高版本。

安装:
安装所需的包。
sudo npm install -g homebridge-mi-airpurifier
sudo npm install -g miio
确保您的Homebridge服务器与您的空气净化器具有相同的网络,然后运行以下命令来发现令牌。
miio discover
您可能需要等待几秒钟,直到您得到类似于以下的响应:

Device ID: 49466088
Model info: Unknown
Address: 192.168.1.8
Token: 6f7a65786550386c700a6b526666744d via auto-token
Support: Unknown

随后在我们的配置文件中记录下我们需要的值Address和Token值。

如果您正在获取??????????????令牌值,请重置您的设备,并将您的Homebridge服务器直接连接到设备所宣传的接入点。
然后再次运行该命令。

将以下内容中选取和自己对应型号的添加到config.json

    "platform": "MiAirPurifierPlatform",
    "deviceCfgs": [
    {
        "type": "MiAirPurifier",
        "ip": "192.168.88.xx",
        "token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
        "airPurifierDisable": false,
        "airPurifierName": "MiAirPurifier",
        "silentModeSwitchDisable": false,
        "silentModeSwitchName": "MiAirPurifier Silent Mode Switch",
        "buzzerSwitchDisable": true,
        "buzzerSwitchName": "MiAirPurifier Buzzer Switch",
        "ledBulbDisable": true,
        "ledBulbName": "MiAirPurifier LED Switch",
        "airQualityDisable": false,
        "airQualityName": "MiAirPurifier AirQuality"
    }, 
    {
        "type": "MiAirPurifier2",
        "ip": "192.168.88.xx",
        "token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
        "airPurifierDisable": false,
        "airPurifierName": "MiAirPurifier2",
        "silentModeSwitchDisable": false,
        "silentModeSwitchName": "MiAirPurifier2 Silent Mode Switch",
        "temperatureDisable": false,
        "temperatureName": "MiAirPurifier2 Temperature",
        "humidityDisable": false,
        "humidityName": "MiAirPurifier2 Humidity",
        "buzzerSwitchDisable": true,
        "buzzerSwitchName": "MiAirPurifier2 Buzzer Switch",
        "ledBulbDisable": true,
        "ledBulbName": "MiAirPurifier2 LED Switch",
        "airQualityDisable": false,
        "airQualityName": "MiAirPurifier2 AirQuality"
    }, 
    {
        "type": "MiAirPurifierPro",
        "ip": "192.168.88.xx",
        "token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
        "airPurifierDisable": false,
        "airPurifierName": "MiAirPurifierPro",
        "silentModeSwitchDisable": false,
        "silentModeSwitchName": "MiAirPurifierPro Silent Mode Switch",
        "temperatureDisable": false,
        "temperatureName": "MiAirPurifierPro Temperature",
        "humidityDisable": false,
        "humidityName": "MiAirPurifierPro Humidity",
        "buzzerSwitchDisable": true,
        "buzzerSwitchName": "MiAirPurifierPro Buzzer Switch",
        "ledBulbDisable": true,
        "ledBulbName": "MiAirPurifierPro LED Switch",
        "airQualityDisable": false,
        "airQualityName": "MiAirPurifierPro AirQuality"
    }, 
    {
        "type": "MiAirPurifier2S",
        "ip": "192.168.88.xx",
        "token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
        "airPurifierDisable": false,
        "airPurifierName": "MiAirPurifier2S",
        "silentModeSwitchDisable": false,
        "silentModeSwitchName": "MiAirPurifier2S Silent Mode Switch",
        "temperatureDisable": false,
        "temperatureName": "MiAirPurifier2S Temperature",
        "humidityDisable": false,
        "humidityName": "MiAirPurifier2S Humidity",
        "buzzerSwitchDisable": true,
        "buzzerSwitchName": "MiAirPurifier2S Buzzer Switch",
        "ledBulbDisable": true,
        "ledBulbName": "MiAirPurifier2S LED Switch",
        "airQualityDisable": false,
        "airQualityName": "MiAirPurifier2S AirQuality"
    }]

其中选一个对应自己的,添加到配置文件网关类下,例如我的是米2

"platforms": [{
        "platform": "MiAqaraPlatform",
        "gateways": {
            "34ce008aa0b6":"6w7axi57n129i5hu",
            "7811dce1a6be":"v8owmic5is047enq"
            }
    },
    {
        "platform": "MiAirPurifierPlatform",
        "deviceCfgs": [{
            "type": "MiAirPurifier2",
            "ip": "192.168.31.xx",
            "token": "xxxxxxxxxxxxxxxxxxxxxx",
            "airPurifierDisable": false,
            "airPurifierName": "MiAirPurifier2",
            "silentModeSwitchDisable": false,
            "silentModeSwitchName": "MiAirPurifier2 Silent Mode Switch",
            "temperatureDisable": false,
            "temperatureName": "MiAirPurifier2 Temperature",
            "humidityDisable": false,
            "humidityName": "MiAirPurifier2 Humidity",
            "buzzerSwitchDisable": true,
            "buzzerSwitchName": "MiAirPurifier2 Buzzer Switch",
            "ledBulbDisable": true,
            "ledBulbName": "MiAirPurifier2 LED Switch",
            "airQualityDisable": false,
            "airQualityName": "MiAirPurifier2 AirQuality"
        }]
    }]

重新启动Homebridge,你的Mi空气净化器将被添加到Home应用程序中。

赞(0) 打赏
未经允许不得转载:DarkMoon's Home » 树莓派通过Homebridge链接HomeKit+Siri声控家里小米空气净化器(二)

吐槽 抢沙发

评论前必须登录!

 

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏

'); })();