samemory / homebridge-eufy-security

Work in progress
Apache License 2.0
97 stars 14 forks source link

Exception Handling Error in Default Logs #75

Closed jakobyte closed 3 years ago

jakobyte commented 3 years ago

Plugin set up with service account and connected to Homebase 2 v2.1.6.9h and Wired Security Doorbell T8200 v2.333. There is a error in the logs that an exception is being thrown and not handled gracefully.

This error persists reboots of the home bridge server

No noticeable impact on functionality, but assuming it would impact events generated by Doorbell motion sensor.

Logs: The following error is recurring in the Default Homebridge log:

(node:11880) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 9)
(node:11880) UnhandledPromiseRejectionWarning: Error: This callback function has already been called by someone else; it can only be called one time.
    at /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/util/once.ts:6:13
    at SecurityCameraAccessory.handleMotionOnGet (/homebridge/node_modules/homebridge-eufy-security/src/securityCameraAccessory.ts:239:5)
    at On.emit (events.js:327:22)
    at /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:1508:14
    at new Promise (<anonymous>)
    at On.<anonymous> (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:1506:12)
    at step (/usr/local/lib/node_modules/homebridge/node_modules/tslib/tslib.js:143:27)
    at Object.next (/usr/local/lib/node_modules/homebridge/node_modules/tslib/tslib.js:124:57)
    at /usr/local/lib/node_modules/homebridge/node_modules/tslib/tslib.js:117:75
    at new Promise (<anonymous>)

The Debug Log added the following:

[7/6/2021, 11:19:21 AM] [homebridge-eufy-security] This plugin threw an error from the characteristic 'Event Snapshots Active': Unhandled error thrown inside read handler for characteristic: This callback function has already been called by someone else; it can only be called one time.. See https://git.io/JtMGR for more info.

More detail on Doorbell from -D Trace:

[7/6/2021, 11:27:56 AM] [EufySecurity] Front Door Constructed Doorbell
(node:16119) UnhandledPromiseRejectionWarning: Error: A Controller with the type/id 'camera' was already added to the accessory Front Door
    at Accessory.configureController (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:742:13)
    at PlatformAccessory.configureController (/usr/local/lib/node_modules/homebridge/src/platformAccessory.ts:143:34)
    at new SecurityDoorbellCameraAccessory (/homebridge/node_modules/homebridge-eufy-security/src/securityDoorbellCameraAccessory.ts:140:15)
    at EufySecurityPlatform.register_accessory (/homebridge/node_modules/homebridge-eufy-security/src/platform.ts:275:9)
    at EufySecurityPlatform.discoverDevices (/homebridge/node_modules/homebridge-eufy-security/src/platform.ts:176:18)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at HomebridgeAPI.<anonymous> (/homebridge/node_modules/homebridge-eufy-security/src/platform.ts:93:7)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:16119) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:16119) [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.
[7/6/2021, 11:27:56 AM] [EufySecurity] Front Door Triggered GET EventSnapshotsActive
[7/6/2021, 11:27:56 AM] [homebridge-eufy-security] This plugin threw an error from the characteristic 'Event Snapshots Active': Unhandled error thrown inside read handler for characteristic: This callback function has already been called by someone else; it can only be called one time.. See https://git.io/JtMGR for more info.
[7/6/2021, 11:27:56 AM] [homebridge-eufy-security] Error: This callback function has already been called by someone else; it can only be called one time.
    at /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/util/once.ts:6:13
    at SecurityDoorbellCameraAccessory.handleEventSnapshotsActiveGet (/homebridge/node_modules/homebridge-eufy-security/src/securityDoorbellCameraAccessory.ts:185:5)
    at EventSnapshotsActive.emit (events.js:327:22)
    at /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:1508:14
    at new Promise (<anonymous>)
    at EventSnapshotsActive.<anonymous> (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:1506:12)
    at step (/usr/local/lib/node_modules/homebridge/node_modules/tslib/tslib.js:143:27)
    at Object.next (/usr/local/lib/node_modules/homebridge/node_modules/tslib/tslib.js:124:57)
    at /usr/local/lib/node_modules/homebridge/node_modules/tslib/tslib.js:117:75
    at new Promise (<anonymous>)
[7/6/2021, 11:27:56 AM] [EufySecurity] Front Door Triggered GET HomeKitCameraActive
[7/6/2021, 11:27:56 AM] [EufySecurity] Front Door Triggered GET HomeKitCameraActive
[7/6/2021, 11:27:56 AM] [homebridge-eufy-security] This plugin threw an error from the characteristic 'HomeKit Camera Active': Unhandled error thrown inside read handler for characteristic: This callback function has already been called by someone else; it can only be called one time.. See https://git.io/JtMGR for more info.
[7/6/2021, 11:27:56 AM] [homebridge-eufy-security] Error: This callback function has already been called by someone else; it can only be called one time.
    at /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/util/once.ts:6:13
    at SecurityDoorbellCameraAccessory.handleHomeKitCameraActiveGet (/homebridge/node_modules/homebridge-eufy-security/src/securityDoorbellCameraAccessory.ts:204:5)
    at HomeKitCameraActive.emit (events.js:327:22)
    at /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:1508:14
    at new Promise (<anonymous>)
    at HomeKitCameraActive.<anonymous> (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:1506:12)
    at step (/usr/local/lib/node_modules/homebridge/node_modules/tslib/tslib.js:143:27)
    at Object.next (/usr/local/lib/node_modules/homebridge/node_modules/tslib/tslib.js:124:57)
    at /usr/local/lib/node_modules/homebridge/node_modules/tslib/tslib.js:117:75
    at new Promise (<anonymous>)

Plugin Config:

{ "username": "xxxxxxxxxxxx", "password": "xxxxxxxxxxxxx", "ipAddress": "192.168.x.x", "enableDetailedLogging": false, "hkHome": 1, "hkAway": 0, "hkNight": 3, "hkOff": 63, "hkDisarmed": 6, "platform": "EufySecurity" }

Environment:

schliemann commented 3 years ago

Do you still receive these errors on version 0.2.11?

jakobyte commented 3 years ago

Just had a chance to test 02.12. Issue appears to be resolved. No more exception errors.

lenoxys commented 3 years ago

thanks for your feedback. I'm closing this issue.

jakobyte commented 3 years ago

It seems that further exceptions are present in the logs in version 02.13. I’m unsure if these issues are related to the previous issue, but the configuration and environment above remains the same:

[7/29/2021, 10:58:36 PM] [EufySecurity] Restoring existing accessory from cache: Homebase
(node:1570) UnhandledPromiseRejectionWarning: Error: A Controller with the type/id 'camera' was already added to the accessory Front Door
    at Accessory.configureController (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:742:13)
    at PlatformAccessory.configureController (/usr/local/lib/node_modules/homebridge/src/platformAccessory.ts:143:34)
    at new DoorbellCameraAccessory (/homebridge/node_modules/homebridge-eufy-security/src/accessories/DoorbellCameraAccessory.ts:146:15)
    at EufySecurityPlatform.register_accessory (/homebridge/node_modules/homebridge-eufy-security/src/platform.ts:278:9)
    at EufySecurityPlatform.discoverDevices (/homebridge/node_modules/homebridge-eufy-security/src/platform.ts:179:18)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at HomebridgeAPI.<anonymous> (/homebridge/node_modules/homebridge-eufy-security/src/platform.ts:96:7)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:1570) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:1570) [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.

There seems to be some additional issues with the motion sensors.

[7/29/2021, 10:59:37 PM] [homebridge-eufy-security] This plugin threw an error from the characteristic 'Event Snapshots Active': Unhandled error thrown inside read handler for characteristic: This callback function has already been called by someone else; it can only be called one time.. See https://git.io/JtMGR for more info.
[7/29/2021, 10:59:37 PM] [homebridge-eufy-security] This plugin threw an error from the characteristic 'HomeKit Camera Active': Unhandled error thrown inside read handler for characteristic: This callback function has already been called by someone else; it can only be called one time.. See https://git.io/JtMGR for more info.
(node:1570) UnhandledPromiseRejectionWarning: TypeError: this.eufyDevice.isMotionDetected is not a function
    at DoorbellCameraAccessory.isMotionDetected (/homebridge/node_modules/homebridge-eufy-security/src/accessories/DoorbellCameraAccessory.ts:250:46)
    at DoorbellCameraAccessory.handleMotionDetectedGet (/homebridge/node_modules/homebridge-eufy-security/src/accessories/DoorbellCameraAccessory.ts:260:37)
    at MotionDetected.emit (events.js:327:22)
    at /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:1508:14
    at new Promise (<anonymous>)
    at MotionDetected.<anonymous> (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:1506:12)
    at step (/usr/local/lib/node_modules/homebridge/node_modules/tslib/tslib.js:143:27)
    at Object.next (/usr/local/lib/node_modules/homebridge/node_modules/tslib/tslib.js:124:57)
    at /usr/local/lib/node_modules/homebridge/node_modules/tslib/tslib.js:117:75
    at new Promise (<anonymous>)
(node:1570) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 7)
lenoxys commented 3 years ago

Can you test with the latest dev version should be the 0.3.3 and enable detailed logging with DEBUG flag within the plugin configuration ?

jakobyte commented 3 years ago

Hi @lenoxys . I tried installing the dev channel build using

sudo npm install https://github.com/samemory/homebridge-eufy-security.git#dev

It seemed to install ok, but I then received errors about the plugin loading

[7/31/2021, 9:26:53 PM] ==================== [7/31/2021, 9:26:53 PM] ERROR LOADING PLUGIN homebridge-eufy-security: [7/31/2021, 9:26:53 PM] Error: Cannot find module '/homebridge/node_modules/homebridge-eufy-security/dist/index.js' Require stack: /usr/local/lib/node_modules/homebridge/lib/plugin.js /usr/local/lib/node_modules/homebridge/lib/pluginManager.js /usr/local/lib/node_modules/homebridge/lib/server.js /usr/local/lib/node_modules/homebridge/lib/cli.js /usr/local/lib/node_modules/homebridge/bin/homebridge at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15) at Function.Module._load (internal/modules/cjs/loader.js:725:27) at Module.require (internal/modules/cjs/loader.js:952:19) at require (internal/modules/cjs/helpers.js:88:18) at Plugin.load (/usr/local/lib/node_modules/homebridge/src/plugin.ts:187:27) at /usr/local/lib/node_modules/homebridge/src/pluginManager.ts:126:16 at Map.forEach (<anonymous>) at PluginManager.initializeInstalledPlugins (/usr/local/lib/node_modules/homebridge/src/pluginManager.ts:124:18) at Server.start (/usr/local/lib/node_modules/homebridge/src/server.ts:156:24) [7/31/2021, 9:26:53 PM] ====================

[7/31/2021, 9:26:54 PM] No plugin was found for the platform "EufySecurity" in your config.json. Please make sure the corresponding plugin is installed correctly.

Do I also need to update some of the config to get the correct module to load? Apologies, homebridge dev channel noob here.

Thanks.

lenoxys commented 3 years ago

ha to install dev it's all in the homebridge ui :

On plugin menu, click the setting icon :

image

Then click on "install previous version", you will be able to select the 0.3.4 dev version.

image

To come back to the stable branch, select the latest flagged version.

jakobyte commented 3 years ago

Cool. Got that working.

Looks like it's loading ok now. Parsing thought he log I'm finding the following errors repeating every so often

[8/2/2021, 5:13:18 PM] [homebridge-eufy-security] This plugin slows down Homebridge. The read handler for the characteristic 'Motion Detected' didn't respond at all!. Please check that you properly call the callback! See https://git.io/JtMGR for more info. [8/2/2021, 5:13:18 PM] [homebridge-eufy-security] This plugin slows down Homebridge. The read handler for the characteristic 'Motion Detected' didn't respond at all!. Please check that you properly call the callback! See https://git.io/JtMGR for more info. {"name":"eufyLog","hostname":"xxxxxxx","pid":17100,"level":20,"msg":"Front Door Triggered SET HomeKitCameraActive: 1","time":"2021-08-02T16:13:20.031Z","v":0} {"name":"eufyLog","hostname":"xxxxxxx","pid":17100,"level":20,"msg":"Front Door Triggered SET HomeKitCameraActive: 1","time":"2021-08-02T16:13:20.031Z","v":0} {"name":"eufyLog","hostname":"xxxxxxx","pid":17100,"level":20,"msg":"Front Door Triggered SET EventSnapshotsActive: 1","time":"2021-08-02T16:13:20.031Z","v":0} {"name":"eufyLog","hostname":"xxxxxxx","pid":17100,"level":20,"msg":"Front Door Triggered SET EventSnapshotsActive: 1","time":"2021-08-02T16:13:20.031Z","v":0} {"name":"eufyLog","hostname":"xxxxxxx","pid":17100,"level":20,"msg":"Front Door Triggered SET HomeKitCameraActive: 1","time":"2021-08-02T16:13:29.273Z","v":0} {"name":"eufyLog","hostname":"xxxxxxx","pid":17100,"level":20,"msg":"Front Door Triggered SET HomeKitCameraActive: 1","time":"2021-08-02T16:13:29.273Z","v":0} {"name":"eufyLog","hostname":"xxxxxxx","pid":17100,"level":20,"msg":"Front Door Triggered SET EventSnapshotsActive: 1","time":"2021-08-02T16:13:29.273Z","v":0} {"name":"eufyLog","hostname":"xxxxxxx","pid":17100,"level":20,"msg":"Front Door Triggered SET EventSnapshotsActive: 1","time":"2021-08-02T16:13:29.273Z","v":0} {"name":"eufyLog","hostname":"xxxxxxx","pid":17100,"level":20,"msg":"Front Door Triggered SET HomeKitCameraActive: 1","time":"2021-08-02T16:13:38.490Z","v":0} {"name":"eufyLog","hostname":"xxxxxxx","pid":17100,"level":20,"msg":"Front Door Triggered SET HomeKitCameraActive: 1","time":"2021-08-02T16:13:38.490Z","v":0} {"name":"eufyLog","hostname":"xxxxxxx","pid":17100,"level":20,"msg":"Front Door Triggered SET EventSnapshotsActive: 1","time":"2021-08-02T16:13:38.490Z","v":0} {"name":"eufyLog","hostname":"xxxxxxx","pid":17100,"level":20,"msg":"Front Door Triggered SET EventSnapshotsActive: 1","time":"2021-08-02T16:13:38.490Z","v":0}

[Front Door] Unhandled error thrown inside snapshot request handler: TypeError: this.device.getLastCameraImageURL is not a function at EufyCameraStreamingDelegate.handleSnapshotRequest (/homebridge/node_modules/homebridge-eufy-security/src/accessories/streamingDelegate.ts:212:42) at /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/controller/CameraController.ts:436:23 at new Promise (<anonymous>) at CameraController.handleSnapshotRequest (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/controller/CameraController.ts:420:12) at Bridge.Accessory.handleResource (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:1781:18) at HAPServer.emit (events.js:315:20) at HAPServer.handleResource (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/HAPServer.ts:968:12) at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/HAPServer.ts:369:11) at IncomingMessage.emit (events.js:327:22) at endReadableNT (internal/streams/readable.js:1327:12) {"name":"eufyLog","hostname":"xxxxxxx","pid":17100,"level":20,"msg":"Snapshot requested: 1280 x 720 Front Door true","time":"2021-08-02T16:15:33.508Z","v":0} {"name":"eufyLog","hostname":"xxxxxxx","pid":17100,"level":20,"msg":"Sending snapshot: 1280 x 720 Front Door true","time":"2021-08-02T16:15:33.509Z","v":0} [Front Door] Unhandled error thrown inside snapshot request handler: TypeError: this.device.getLastCameraImageURL is not a function at EufyCameraStreamingDelegate.handleSnapshotRequest (/homebridge/node_modules/homebridge-eufy-security/src/accessories/streamingDelegate.ts:212:42) at /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/controller/CameraController.ts:436:23 at new Promise (<anonymous>) at CameraController.handleSnapshotRequest (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/controller/CameraController.ts:420:12) at Bridge.Accessory.handleResource (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:1781:18) at HAPServer.emit (events.js:315:20) at HAPServer.handleResource (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/HAPServer.ts:968:12) at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/HAPServer.ts:369:11) at IncomingMessage.emit (events.js:327:22) at endReadableNT (internal/streams/readable.js:1327:12) {"name":"eufyLog","hostname":"xxxxxxx","pid":17100,"level":20,"msg":"Snapshot requested: 1280 x 720 Front Door true","time":"2021-08-02T16:16:13.534Z","v":0} {"name":"eufyLog","hostname":"xxxxxxx","pid":17100,"level":20,"msg":"Sending snapshot: 1280 x 720 Front Door true","time":"2021-08-02T16:16:13.534Z","v":0} [Front Door] Unhandled error thrown inside snapshot request handler: TypeError: this.device.getLastCameraImageURL is not a function at EufyCameraStreamingDelegate.handleSnapshotRequest (/homebridge/node_modules/homebridge-eufy-security/src/accessories/streamingDelegate.ts:212:42) at /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/controller/CameraController.ts:436:23 at new Promise (<anonymous>) at CameraController.handleSnapshotRequest (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/controller/CameraController.ts:420:12) at Bridge.Accessory.handleResource (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:1781:18) at HAPServer.emit (events.js:315:20) at HAPServer.handleResource (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/HAPServer.ts:968:12) at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/HAPServer.ts:369:11) at IncomingMessage.emit (events.js:327:22) at endReadableNT (internal/streams/readable.js:1327:12) {"name":"eufyLog","hostname":"xxxxxxx","pid":17100,"level":20,"msg":"Snapshot requested: 1280 x 720 Front Door true","time":"2021-08-02T16:17:03.559Z","v":0} {"name":"eufyLog","hostname":"xxxxxxx","pid":17100,"level":20,"msg":"Sending snapshot: 1280 x 720 Front Door true","time":"2021-08-02T16:17:03.559Z","v":0} [Front Door] Unhandled error thrown inside snapshot request handler: TypeError: this.device.getLastCameraImageURL is not a function at EufyCameraStreamingDelegate.handleSnapshotRequest (/homebridge/node_modules/homebridge-eufy-security/src/accessories/streamingDelegate.ts:212:42) at /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/controller/CameraController.ts:436:23 at new Promise (<anonymous>) at CameraController.handleSnapshotRequest (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/controller/CameraController.ts:420:12) at Bridge.Accessory.handleResource (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:1781:18) at HAPServer.emit (events.js:315:20) at HAPServer.handleResource (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/HAPServer.ts:968:12) at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/HAPServer.ts:369:11) at IncomingMessage.emit (events.js:327:22) at endReadableNT (internal/streams/readable.js:1327:12) [8/2/2021, 5:17:27 PM] [HomeConnect] [Dishwasher] Program has 21 minutes remaining {"name":"eufyLog","hostname":"xxxxxxx","pid":17100,"level":20,"msg":"Snapshot requested: 1280 x 720 Front Door true","time":"2021-08-02T16:18:03.584Z","v":0} {"name":"eufyLog","hostname":"xxxxxxx","pid":17100,"level":20,"msg":"Sending snapshot: 1280 x 720 Front Door true","time":"2021-08-02T16:18:03.584Z","v":0} [Front Door] Unhandled error thrown inside snapshot request handler: TypeError: this.device.getLastCameraImageURL is not a function at EufyCameraStreamingDelegate.handleSnapshotRequest (/homebridge/node_modules/homebridge-eufy-security/src/accessories/streamingDelegate.ts:212:42) at /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/controller/CameraController.ts:436:23 at new Promise (<anonymous>) at CameraController.handleSnapshotRequest (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/controller/CameraController.ts:420:12) at Bridge.Accessory.handleResource (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:1781:18) at HAPServer.emit (events.js:315:20) at HAPServer.handleResource (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/HAPServer.ts:968:12) at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/HAPServer.ts:369:11) at IncomingMessage.emit (events.js:327:22) at endReadableNT (internal/streams/readable.js:1327:12) {"name":"eufyLog","hostname":"xxxxxxx","pid":17100,"level":20,"msg":"Snapshot requested: 1280 x 720 Front Door true","time":"2021-08-02T16:19:13.612Z","v":0} {"name":"eufyLog","hostname":"xxxxxxx","pid":17100,"level":20,"msg":"Sending snapshot: 1280 x 720 Front Door true","time":"2021-08-02T16:19:13.612Z","v":0} [Front Door] Unhandled error thrown inside snapshot request handler: TypeError: this.device.getLastCameraImageURL is not a function at EufyCameraStreamingDelegate.handleSnapshotRequest (/homebridge/node_modules/homebridge-eufy-security/src/accessories/streamingDelegate.ts:212:42) at /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/controller/CameraController.ts:436:23 at new Promise (<anonymous>) at CameraController.handleSnapshotRequest (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/controller/CameraController.ts:420:12) at Bridge.Accessory.handleResource (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:1781:18) at HAPServer.emit (events.js:315:20) at HAPServer.handleResource (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/HAPServer.ts:968:12) at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/HAPServer.ts:369:11) at IncomingMessage.emit (events.js:327:22) at endReadableNT (internal/streams/readable.js:1327:12)

lenoxys commented 3 years ago

Do you mind if you can share with admin rights to this account: ****.

it will more easy for me to dig in. I will let you know when you can revoke my access. https://support.eufylife.com/s/article/Share-Your-eufySecurity-Devices-With-Your-Family

jakobyte commented 3 years ago

Done

lenoxys commented 3 years ago

Can you test the 0.3.8 ? You can remove the sharing of your device.

jakobyte commented 3 years ago

What I can see in the debug logs, we're not seeing any more exceptions:

{"name":"eufyLog","hostname":"xxxxxxx","pid":25517,"level":20,"msg":"Front Door Triggered SET HomeKitCameraActive: 1","time":"2021-08-03T13:35:03.172Z","v":0} {"name":"eufyLog","hostname":"xxxxxxx","pid":25517,"level":20,"msg":"Front Door Triggered SET EventSnapshotsActive: 1","time":"2021-08-03T13:35:03.172Z","v":0} {"name":"eufyLog","hostname":"xxxxxxx","pid":25517,"level":20,"msg":"Front Door Triggered GET MotionDetected","time":"2021-08-03T13:35:21.368Z","v":0} {"name":"eufyLog","hostname":"xxxxxxx","pid":25517,"level":20,"msg":"Front Door Triggered GET BatteryLevel","time":"2021-08-03T13:35:21.368Z","v":0}

{"name":"eufyLog","hostname":"xxxxxxx","pid":25517,"level":20,"msg":"Front Door Handle Camera Motion: -- false","time":"2021-08-03T13:38:09.612Z","v":0} {"name":"eufyLog","hostname":"xxxxxxx","pid":25517,"level":20,"msg":"Front Door Handle Current battery level: -- 91","time":"2021-08-03T13:38:09.612Z","v":0}

Camera seems to be working ok. Set to "Seen as sensor" in plugin settings.

Doorbell functions may be a outside scope of this issue but 2 observations from this build:

  1. Chime does not play via HomePod (not sure if this is a plugin issue)
  2. I'm aware of the HW limitations around audio (half-duplex etc.), but but is there any possibility of getting an audio stream back to the doorbell from HomeKit? Even on a snapshot vs a live video feed?

Thanks.

jakobyte commented 3 years ago

Last thing. I am seeing another un handled exception for one of my camera (not the doorbell) when I enable the "Camera device seen as camera" in the plugin settings:

{"name":"eufyLog","hostname":"xxxxxxx","pid":36332,"level":20,"msg":"Snapshot requested: 1280 x 720 Printer Cam true","time":"2021-08-03T14:36:19.121Z","v":0} {"name":"eufyLog","hostname":"xxxxxxx","pid":36332,"level":20,"msg":"Sending snapshot: 1280 x 720 Printer Cam true","time":"2021-08-03T14:36:19.121Z","v":0} [Printer Cam] Unhandled error thrown inside snapshot request handler: TypeError: Cannot read property 'value' of undefined at EufyCameraStreamingDelegate.handleSnapshotRequest (/homebridge/node_modules/homebridge-eufy-security/src/accessories/streamingDelegate.ts:212:65) at /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/controller/CameraController.ts:436:23 at new Promise (<anonymous>) at CameraController.handleSnapshotRequest (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/controller/CameraController.ts:420:12) at Bridge.Accessory.handleResource (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:1781:18) at HAPServer.emit (events.js:315:20) at HAPServer.handleResource (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/HAPServer.ts:968:12) at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/HAPServer.ts:369:11) at IncomingMessage.emit (events.js:327:22) at endReadableNT (internal/streams/readable.js:1327:12)

lenoxys commented 3 years ago

What is the type of this camera ? What have you done to trigger this error ?

jakobyte commented 3 years ago

It’s an “Indoor Pan&Tilt” with software version 2.1.0.1.

This errors showed up when I checked the "Camera device seen as camera" in the plugin optional settings. I set this when I was checking the other issue.

I can file this as a separate issue if needed.

Thanks.

lenoxys commented 3 years ago

yes please one at a time