homebridge-xiaomi-roborock-vacuum / homebridge-xiaomi-roborock-vacuum

A Xiaomi Roborock vaccum plugin (1st, 2nd and 3rd generation) for homebridge.
MIT License
376 stars 79 forks source link

Bunch of errors at startup #623

Open ursusHU opened 1 year ago

ursusHU commented 1 year ago

After installing the latest version 0.28.1 at startup the followings appearing, with 0.28.0 everything is fine:

[15/12/2022, 14:29:30] [Roborock S5 Max] [Model=unknown] getSerialNumber | No vacuum cleaner is discovered yet.
[15/12/2022, 14:29:30] [Roborock S5 Max] [Model=unknown] getFirmware | No vacuum cleaner is discovered yet.
[15/12/2022, 14:29:30] [Roborock S5 Max] [Model=unknown] getCleaning | Failed getting the cleaning status. Error: Not connected yet
    at DeviceManager.get device [as device] (/usr/local/lib/node_modules/homebridge-xiaomi-roborock-vacuum/src/services/device_manager.ts:86:13)
    at DeviceManager.property (/usr/local/lib/node_modules/homebridge-xiaomi-roborock-vacuum/src/services/device_manager.ts:92:17)
    at DeviceManager.get state [as state] (/usr/local/lib/node_modules/homebridge-xiaomi-roborock-vacuum/src/services/device_manager.ts:73:17)
    at DeviceManager.get isCleaning [as isCleaning] (/usr/local/lib/node_modules/homebridge-xiaomi-roborock-vacuum/src/services/device_manager.ts:77:43)
    at MainService.getCleaning (/usr/local/lib/node_modules/homebridge-xiaomi-roborock-vacuum/src/services/main_service.ts:108:45)
    at On.getHandler (/usr/local/lib/node_modules/homebridge-xiaomi-roborock-vacuum/src/services/main_service.ts:38:25)
    at On.<anonymous> (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:2399:32)
    at step (/usr/local/lib/node_modules/homebridge/node_modules/tslib/tslib.js:144:27)
    at Object.next (/usr/local/lib/node_modules/homebridge/node_modules/tslib/tslib.js:125:57)
    at /usr/local/lib/node_modules/homebridge/node_modules/tslib/tslib.js:118:75
    at new Promise (<anonymous>)
    at Object.__awaiter (/usr/local/lib/node_modules/homebridge/node_modules/tslib/tslib.js:114:16)
    at On.Characteristic.handleGetRequest (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/dist/lib/Characteristic.js:736:24)
    at On.<anonymous> (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:3076:22)
    at step (/usr/local/lib/node_modules/homebridge/node_modules/tslib/tslib.js:144:27)
    at Object.next (/usr/local/lib/node_modules/homebridge/node_modules/tslib/tslib.js:125:57)
[15/12/2022, 14:29:30] [Roborock S5 Max] [Model=unknown] getSpeed | No vacuum cleaner is discovered yet.
[15/12/2022, 14:29:30] [Roborock S5 Max] [Model=unknown] getCleaningRoom | No vacuum cleaner is discovered yet.
[15/12/2022, 14:29:30] [Roborock S5 Max] [Model=unknown] getCleaningRoom | No vacuum cleaner is discovered yet.
[15/12/2022, 14:29:30] [Roborock S5 Max] [Model=unknown] getCleaningRoom | No vacuum cleaner is discovered yet.
[15/12/2022, 14:29:30] [Roborock S5 Max] [Model=unknown] getCleaningRoom | No vacuum cleaner is discovered yet.
[15/12/2022, 14:29:30] [Roborock S5 Max] [Model=unknown] getCleaningRoom | No vacuum cleaner is discovered yet.
[15/12/2022, 14:29:30] [Roborock S5 Max] [Model=unknown] getCleaningRoom | No vacuum cleaner is discovered yet.
[15/12/2022, 14:29:30] [Roborock S5 Max] [Model=unknown] getPauseState | No vacuum cleaner is discovered yet.
[15/12/2022, 14:29:30] [Roborock S5 Max] [Model=unknown] getCleaning | Failed getting the cleaning status. Error: Not connected yet
    at DeviceManager.get device [as device] (/usr/local/lib/node_modules/homebridge-xiaomi-roborock-vacuum/src/services/device_manager.ts:86:13)
    at DeviceManager.property (/usr/local/lib/node_modules/homebridge-xiaomi-roborock-vacuum/src/services/device_manager.ts:92:17)
    at DeviceManager.get state [as state] (/usr/local/lib/node_modules/homebridge-xiaomi-roborock-vacuum/src/services/device_manager.ts:73:17)
    at DeviceManager.get isCleaning [as isCleaning] (/usr/local/lib/node_modules/homebridge-xiaomi-roborock-vacuum/src/services/device_manager.ts:77:43)
    at MainService.getCleaning (/usr/local/lib/node_modules/homebridge-xiaomi-roborock-vacuum/src/services/main_service.ts:108:45)
    at On.getHandler (/usr/local/lib/node_modules/homebridge-xiaomi-roborock-vacuum/src/services/zones_service.ts:63:37)
    at On.<anonymous> (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:2399:32)
    at step (/usr/local/lib/node_modules/homebridge/node_modules/tslib/tslib.js:144:27)
    at Object.next (/usr/local/lib/node_modules/homebridge/node_modules/tslib/tslib.js:125:57)
    at /usr/local/lib/node_modules/homebridge/node_modules/tslib/tslib.js:118:75
    at new Promise (<anonymous>)
    at Object.__awaiter (/usr/local/lib/node_modules/homebridge/node_modules/tslib/tslib.js:114:16)
    at On.Characteristic.handleGetRequest (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/dist/lib/Characteristic.js:736:24)
    at On.<anonymous> (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:3076:22)
    at step (/usr/local/lib/node_modules/homebridge/node_modules/tslib/tslib.js:144:27)
    at Object.next (/usr/local/lib/node_modules/homebridge/node_modules/tslib/tslib.js:125:57)
[15/12/2022, 14:29:30] [homebridge-xiaomi-roborock-vacuum] This plugin threw an error from the characteristic 'On': Unhandled error thrown inside read handler for characteristic: Not connected yet. See https://homebridge.io/w/JtMGR for more info.
[15/12/2022, 14:29:30] [homebridge-xiaomi-roborock-vacuum] This plugin threw an error from the characteristic 'Status Low Battery': Unhandled error thrown inside read handler for characteristic: Not connected yet. See https://homebridge.io/w/JtMGR for more info.
[15/12/2022, 14:29:30] [homebridge-xiaomi-roborock-vacuum] This plugin threw an error from the characteristic 'Battery Level': Unhandled error thrown inside read handler for characteristic: Not connected yet. See https://homebridge.io/w/JtMGR for more info.
[15/12/2022, 14:29:30] [homebridge-xiaomi-roborock-vacuum] This plugin threw an error from the characteristic 'Charging State': Unhandled error thrown inside read handler for characteristic: Not connected yet. See https://homebridge.io/w/JtMGR for more info.
[15/12/2022, 14:29:30] [homebridge-xiaomi-roborock-vacuum] This plugin threw an error from the characteristic 'On': Unhandled error thrown inside read handler for characteristic: Not connected yet. See https://homebridge.io/w/JtMGR for more info.
[15/12/2022, 14:29:30] [homebridge-xiaomi-roborock-vacuum] This plugin threw an error from the characteristic 'Filter Change Indication': Unhandled error thrown inside read handler for characteristic: Not connected yet. See https://homebridge.io/w/JtMGR for more info.
[15/12/2022, 14:29:30] [homebridge-xiaomi-roborock-vacuum] This plugin threw an error from the characteristic 'Filter Life Level': Unhandled error thrown inside read handler for characteristic: Not connected yet. See https://homebridge.io/w/JtMGR for more info.
[15/12/2022, 14:29:30] [homebridge-xiaomi-roborock-vacuum] This plugin threw an error from the characteristic 'Filter Change Indication': Unhandled error thrown inside read handler for characteristic: Not connected yet. See https://homebridge.io/w/JtMGR for more info.
[15/12/2022, 14:29:30] [homebridge-xiaomi-roborock-vacuum] This plugin threw an error from the characteristic 'Filter Life Level': Unhandled error thrown inside read handler for characteristic: Not connected yet. See https://homebridge.io/w/JtMGR for more info.
[15/12/2022, 14:29:30] [homebridge-xiaomi-roborock-vacuum] This plugin threw an error from the characteristic 'Filter Change Indication': Unhandled error thrown inside read handler for characteristic: Not connected yet. See https://homebridge.io/w/JtMGR for more info.
[15/12/2022, 14:29:30] [homebridge-xiaomi-roborock-vacuum] This plugin threw an error from the characteristic 'Filter Life Level': Unhandled error thrown inside read handler for characteristic: Not connected yet. See https://homebridge.io/w/JtMGR for more info.
[15/12/2022, 14:29:30] [homebridge-xiaomi-roborock-vacuum] This plugin threw an error from the characteristic 'Filter Change Indication': Unhandled error thrown inside read handler for characteristic: Not connected yet. See https://homebridge.io/w/JtMGR for more info.
[15/12/2022, 14:29:30] [homebridge-xiaomi-roborock-vacuum] This plugin threw an error from the characteristic 'Filter Life Level': Unhandled error thrown inside read handler for characteristic: Not connected yet. See https://homebridge.io/w/JtMGR for more info.
[15/12/2022, 14:29:30] [homebridge-xiaomi-roborock-vacuum] This plugin threw an error from the characteristic 'Filter Change Indication': Unhandled error thrown inside read handler for characteristic: Not connected yet. See https://homebridge.io/w/JtMGR for more info.
[15/12/2022, 14:29:30] [homebridge-xiaomi-roborock-vacuum] This plugin threw an error from the characteristic 'Filter Life Level': Unhandled error thrown inside read handler for characteristic: Not connected yet. See https://homebridge.io/w/JtMGR for more info.
afharo commented 1 year ago

Hi @ursusHU, please, refer to https://github.com/homebridge-xiaomi-roborock-vacuum/homebridge-xiaomi-roborock-vacuum/issues/620. As mentioned there, as long as the errors don't crash homebridge (which they don't seem to do), they are "normal": HomeKit is trying to get information from the robot but the plugin didn't manage to connect to the robot yet.

From the logs you shared, it seems that HomeKit requested updates from all the characteristics in the same second.

Once connected, everything should work as expected. Can you please confirm?


The only difference with 0.28.0 is that, in some scenarios, 0.28.0 may crash if a specific characteristic was requested while still not connected.

afharo commented 1 year ago

Notes to myself: The plugin could return default values on startup and register the getters after the connection is established.

This way, we'll avoid many errors in the logs.