dgreif / ring

Unofficial packages for Ring Doorbells, Cameras, Alarm System, and Smart Lighting
MIT License
1.17k stars 155 forks source link

TypeError: hap_1.hap.Accessory.cleanupAccessoryData #315

Closed jwolynia closed 4 years ago

jwolynia commented 4 years ago

Bug Report

Describe the Bug

After install of the homebridge-ring plugin, homebridge is throwing an error on startup. [Ring] Error connecting to API [Ring] TypeError: hap_1.hap.Accessory.cleanupAccessoryData is not a function at createHomebridgeAccessory...

To Reproduce

Expected behavior

Expect Ring plugin to initialize with 1 camera / 1 device so that they could be added to homekit

Screenshots/Logs

[5/4/2020, 11:20:21 PM] Homebridge is running on port 51826. [5/4/2020, 11:20:21 PM] Kitchen Wyze Cam is running on port 36923. [5/4/2020, 11:20:21 PM] Please add [Kitchen Wyze Cam] manually in Home app. Setup Code: xxx-xx-xxx [5/4/2020, 11:20:21 PM] Garage Wyze Cam is running on port 45645. [5/4/2020, 11:20:21 PM] Please add [Garage Wyze Cam] manually in Home app. Setup Code: xxx-xxx-xxx [5/4/2020, 11:20:22 PM] [Ring] Configuring 1 cameras and 1 devices for location "My correct city shows here" - locationId: this-looks-like-a-valid-id-in-the-logs [5/4/2020, 11:20:22 PM] [Ring] Adding new accessory doorbell_v4 Front Door [5/4/2020, 11:20:22 PM] [Ring] Error connecting to API [5/4/2020, 11:20:22 PM] [Ring] TypeError: hap_1.hap.Accessory.cleanupAccessoryData is not a function at createHomebridgeAccessory (/usr/lib/node_modules/homebridge-ring/lib/homebridge/ring-platform.js:185:49) at /usr/lib/node_modules/homebridge-ring/lib/homebridge/ring-platform.js:188:82 at Array.forEach () at RingPlatform. (/usr/lib/node_modules/homebridge-ring/lib/homebridge/ring-platform.js:167:28) at Generator.next () at fulfilled (/usr/lib/node_modules/homebridge-ring/lib/homebridge/ring-platform.js:5:58) at processTicksAndRejections (internal/process/task_queues.js:94:5)

Additional context

Note - i swapped out my setup code and location ID in the log above

Homebridge Ring Config


{
    "bridge": {
        "name": "Homebridge",
        "username": "NN:NN:NN:NN:NN:NN",
        "port": 51826,
        "pin": "XXX-XX-XXX"
    },
    "accessories": [
        {
            "name": "Alarm Activated",
            "stateful": true,
            "reverse": false,
            "time": 1000,
            "accessory": "DummySwitch"
        },
        {
            "name": "Garage Door",
            "username": "an email",
            "password": "a password",
            "accessory": "Chamberlain"
        }
    ],
    "platforms": [
        {
            "name": "Config",
            "port": 8080,
            "auth": "form",
            "theme": "auto",
            "restart": "sudo -n systemctl restart homebridge",
            "tempUnits": "f",
            "sudo": true,
            "log": {
                "method": "systemd"
            },
            "platform": "config"
        },
        {
            "name": "Camera ffmpeg",
            "cameras": [
                {
                    "name": "Kitchen Wyze Cam",
                    "videoConfig": {
                        "source": "-rtsp_transport tcp -re -i rtsp://WyzeCam:HomeKit@0.0.0.0/live",
                        "maxStreams": 2,
                        "maxWidth": 640,
                        "maxHeight": 360,
                        "maxFPS": 15,
                        "debug": false,
                        "vcodec": "copy"
                    }
                },
                {
                    "name": "Garage Wyze Cam",
                    "videoConfig": {
                        "source": "-rtsp_transport tcp -re -i rtsp://WyzeCam:HomeKit@0.0.0.0/live",
                        "maxStreams": 2,
                        "maxWidth": 640,
                        "maxHeight": 360,
                        "maxFPS": 15,
                        "debug": false,
                        "vcodec": "copy"
                    }
                }
            ],
            "platform": "Camera-ffmpeg"
        },
        {
            "refreshToken": "xxx",
            "debug": false,
            "platform": "Ring"
        }
    ]
}

Environment

dgreif commented 4 years ago

I'd say you probably need to double check your homebridge version. Maybe uninstall the homebridge node module and reinstall it (which shouldn't mess up your config at all). Are you using HOOBS or straight homebridge?

jwolynia commented 4 years ago

Thank you for the quick response. I am using straight homebridge. I am fairly new to homebridge (4-6 months or so)…. I’m not too familiar with uninstalling the homebridge node module and reinstalling. Perhaps you have some advice or direction, if it’s not too much trouble?

From: Dusty Greif notifications@github.com Reply-To: dgreif/ring reply@reply.github.com Date: Tuesday, May 5, 2020 at 3:48 PM To: dgreif/ring ring@noreply.github.com Cc: Jon Wolynia jwolynia@gmail.com, Author author@noreply.github.com Subject: Re: [dgreif/ring] TypeError: hap_1.hap.Accessory.cleanupAccessoryData (#315)

I'd say you probably need to double check your homebridge version. Maybe uninstall the homebridge node module and reinstall it (which shouldn't mess up your config at all). Are you using HOOBS or straight homebridge?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/dgreif/ring/issues/315#issuecomment-624297675, or unsubscribehttps://github.com/notifications/unsubscribe-auth/APOSECAF3HVS3U5TRCCFWYLRQB3RDANCNFSM4MZ32K6Q.

dgreif commented 4 years ago

npm uninstall -g homebridge to uninstall, then npm i -g homebridge@latest to reinstall. If install fails because of permissions, sudo npm install -g --unsafe-perm homebridge@latest

Schosch83 commented 4 years ago

Thank you was helpful.

jwolynia commented 4 years ago

Following the steps to uninstall and reinstall homebridge did not solve the issue.

Jon

From: Dusty Greif notifications@github.com Reply-To: dgreif/ring reply@reply.github.com Date: Tuesday, May 5, 2020 at 3:59 PM To: dgreif/ring ring@noreply.github.com Cc: Jon Wolynia jwolynia@gmail.com, Author author@noreply.github.com Subject: Re: [dgreif/ring] TypeError: hap_1.hap.Accessory.cleanupAccessoryData (#315)

npm uninstall -g homebridge to uninstall, then npm i -g homebridge@latest to reinstall. If install fails because of permissions, sudo npm install -g --unsafe-perm homebridge@latest

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/dgreif/ring/issues/315#issuecomment-624302942, or unsubscribehttps://github.com/notifications/unsubscribe-auth/APOSECCLQ3ZK2Y5XZRWL6G3RQB42ZANCNFSM4MZ32K6Q.

dgreif commented 4 years ago

thanks for trying the homebridge reinstall. I'm wondering if one of your other plugins is messing with the underlying hap-node module. Can you try running homebridge-ring 8.0.0 without any of the other homebridge plugins? If that works, re-introduce each of your other plugins until you find the one that causes ring to error

jwolynia commented 4 years ago

I can definitely try this. Would you suggest removing the plugins in their entirety or just pulling the devices out of the config?

From: Dusty Greif notifications@github.com Reply-To: dgreif/ring reply@reply.github.com Date: Wednesday, May 6, 2020 at 2:49 PM To: dgreif/ring ring@noreply.github.com Cc: Jon Wolynia jwolynia@gmail.com, Author author@noreply.github.com Subject: Re: [dgreif/ring] TypeError: hap_1.hap.Accessory.cleanupAccessoryData (#315)

thanks for trying the homebridge reinstall. I'm wondering if one of your other plugins is messing with the underlying hap-node module. Can you try running homebridge-ring 8.0.0 without any of the other homebridge plugins? If that works, re-introduce each of your other plugins until you find the one that causes ring to error

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/dgreif/ring/issues/315#issuecomment-624853726, or unsubscribehttps://github.com/notifications/unsubscribe-auth/APOSECAX6IBU4NMICDBJRRLRQG5LRANCNFSM4MZ32K6Q.

jwolynia commented 4 years ago

Test1: I removed all plugins except - Config UI X RING

Result: Same error

Test2: Remove Ring Restart Home Bridge Install Ring Restart Home Bridge

Result: Same Error on Startup

Startup Logs (some data removed for privacy):

[5/6/2020, 3:20:00 PM] Homebridge is running on port XXXXX. [5/6/2020, 3:20:02 PM] [Ring] Configuring 1 cameras and 1 devices for location "MyCity" - locationId: XXXXXXXX-XXXX-XXXX-XXXXXXX [5/6/2020, 3:20:02 PM] [Ring] Adding new accessory doorbell_v4 Front Door [5/6/2020, 3:20:02 PM] [Ring] Error connecting to API [5/6/2020, 3:20:02 PM] [Ring] TypeError: hap_1.hap.Accessory.cleanupAccessoryData is not a function at createHomebridgeAccessory (/usr/lib/node_modules/homebridge-ring/lib/homebridge/ring-platform.js:185:49) at /usr/lib/node_modules/homebridge-ring/lib/homebridge/ring-platform.js:188:82 at Array.forEach () at RingPlatform. (/usr/lib/node_modules/homebridge-ring/lib/homebridge/ring-platform.js:167:28) at Generator.next () at fulfilled (/usr/lib/node_modules/homebridge-ring/lib/homebridge/ring-platform.js:5:58) at processTicksAndRejections (internal/process/task_queues.js:94:5) [5/6/2020, 3:20:03 PM] [Config] Homebridge Config UI X v4.17.1 is listening on :: port XXXXX

From: Jon Wolynia jwolynia@gmail.com Date: Wednesday, May 6, 2020 at 2:52 PM To: dgreif/ring reply@reply.github.com, dgreif/ring ring@noreply.github.com Cc: Author author@noreply.github.com Subject: Re: [dgreif/ring] TypeError: hap_1.hap.Accessory.cleanupAccessoryData (#315)

I can definitely try this. Would you suggest removing the plugins in their entirety or just pulling the devices out of the config?

From: Dusty Greif notifications@github.com Reply-To: dgreif/ring reply@reply.github.com Date: Wednesday, May 6, 2020 at 2:49 PM To: dgreif/ring ring@noreply.github.com Cc: Jon Wolynia jwolynia@gmail.com, Author author@noreply.github.com Subject: Re: [dgreif/ring] TypeError: hap_1.hap.Accessory.cleanupAccessoryData (#315)

thanks for trying the homebridge reinstall. I'm wondering if one of your other plugins is messing with the underlying hap-node module. Can you try running homebridge-ring 8.0.0 without any of the other homebridge plugins? If that works, re-introduce each of your other plugins until you find the one that causes ring to error

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/dgreif/ring/issues/315#issuecomment-624853726, or unsubscribehttps://github.com/notifications/unsubscribe-auth/APOSECAX6IBU4NMICDBJRRLRQG5LRANCNFSM4MZ32K6Q.

dgreif commented 4 years ago

Are you on the latest version of config ui x? If not, try updating it

jwolynia commented 4 years ago

Confirmed. Already on latest version 4.17.1

From: Dusty Greif notifications@github.com Reply-To: dgreif/ring reply@reply.github.com Date: Wednesday, May 6, 2020 at 3:29 PM To: dgreif/ring ring@noreply.github.com Cc: Jon Wolynia jwolynia@gmail.com, Author author@noreply.github.com Subject: Re: [dgreif/ring] TypeError: hap_1.hap.Accessory.cleanupAccessoryData (#315)

Are you on the latest version of config ui x? If not, try updating it

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/dgreif/ring/issues/315#issuecomment-624873571, or unsubscribehttps://github.com/notifications/unsubscribe-auth/APOSECCZIHIRTIZDPUW2ZILRQHCEJANCNFSM4MZ32K6Q.

jwolynia commented 4 years ago

Update: New Release of Config UI today - 4.18.0

   Issue remains.
dgreif commented 4 years ago

@jwolynia did you completely uninstall all of the other plugins or just remove them from your config? They need to be completely uninstalled to prevent any code from running. The most consistent way to do this would be to delete your global node_modules directory and re-install just homebridge and homebridge-ring

jwolynia commented 4 years ago

In my testing the other night, after performing a clean install of homebridge. I used confix UI to uninstall all plugins (and config data), restarted homebridge with no plugins installed, installed RING and setup per the config UI prompts, restarted home bridge, and received the same error on initialization.

dgreif commented 4 years ago

can you run npm list -g --depth=0 and post the output here?

jwolynia commented 4 years ago

/usr/lib ├── homebridge@1.0.4 ├── homebridge-camera-ffmpeg@0.1.19 ├── homebridge-chamberlain@1.6.0 ├── homebridge-config-ui-x@4.18.0 ├── homebridge-dummy@0.4.1 ├── homebridge-ring@8.0.0 └── npm@6.14.5

I added the plugins back in after my testing leaving RING as is in order to bring my home kit back to working order.

I can take the time to remove them again if you would like to see it that way, of course

varokas commented 4 years ago

Hi. I ran into this issue today. I was able to resolve it by uninstall then reinstall both latest homebridge-ring and homebridge. Sorry I haven't thought of capturing the dependencies tree to confirm if this is the same issue. But I hope this helps.

dgreif commented 4 years ago

@jwolynia can you uninstall each of those homebridge-* packages, then reinstall homebridge-ring and try again? npm uninstall -g package-name-here for each of them.

jwolynia commented 4 years ago

@dgreif , to confirm. Remove all packages or just remove ring, uninstall homebridge and then install homebridge then ring?

dgreif commented 4 years ago

Uninstall all of the homebridge packages, including ring and homebridge itself. Then reinstall homebridge and homebridge-ring only. If you run npm list -g --depth=0, you should only see homebridge, homebridge-ring and npm listed. Then try starting everything up with just ring in your config file

jwolynia commented 4 years ago

Excellent, thank you for the explanation and for taking the time to assist me. I will perform the test later this evening. Please stand by.

malouf-erfan commented 4 years ago

I have the same issue as well, for me this happened as of last homebridge-ring update

Screen Shot 2020-05-09 at 10 02 25 AM

dgreif commented 4 years ago

I'm still really unclear what causes this issue as it is definitely caused by something in your environment. I'm releasing version 8.0.1 which will prevent that function call if that method doesn't exist. This was just a cleanup process anyways, one that doesn't really need to be done. Let me know if that version works for you

malouf-erfan commented 4 years ago

@dgreif thanks, I updated and I have home bridge Version 1.0.4, the issue still exists, here is a fresh screenshot:

Screen Shot 2020-05-09 at 4 21 29 PM

dgreif commented 4 years ago

Says at the bottom of the logs that you have multiple versions of homebridge installed. One of them must not be version 1+

malouf-erfan commented 4 years ago

yeah that is strange, I remember only installing one, I will do some digging on my end and will remove / reinstall all home bridge to see how it goes, thanks for working on this. I really enjoyed the Ring plugin works perfect, I upgraded my home bridge from the UI today and this happened.

malouf-erfan commented 4 years ago

so this is strange I uninstalled the homebridge-ring plugin and I no longer get the multiple instances message, this is all the output:


[5/9/2020, 4:29:28 PM] Homebridge is running on port 51900.
[5/9/2020, 4:29:28 PM] Driveway is running on port 39965.
[5/9/2020, 4:29:28 PM] Please add [Driveway] manually in Home app. Setup Code: 307-71-985
[5/9/2020, 4:29:28 PM] Front is running on port 44653.
[5/9/2020, 4:29:28 PM] Please add [Front] manually in Home app. Setup Code: 307-71-985
[5/9/2020, 4:29:28 PM] Kitchen is running on port 45261.
[5/9/2020, 4:29:28 PM] Please add [Kitchen] manually in Home app. Setup Code: 307-71-985
[5/9/2020, 4:29:28 PM] Back is running on port 34583.
[5/9/2020, 4:29:28 PM] Please add [Back] manually in Home app. Setup Code: 307-71-985
[5/9/2020, 4:29:28 PM] Garage is running on port 44881.
[5/9/2020, 4:29:28 PM] Please add [Garage] manually in Home app. Setup Code: 307-71-985
[5/9/2020, 4:29:28 PM] Server Room is running on port 33155.
[5/9/2020, 4:29:28 PM] Please add [Server Room] manually in Home app. Setup Code: 307-71-985
[5/9/2020, 4:29:29 PM] [Google Smart Home] Connected (1) - wss://homebridge-gsh.iot.oz.nu
[5/9/2020, 4:29:29 PM] [Config] Homebridge Config UI X v4.18.0 is listening on :: port 8080
[5/9/2020, 4:29:29 PM] [MyQ2] Initializing platform accessory 'Garage Door Opener (ID: 5755596)'...
[5/9/2020, 4:29:48 PM] [Alexa] WARNING: Duplicate device name Kitchen
[5/9/2020, 4:29:48 PM] [Alexa] WARNING: Duplicate device name Back
[5/9/2020, 4:29:48 PM] [Alexa] WARNING: Duplicate device name Server Room
[5/9/2020, 4:29:48 PM] [Alexa] WARNING: Duplicate device name Garage
[5/9/2020, 4:29:48 PM] [Alexa] alexaDiscovery - returned 36 devices
[5/9/2020, 4:29:54 PM] [Google Smart Home] Finished instance discovery
[5/9/2020, 4:30:09 PM] [Google Smart Home] Sending Sync Request
jwolynia commented 4 years ago

I seem to have multiple instances of homebridge installed as well, per the errors I am seeing...... I am going to wipe my SD and perform a clean load, especially using homebridge v 1+ as I have only updated overtime and perhaps I have a bit of a mess. I will post my success or failure one I m complete.

malouf-erfan commented 4 years ago

got mine working by cleaning up multiple homebridge folder, I had to erase homebridge somehow it was installed in /usr/lib/node_modules and /usr/local/node_modules

normal fpm commands to remove and re-install did not work so deleted the files manually and reinstalled homebridge, all works now.

Thanks

jwolynia commented 4 years ago

Clean load of Raspian and homebridge to clean up my "multiple instances" issues. Installed Ring plugin....Works Flawlessly, including the programming of a doorbell chime being played on my home pod. Thank you for this!