Closed liantianji closed 6 years ago
想问一下空调伴侣是否已经配置好了。然后稍微等待初始化后的第一次同步结束,再调整温度或者模式,看看还有没有这个问题。
早上已经重置了空调伴侣,依然无法使用,改用自定义模式,用红外线学习的代码测试了红外线开机和关机,空调无任何响应。 BTW:新年快乐
那麻烦发一下homebridge加-D参数的日志,使用预设的 新年快乐
------配置-------- { "platform": "XiaoMiAcPartner", "ip": "192.168.124.4", "token": "22d103c9bcc48b02661421a835127b19", "syncInterval":"10000",
"accessories":[
{
"name": "learn",
"type": "learnIR"
},
{
"name": "Ac Partner",
"type": "climate"
}
]
},
-------日志-------- [2018-2-16 10:08:25] Camera-gate is running on port 35445. add to multicast group listen on 0.0.0.0 no did or loc found! [2018-2-16 10:08:25] [homebridge-yeelight.yeelight] cached accessory: 0x0000000004a3e975 already in device list! [2018-2-16 10:08:25] [MiAqaraPlatform] [DEBUG][Revc]{"cmd":"iam","port":"9898","sid":"7811dcb396ec","model":"gateway","ip":"192.168.124.14"} [2018-2-16 10:08:25] [MiAqaraPlatform] [DEBUG][Send]{"cmd":"get_id_list"} connect ok! [2018-2-16 10:08:25] [homebridge-yeelight.yeelight] accesseory reachable [2018-2-16 10:08:25] [homebridge-yeelight.yeelight] dev connected 0x0000000004a3e975 true [2018-2-16 10:08:25] [MiAqaraPlatform] [DEBUG][Revc]{"cmd":"get_id_list_ack","sid":"7811dcb396ec","token":"BRytxjYrItvJEmNU","data":"[\"158d0001b78d10\",\"158d0001a8ea38\",\"158d0001bf3c77\",\"158d00012dd86b\",\"158d0001c2acc9\",\"158d00014c9c67\"]"} [2018-2-16 10:08:25] [MiAqaraPlatform] [DEBUG][Send]{"cmd":"read", "sid":"7811dcb396ec"} [2018-2-16 10:08:25] [MiAqaraPlatform] [DEBUG][Send]{"cmd":"read", "sid":"158d0001b78d10"} [2018-2-16 10:08:25] [MiAqaraPlatform] [DEBUG][Revc]{"cmd":"read_ack","model":"gateway","sid":"7811dcb396ec","short_id":0,"data":"{\"rgb\":0,\"illumination\":885,\"proto_version\":\"1.0.9\"}"} [2018-2-16 10:08:25] [MiAqaraPlatform] [DEBUG][Send]{"cmd":"read", "sid":"158d0001a8ea38"} [2018-2-16 10:08:25] [MiAqaraPlatform] [DEBUG][Send]{"cmd":"read", "sid":"158d0001bf3c77"} [2018-2-16 10:08:26] [MiAqaraPlatform] [DEBUG][Send]{"cmd":"read", "sid":"158d00012dd86b"} [2018-2-16 10:08:26] [MiAqaraPlatform] [DEBUG][Send]{"cmd":"read", "sid":"158d0001c2acc9"} [2018-2-16 10:08:26] [MiAqaraPlatform] [DEBUG][Revc]{"cmd":"read_ack","model":"plug","sid":"158d0001b78d10","short_id":35687,"data":"{\"voltage\":3600,\"status\":\"on\",\"inuse\":\"1\",\"power_consumed\":\"249\",\"load_power\":\"7.09\"}"} [2018-2-16 10:08:26] [MiAqaraPlatform] [DEBUG][Revc]{"cmd":"read_ack","model":"motion","sid":"158d0001a8ea38","short_id":34221,"data":"{\"voltage\":3045}"} [2018-2-16 10:08:26] [MiAqaraPlatform] [DEBUG][Revc]{"cmd":"read_ack","model":"magnet","sid":"158d0001bf3c77","short_id":51381,"data":"{\"voltage\":3035,\"status\":\"close\"}"} [2018-2-16 10:08:26] [MiAqaraPlatform] [DEBUG][Revc]{"cmd":"read_ack","model":"switch","sid":"158d00012dd86b","short_id":53301,"data":"{\"voltage\":3082}"} [2018-2-16 10:08:26] [MiAqaraPlatform] [DEBUG][Send]{"cmd":"read", "sid":"158d00014c9c67"} [2018-2-16 10:08:26] [MiAqaraPlatform] [DEBUG]read gateway device list finished. size: 6 [2018-2-16 10:08:26] [XiaoMiAcPartner] [GLOBAL]Connected! [2018-2-16 10:08:26] [XiaoMiAcPartner] [learn]Global device connected [2018-2-16 10:08:26] [XiaoMiAcPartner] [Ac Partner]Global device connected (node:1584) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): ReferenceError: syncInterval is not defined (node:1584) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. [2018-2-16 10:08:26] [MiAqaraPlatform] [DEBUG][Revc]{"cmd":"read_ack","model":"sensor_ht","sid":"158d0001c2acc9","short_id":53281,"data":"{\"voltage\":2965,\"temperature\":\"1737\",\"humidity\":\"7544\"}"} [2018-2-16 10:08:26] [MiAqaraPlatform] [DEBUG][Revc]{"cmd":"read_ack","model":"ctrl_neutral1","sid":"158d00014c9c67","short_id":25636,"data":"{\"voltage\":3300,\"channel_0\":\"on\"}"} [2018-2-16 10:08:27] [opple] Initializing platform accessory 'Bedroom Light'... Setup Payload: X-HM://0024KMGFEM377 Scan this code with your HomeKit app on your iOS device to pair with Homebridge:
[2018-2-16 10:13:36] [XiaoMiAcPartner] [CLIMATE]Set CurrentTemperature 0 [2018-2-16 10:14:48] [XiaoMiAcPartner] [DEBUG]Set TargetTemperature: 20 [2018-2-16 10:14:48] [XiaoMiAcPartner] [CLIMATE_Ac Partner]Syncing... /usr/lib/node_modules/homebridge-mi-acpartner/packages/presetHandle.js:16
一执行操作就中断homebridge了
Nodejs版本是8.x么?可能需要降级Nodejs版本到6.x 然后试着等到[CLIMATE]Sync complete这个日志出现后再调整温度和模式
找到2种Bug presetHandle.js 要加入 const presets = require("../presets.json"); climate.js 要改成 if (this.syncInterval > 0) {
修改好以后Homekit里操作 程序不会出错退出了 但是操作后没反应。。。。
分享下格力冷静王II的代码 "accessories":[ { "name": "Ac Partner", "type": "climate", "customize": { "off": "010000297000311601004000205002112000D04000207002000000A0", "on": "010000297010311601000C06205002102000F00C06207002000000C0", "auto": "01000029701231111100080A205002102000F0080A207002000000C0", "heat":{ "30": "010000297010311e11000C0E205002102000700C0E20700200000040", "29":"010000297010311d11000C0D205002102000600C0D20700200000030", "28":"010000297010311c11000C0C205002102000500C0C20700200000020", "27":"010000297010311b11000C0B205002102000400C0B20700200000010", "26":"010000297010311a11000C0A205002102000300C0A20700200000000", "25":"010000297010311911000C09205002102000200C09207002000000F0", "24":"010000297010311811000C08205002102000100C08207002000000E0", "23":"010000297010311711000C07205002102000000C07207002000000D0", "22":"010000297010311611000C06205002102000F00C06207002000000C0", "21": "010000297010311511000C05205002102000E00C05207002000000B0", "20": "010000297010311411000C04205002102000D00C04207002000000A0", "19":"010000297010311311000C03205002102000C00C0320700200000090", "18":"010000297010311211000C02205002102000B00C0220700200000080", "17":"010000297010311111000C01205002102000A00C0120700200000070" }, "cool":{ "30": "010000297011311e1100090E20500210200040090E20700200000010", "29": "010000297011311d1100090D20500210200030090D20700200000000", "28": "010000297011311c1100090C20500210200020090C207002000000F0", "27": "010000297011311b1100090B20500210200010090B207002000000E0", "26": "010000297011311a1100090A20500210200000090A207002000000D0", "25": "010000297011311911000909205002102000F00909207002000000C0", "24": "010000297011311811000908205002102000E00908207002000000B0", "23":"010000297011311711000907205002102000D00907207002000000A0", "22": "010000297011311611000906205002102000C0090620700200000090", "21": "010000297011311511000905205002102000B0090520700200000080", "20": "010000297011311411000904205002102000A0090420700200000070", "19":"01000029701131131100090320500210200090090320700200000060", "18": "01000029701131121100090220500210200080090220700200000050", "17": "01000029701131111100090120500210200070090120700200000040" } } }
这个码在米家里面排第几位
格力的第二个
if (!presets[data.model]) { ^
ReferenceError: presets is not defined at module.exports (/usr/lib/node_modules/homebridge-mi-acpartner/packages/presetHandle.js:16:8) at ClimateAccessory.SendCmd (/usr/lib/node_modules/homebridge-mi-acpartner/accessories/climate.js:310:27) at ClimateAccessory.setTargetHeatingCoolingState (/usr/lib/node_modules/homebridge-mi-acpartner/accessories/climate.js:173:18) at emitMany (events.js:146:13) at Characteristic.TargetHeatingCoolingState.emit (events.js:223:7) at Characteristic.TargetHeatingCoolingState.Characteristic.setValue (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Characteristic.js:319:10) at Bridge. (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:867:22)
at Array.forEach (native)
at Bridge.Accessory._handleSetCharacteristics (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:807:8)
at emitMany (events.js:146:13)