Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

支持 VRF 空调内机本地控制 #2043

Closed
hjkcai opened this issue Dec 8, 2024 · 8 comments
Closed

支持 VRF 空调内机本地控制 #2043

hjkcai opened this issue Dec 8, 2024 · 8 comments
Labels

Comments

@hjkcai
Copy link

hjkcai commented Dec 8, 2024

#1237,我成功通过 python-miio 控制了 VRF 空调子设备

首先通过 miiocli cloud 查询到设备信息

== VRF Central Air-Con Gateway (Device online ) ==
        Model: 090615.gateway.ac10
        Token: 813c493c6fad11af255ef64ce55c56e2
        IP: 192.168.50.104 (mac: 84:46:93:E8:97:7E)
        DID: 827601753
        Locale: cn
        Sub devices:
                客厅空调
                        DID: proxy.827601753.00001
                        Model: 090615.aircondition.ktp
                客卧空调
                        DID: proxy.827601753.00002
                        Model: 090615.aircondition.ktp
                主卧空调
                        DID: proxy.827601753.00003
                        Model: 090615.aircondition.ktp
                书房空调
                        DID: proxy.827601753.00004
                        Model: 090615.aircondition.ktp
        Other fields:
                extra: {'isSetPincode': 0, 'pincodeType': 0, 'fw_version': '2.2.6_1008', 'needVerifyCode': 0, 'isPasswordEncrypt': 0}
                password:
                pid: 0
                permitLevel: 16
                reset_flag: 0
                adminFlag: 1
                show_mode: 1
                family_id: 0
                p2p_id:
                pd_id: 16704
                shareFlag: 0
                latitude: 0.0
                longitude: 0.0
                uid: ----------

然后运行 raw_command,将虚拟设备的 did 以字符串的形式传入:

miiocli -dd genericmiot \
  --ip 192.168.50.104 \
  --token 813c493c6fad11af255ef64ce55c56e2 \
  raw_command \
  action \
  '{"did":"proxy.827601753.00001","siid":2,"aiid":1,"in":[]}' #	air-conditioner:toggle

miiocli -dd genericmiot \
  --ip 192.168.50.104 \
  --token 813c493c6fad11af255ef64ce55c56e2 \
  raw_command \
  set_properties \
  '[{"did":"proxy.827601753.00001","siid":2,"piid":4,"value":16}]' # air-conditioner:target-temperature

上面的命令均成功执行,观察米家 App 成功切换了设备状态。说明通过直接指定 did 的方式就可以控制 VRF 空调子设备。

希望可以将该通信模式集成到 hass-xiaomi-miot 中,谢谢!

@al-one
Copy link
Owner

al-one commented Dec 10, 2024

请在.storage/xiaomi_miot/devices-xxxx-cn.json 文件中找到该设备极其子设备,并反馈他们的结构。

@hjkcai

This comment was marked as off-topic.

@al-one
Copy link
Owner

al-one commented Dec 12, 2024

.storage/xiaomi_miot/devices-xxxx-cn.json文件中..

@hjkcai
Copy link
Author

hjkcai commented Dec 12, 2024

抱歉弄错了…这个文件东西比较多,我摘出关键部分

{
  "version": 1,
  "minor_version": 1,
  "key": "xiaomi_miot/devices-10265442-cn.json",
  "data": {
    "update_time": 1733905713.4781916,
    "devices": [
      {
        "did": "827601753",
        "token": "813c493c6fad11af255ef64ce55c56e2",
        "longitude": "0.00000000",
        "latitude": "0.00000000",
        "name": "VRF Central Air-Con Gateway",
        "pid": 0,
        "localip": "192.168.50.104",
        "mac": "84:46:93:E8:97:7E",
        "ssid": "hjkcai",
        "bssid": "5C:E8:D3:01:6A:5F",
        "parent_id": "",
        "parent_model": "",
        "show_mode": 1,
        "model": "090615.gateway.ac10",
        "adminFlag": 1,
        "shareFlag": 0,
        "permitLevel": 16,
        "isOnline": true,
        "desc": "Device online ",
        "extra": {
          "isSetPincode": 0,
          "pincodeType": 0,
          "fw_version": "2.2.6_1008",
          "isSubGroup": false,
          "showGroupMember": false,
          "split": {}
        },
        "uid": 10265442,
        "pd_id": 16704,
        "password": "",
        "p2p_id": "",
        "rssi": -46,
        "family_id": 0,
        "reset_flag": 0,
        "spec_type": "urn:miot-spec-v2:device:gateway:0000A019:090615-ac10:1",
        "orderTime": 1731564312,
        "freqFlag": false,
        "hide_mode": 0,
        "cnt": 8,
        "comFlag": 128,
        "carPicInfo": "",
        "home_id": "992001759932",
        "room_id": "992001759933",
        "home_name": "未来之光",
        "room_name": "客厅"
      },
      {
        "did": "proxy.827601753.00001",
        "token": "",
        "longitude": "0.00000000",
        "latitude": "0.00000000",
        "name": "客厅空调",
        "pid": 18,
        "localip": "",
        "mac": "",
        "ssid": "hjkcai",
        "bssid": "5C:E8:D3:01:6A:5F",
        "parent_id": "827601753",
        "parent_model": "090615.gateway.ac10",
        "show_mode": 1,
        "model": "090615.aircondition.ktp",
        "adminFlag": 1,
        "shareFlag": 0,
        "permitLevel": 16,
        "isOnline": true,
        "desc": "Device online ",
        "extra": {
          "isSetPincode": 0,
          "pincodeType": 0,
          "fw_version": "2.2.6_1008",
          "isSubGroup": false,
          "showGroupMember": false,
          "split": {}
        },
        "uid": 10265442,
        "pd_id": 16410,
        "password": "",
        "p2p_id": "",
        "rssi": 0,
        "family_id": 0,
        "reset_flag": 0,
        "spec_type": "urn:miot-spec-v2:device:air-conditioner:0000A004:090615-ktp:1",
        "orderTime": 1731564547,
        "freqFlag": true,
        "hide_mode": 0,
        "cnt": 18,
        "comFlag": 129,
        "carPicInfo": "",
        "home_id": "992001759932",
        "room_id": "992001759933",
        "home_name": "未来之光",
        "room_name": "客厅"
      }
    ]
  }
}

@al-one
Copy link
Owner

al-one commented Dec 12, 2024

请将这几个设备共享给143050915,如果虚拟子设备不支持共享,只共享网关即可

@hjkcai
Copy link
Author

hjkcai commented Dec 14, 2024

已共享

@al-one
Copy link
Owner

al-one commented Dec 28, 2024

尝试master分支。需要通过账号集成,并且在自动或本地模式下,同时包含网关及子设备。

wget -O - https://get.hacs.vip | DOMAIN=xiaomi_miot ARCHIVE_TAG=master bash -

@hjkcai
Copy link
Author

hjkcai commented Dec 28, 2024

image

👍感谢,已经成功通过本地控制

@hjkcai hjkcai closed this as completed Dec 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants