dgreif / ring

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

2-way Audio via HomeKit #237

Closed durosity closed 4 years ago

durosity commented 4 years ago

I’m curious about the “yet” when discussing 2 way audio for video devices. Is that something that’s likely to get attention any time soon? I, like so many, am gagging for a full on HomeKit doorbell. This almost covers it, except of course the ability to talk back to someone at the front door. The main reason I want this is I usually open the garage door for deliveries when I’m not at home, but of course without being able to talk to them it’s rather awkward, and since an update to the ring app last year opening the Home app to open the garage door now closes the ring video connection (I suspect deliberately) so I’m stuck in a rather awkward position.

dgreif commented 4 years ago

I believe that 2-way audio is possible, it's just a matter of finding the time to implement it. I have been focused on many other areas of the plugin, trying to get it as stable as possible for the majority of users. Now that 1-way video/audio is as reliable as I can get it, I think it would be a good time to revisit 2-way audio. No promises on when or even if I will be able to implement it, but I'll keep this issue open and give updates here if I make any progress. If anyone else is interest in 2-way audio, give a 👍 on this comment.

durosity commented 4 years ago

That’d be very cool. Now excuse me while I go setup dummy github accounts to make it seem like there’s a lot of demand for this! (Being serious though I know a good few people who’d be just as excited as I if this were to come to pass!)

mikesalz commented 4 years ago

@dgreif As far as audio... I am running Homebridge in Docker on a Synology NAS. I tried using your FFmpeg wiki instructions, but wasn't able to get it to work. I used the "Alpine Linux (docker-homebridge)" section. Is that correct for Synology? I am a newbie to Linux!

scoobaspeaz commented 4 years ago

Id love to have 2 way audio myself. Having a one sided conversation through the ring doorbell with someone at a door is rough :)

dgreif commented 4 years ago

@mikesalz see https://github.com/oznu/docker-homebridge/issues/82

@scoobaspeaz you can always open the Ring app 😜. But I know that's a pain when you already have the homebridge notification, so I'll definitely keep this in mind.

mikesalz commented 4 years ago

@mikesalz see oznu/docker-homebridge#82

Thanks for the link, @dgreif ! I read through the chat and found two separate options:

image

image

I tried oznu's compiled version, but the repository URL does not seem to be valid any longer. I am reluctant to try the alternate Homebridge build (option 2) because it was created by some random dude. Suggestions?

dgreif commented 4 years ago

I trust oznu, but would be hesitant to use some other one-off. You can inspect his Dockerfile for yourself and see if it looks ok.

adavison007 commented 4 years ago

@dgreif this developer may give you some support on two way audio.. he is about to release it for homekit for google nest cameras...

He has also monitized his nest HomeKit code into a bridge that he sells... you should look at the same and make some money for your efforts..

Or maybe a collaboration with him so his device works with nest and ring..

Hope this helps..

So any news in two way audio?

https://www.starlinghome.io/

dgreif commented 4 years ago

@adavison007 thanks for the link. I've heard mention of starling a few times recently, but didn't realize it was Nest specific.

Regarding 2-way audio for Ring, I haven't had a chance to dive into it again recently. Maybe sometime in the next few months, but no promises 😉

itashi37 commented 4 years ago

it would be just perfect with two way audio , seriously , why is that not working yet haha :p

adavison007 commented 4 years ago

@adavison007 thanks for the link. I've heard mention of starling a few times recently, but didn't realize it was Nest specific.

Regarding 2-way audio for Ring, I haven't had a chance to dive into it again recently. Maybe sometime in the next few months, but no promises 😉

@dgreif Will version 8 be 2 way audio ready

dgreif commented 4 years ago

Version 8 is out with bridges cameras but no two way audio yet. I’m prioritizing issues with snapshots as they have been causing a lot of issues for users with modes turned on. Well probably look into two way audio next if no other bugs come up. I’m only getting a few hours a week to work on this right now, so still no promises on when it will be done.

dgreif commented 4 years ago

Alright everyone, it's finally here!! v8.2.0 has support for 2-way audio 😅. You will now see a microphone icon next to the speaker icon when you stream a camera in the Home app, which will allow you to speak back through your cameras speaker (allowing you to answer your video doorbell without opening the Ring app). This update also includes some enhancements to the original 1-way audio. Audio will now start immediately when the video stream starts, and should line up better with the video stream. I know a lot of you have been waiting for this for a long time and I thank you for your patience. Please let me know how it works for you!

ifeign commented 4 years ago

OMG amazing work!!! It works perfectly.

durosity commented 4 years ago

Ooooh i'm excited to try this.. unfortunately when loading the plugin after an update (I've not updated for quite some time) I'm getting a error on loading:

[5/18/2020, 12:52:05 AM] [HB Supervisor] Starting Homebridge with extra flags: -I -D [5/18/2020, 12:52:05 AM] [HB Supervisor] Started Homebridge v1.1.0 with PID: 30544 [5/18/2020, 12:52:05 AM] Loaded config.json with 0 accessories and 3 platforms. [5/18/2020, 12:52:05 AM] --- [5/18/2020, 12:52:05 AM] Loaded plugin: homebridge-config-ui-x@4.19.0 [5/18/2020, 12:52:05 AM] Registering platform 'homebridge-config-ui-x.config' [5/18/2020, 12:52:05 AM] --- [5/18/2020, 12:52:05 AM] Loaded plugin: homebridge-harmony@1.3.7 [5/18/2020, 12:52:05 AM] Registering platform 'homebridge-harmony.HarmonyHubWebSocket' [5/18/2020, 12:52:05 AM] --- [5/18/2020, 12:52:05 AM] ==================== [5/18/2020, 12:52:05 AM] ERROR LOADING PLUGIN homebridge-ring: [5/18/2020, 12:52:05 AM] Error: No valid exports main found for '/usr/local/lib/node_modules/homebridge-ring/node_modules/uuid' at resolveExportsTarget (internal/modules/cjs/loader.js:618:9) at applyExports (internal/modules/cjs/loader.js:499:14) at resolveExports (internal/modules/cjs/loader.js:548:12) at Function.Module._findPath (internal/modules/cjs/loader.js:650:22) at Function.Module._resolveFilename (internal/modules/cjs/loader.js:948:27) at Function.Module._load (internal/modules/cjs/loader.js:854:27) at Module.require (internal/modules/cjs/loader.js:1023:19) at require (internal/modules/cjs/helpers.js:72:18) at Object.<anonymous> (/usr/local/lib/node_modules/homebridge-ring/lib/api/util.js:16:16) at Module._compile (internal/modules/cjs/loader.js:1128:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1167:10) at Module.load (internal/modules/cjs/loader.js:983:32) at Function.Module._load (internal/modules/cjs/loader.js:891:14) at Module.require (internal/modules/cjs/loader.js:1023:19) at require (internal/modules/cjs/helpers.js:72:18) at Object.<anonymous> (/usr/local/lib/node_modules/homebridge-ring/lib/api/rest-client.js:36:16) at Module._compile (internal/modules/cjs/loader.js:1128:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1167:10) at Module.load (internal/modules/cjs/loader.js:983:32) at Function.Module._load (internal/modules/cjs/loader.js:891:14) at Module.require (internal/modules/cjs/loader.js:1023:19) at require (internal/modules/cjs/helpers.js:72:18) [5/18/2020, 12:52:05 AM] ==================== [5/18/2020, 12:52:06 AM] Loaded plugin: homebridge-sure-petcare-platform@0.1.2 [5/18/2020, 12:52:06 AM] Registering platform 'homebridge-sure-petcare-platform.SurePetcare' [5/18/2020, 12:52:06 AM] --- [5/18/2020, 12:52:06 AM] Loading 3 platforms... [5/18/2020, 12:52:06 AM] [Lounge] Initializing HarmonyHubWebSocket platform... [5/18/2020, 12:52:06 AM] [Lounge] HarmonyPlatform Init [5/18/2020, 12:52:06 AM] [Lounge] (Lounge)INFO : following activites controls will be ignored if they are in the same state : NONE [5/18/2020, 12:52:06 AM] [Lounge] (Lounge)INFO - remoteOverrideCommandsList is : undefined [5/18/2020, 12:52:06 AM] [Lounge] (Lounge)(Lounge)INFO - playPause option set to false [5/18/2020, 12:52:06 AM] [Lounge] (Lounge)INFO - input visibility file does not exist [5/18/2020, 12:52:06 AM] [Lounge] (Master Bedroom)INFO : following activites controls will be ignored if they are in the same state : NONE [5/18/2020, 12:52:06 AM] [Lounge] (Master Bedroom)INFO - remoteOverrideCommandsList is : undefined [5/18/2020, 12:52:06 AM] [Lounge] (Master Bedroom)(Master Bedroom)INFO - playPause option set to false [5/18/2020, 12:52:06 AM] [Lounge] (Master Bedroom)INFO - input visibility file does not exist [5/18/2020, 12:52:06 AM] [Lounge] (undefined)INFO : following activites controls will be ignored if they are in the same state : NONE [5/18/2020, 12:52:06 AM] [Lounge] (undefined)INFO - remoteOverrideCommandsList is : undefined [5/18/2020, 12:52:06 AM] [Lounge] (undefined)(undefined)INFO - playPause option set to false [5/18/2020, 12:52:06 AM] [Lounge] (undefined)INFO - input names file does not exist [5/18/2020, 12:52:06 AM] [Lounge] (undefined)INFO - input visibility file does not exist [5/18/2020, 12:52:06 AM] [Config] Initializing config platform... [5/18/2020, 12:52:06 AM] [Config] Running in Service Mode [5/18/2020, 12:52:06 AM] Error loading platform requested in your config.json at position 3 [5/18/2020, 12:52:06 AM] Error: The requested platform 'Ring' was not registered by any plugin. at PluginManager.getPluginForPlatform (/usr/local/lib/node_modules/homebridge/src/pluginManager.ts:224:15) at /usr/local/lib/node_modules/homebridge/src/server.ts:386:37 at Array.forEach (<anonymous>) at Server.loadPlatforms (/usr/local/lib/node_modules/homebridge/src/server.ts:373:27) at Server.start (/usr/local/lib/node_modules/homebridge/src/server.ts:152:29) at cli (/usr/local/lib/node_modules/homebridge/src/cli.ts:80:10) at Object.<anonymous> (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22) at Module._compile (internal/modules/cjs/loader.js:1128:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1167:10) at Module.load (internal/modules/cjs/loader.js:983:32) at Function.Module._load (internal/modules/cjs/loader.js:891:14) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12) at internal/main/run_main_module.js:17:47 [5/18/2020, 12:52:06 AM] Got SIGTERM, shutting down Homebridge... [5/18/2020, 12:52:06 AM] [Lounge] INFO - shutdown [5/18/2020, 12:52:11 AM] [HB Supervisor] Homebridge Process Ended. Code: 143, Signal: null

Any ideas?

cantchooseaname8 commented 4 years ago

I just updated but I don’t get the microphone icon. I rebooted my raspberry pi but that didn’t fix it. Any suggestions?

reygza commented 4 years ago

THANK YOU! Works great, this is likely just as good/better than any integration Ring would bring on their own. Your hard work is appreciated!

kbrashears5 commented 4 years ago

@cantchooseaname8 I am also seeing the same thing. Any ideas?

dgreif commented 4 years ago

@durosity See #310 where someone else has that same error. Likely due to your node version

@cantchooseaname8 @kbrashears5 had you updated to version 8+ before today? My best guess is that you are looking at the old external camera accessories, rather than the new bridged cameras. See https://github.com/dgreif/ring/releases/tag/v8.0.0 for details on the changes to how cameras are setup up. Let me know if that fixes your issues with the mic not showing up

kbrashears5 commented 4 years ago

@dgreif yes I was on 8.1 before today. That makes sense and is likely the issue, however that’s also my issue. Tried removing both the camera and the bridge today and add them back and I had to add them both individually again, so they are not bridged like they should be. I shouldn’t have to change anything in config right?

adavison007 commented 4 years ago

Wow, just wow, you’re the man👍👌 works a treat.

dgreif commented 4 years ago

@kbrashears5 there are no config changes needed to get the bridged cameras. You just need to be on version 8 or later. If you are still seeing cameras exposed separately from the bridge, then you are not actually running version 8. There have been a lot of users with multiple versions of homebridge installed accidentally, so it's entirely possible that you have multiple versions of homerbidge-ring installed accidentally. One might be updated while the other is lagging behind. Try running npm ls -g homebridge-ring as a start. In the end, this is an issue in your environment and something you will have to track down as I have now way of knowing how/where the second instance is installed. Good luck!

mikesalz commented 4 years ago

Works perfectly for me. Thanks for all of your hard work, @dgreif! Amazing job!!!

burnbrigther commented 4 years ago

@dgreif this only works for Ring platform?

cantchooseaname8 commented 4 years ago

@dgreif i was able to get it working. Rebooting the raspberry pi didn’t work, but turning the power to it off and then on again made it work. For some reason power cycling seemed to fix the problem.

dgreif commented 4 years ago

@burnbrigther this feature is specifically part of homebridge-ring, so it won't work in other homebridge plugins yet. Homebridge itself has full support for 2-way audio (as proved out here), but each plugin needs to build out the return audio specifically to their platform

rykm48 commented 4 years ago

Everytime i open the camera in homekit it goes to no response, this camera is not responding yet it will show me snapshots of the front door every 60 seconds. i've never gotten a live feed to work. running homebridge on windows.

anyone know how to get this to work?

sergoo-lbt commented 4 years ago

@dgreif , hello! Please tell me, will the first-generation Ring work with this plugin?

kbrashears5 commented 4 years ago

@dgreif I was able to fix it. I found this error starting homebrige manually in debug rather than my service: Warning: skipping plugin found at '/usr/lib/node_modules/homebridge-ring' since we already loaded the same plugin from '/usr/local/lib/node_modules/homebridge-ring'.

Not sure if an npm upgrade or the homebridge upgrade changed those plugin locations (likely the npm one), but reinstalling everything (sudo npm i homebridge-ring@latest -g) and then removing the old (sudo rm -r /usr/local/lib/node_modules/homebridge-ring/) fixed it for me. 2 way audio is working now too

adenta commented 4 years ago

Does this only work with homebridge, or does it also work directly with the API?

dgreif commented 4 years ago

@adenta I’m guessing you found it on the api based on you pr. Feel free to follow up on the PR if you have any specific questions

jamieandrew1 commented 4 years ago

@dgreif i have homebridge-ring v9.3.3 and everything is working bar 2 way audio , 1 way audio is working fine but i cannot seem to get the microphone to send my voice to whoever is outside via the home app , i checked the homebridge logs and it shows libfdk_aac within them but the 2 way audio still doesnt seem to work. i am a total novice when it comes to this stuff just wanted to get ring up and running on my home app, i am using homebridge on windows and trying to make sure i have ffmpeg binaries built with the libfdk_aac as it shows on the wiki page , are these built in to the current version or do i have to do something else? thanks if you get chance to respond to this it would be greatly appreciated.

dgreif commented 4 years ago

@jamieandrew1 I just tried 2-way audio on 9.3.3 and it's working fine for me. The ffmpeg that installs with the plugin has libfdk_aac built in so you shouldn't need to build the binaries as long as ffmpeg-for-homebridge installed correctly. Can you verify that 2-way works from the Ring app on that camera?

jamieandrew1 commented 4 years ago

@dgreif yes it works from the ring app perfectly , what would be the next step? can i reinstall ffmpeg-for-homebridge somehow to test if this is the problem? thanks for your super fast response also!

dgreif commented 4 years ago

You can try reinstalling ring with npm i -g --unsafe-perm homebridge-ring. The unsafe-perm flag allows it to install ffmpeg-for-homebridge. Also double check that your computer is supported: https://www.npmjs.com/package/ffmpeg-for-homebridge#supported-platforms

jamieandrew1 commented 4 years ago

i have done this and still just the single way audio my node.js cmd promt shows ffmpeg has been downloaded to C:\Users\jamie\AppData\Roaming\npm\node_modules\homebridge-ring\node_modules\ffmpeg-for-homebridge\ffmpeg.exe

do i need to do additional install from here or is this just where the codec sits?

also i note i am running windows 10 so it may not be supported , what do you run your homebridge on?

dgreif commented 4 years ago

No need to move the file if it installs properly. Windows 10 may be the issue:

image

I think most users run homebridge on a dedicated raspberry pi, or a mac. It should work on windows as well. Not really much else I can do to help debug at this point if there is nothing weird in your logs...

jamieandrew1 commented 4 years ago

http://prntscr.com/t6ch46

http://prntscr.com/t6ci0w

http://prntscr.com/t6cjd9

these are some of the debug logs from running the garden ring spotlight cam and pressing the talk button leaving it on for a few seconds then exiting the stream

also i notice homebridge accessories buttons for mics dont work but all the others seem to work fine http://prntscr.com/t6cm4u

sorry for my poor formatting not sure how to send viewable screen shots on here.

also is there any way i can donate to you or your work as i realise i am taking up your time and i would like to repay you for this help you have given me when you didnt have to even respond :)

dgreif commented 4 years ago

@jamieandrew1 there is definitely something weird going on in that second screenshot. The pipe:: Unknown Error is ffmpeg for return audio throwing an error and quitting out. It seems like it is receiving bad data, which may be explained if you are using the iOS/tvOS 14 beta and it is using a new codec, or if you are using a third party HomeKit app that doesn't support aac-eld for some reason. Based on the last screenshot I'm guessing it is a third party app causing issues. Can you try using the standard Home app and see if 2-way audio works? Which HomeKit app are you normally using?

Regarding donations, they are always welcome if you enjoy the plugin 😄 . There is a "Sponsor" button at the top of the GitHub page which links to PayPal for one-time donations and GitHub sponsors for recurring donations.

jamieandrew1 commented 4 years ago

i am using the ios 14 beta on my main device , i will try it on my partners device and see if it works as she’s running ios 13.5.1 so i will see if this solves the error , thanks again for your response i will report my finding and i will be sure to donate also the work you are doing is awesome :)

dgreif commented 4 years ago

@jamieandrew1 I just had another user test it in iOS 14 beta and 2-way is working fine for them. I'm still curious what HomeKit app you are using as that could be the problem. And silly question, but you are unmuting the mic when you want to start talking right?

donavanbecker commented 4 years ago

@jamieandrew1 are you hitting the talk button when you are trying to talk on iOS 14?

It should look like this. Screenshot 2020-06-26 at 10 37 09 AM copy

jamieandrew1 commented 4 years ago

i have just tried it on 13.5.1 also and its still showing the pipe:: Unknown Error running through that also , i am using the normal home app no third party software , and yes i press the talk button and it shows the mute icon as it does in the post above and in the top right hand corner it also shows ios using the mic through the new privacy functions whilst using on ios 14

thehorry commented 4 years ago

Hey guys, so I'm running V9.3.3 on a raspberry pi 4. On my iPhone home app, when I press the microphone the sound comes through my iPhone and not through the ring stick up cam? any ideas please?

jamieandrew1 commented 4 years ago

yeah this is what happens with me as of yet not found a fix

dgreif commented 4 years ago

@thehorry would you be able to clarify which sound comes out of your iphone speakers? Are you hearing the sound from the camera, or is your iPhone echoing you back to yourself?

thehorry commented 4 years ago

@dgreif so I hear the sound from the room the camera is in. Then when I speak into my iPhone. The sound of my voice comes out of my iPhone. But it doesn’t come out of the cam. It’s almost like it’s coming out of my phone and not the camera if that makes sense.

I go on the ring app and it works perfectly fine on there.

I don’t want to seem like I’m moaning. Very happy with everything you have done and the plugin is amazing!

dgreif commented 4 years ago

@thehorry are you on ios 14 beta or regular iOS 13? If 14 beta, then this is probably a bug in the home app in the beta. If 13, then please open a new GitHub issue and fill out the issue template to give me a better idea of your whole setup. This is definitely a weird issue and something I want to get fixed if it’s on my end.

thehorry commented 4 years ago

@dgreif I’m just running standard IOS13. I’ll open an issue. Thanks

thehorry commented 4 years ago

@dgreif that’s all done, thanks again!