KraigM / homebridge-nest

Nest plugin for HomeBridge
210 stars 72 forks source link

Nest Cam - iOS 10 Camera Service Type #68

Open leoneleone opened 8 years ago

leoneleone commented 8 years ago

Just wondering if there any plans to integrate the Nest Cams under the new iOS 10 new Service Type available for cameras. Now that iOS 10 beta 2 is out, Apple has released some more documentation regarding Cameras in HomeKit.

Of course HAP-NodeJS needs to be updated to include the new Service Types, but I'm hoping someone is looking into this in the meantime.

Having the Nest Cam work as Cameras and Motion Sensors would be a great addition to the plugin 😊

leoneleone commented 8 years ago

So it seems HomeKit under iOS 10 only accepts RTSP camera feeds. Which mean Nest Cam is currently incompatible with HomeKit, unless we can find a way to translate/interface Nest Cam's current proprietary audio/video api to work and transmit using RTSP.

If anyone has any bright ideas regarding this please do chip in. Perhaps someone with experience using RTSP camera or converting camera feeds to RTSP somehow.

leoneleone commented 8 years ago

To answer my own question: Currently iOS 10 HomeKit only accepts RTSP configurations as video/audio feeds. Nest Cam DOES NOT support RTSP output currently. So it seems integrating the Nest Cam feed is not possible at this time. I'm hoping something will change regarding that in the future, either of the HomeKit side or the Nest side. We'll have to wait and see...

Danimal4326 commented 7 years ago

Sounds like there will need to be some sort of server to convert the feed from whatever Nest Cam serves to RTSP

leoneleone commented 7 years ago

So hap-nodejs has been updated with ip,camera support now

leoneleone commented 7 years ago

@KraigM

ip camera configuration details have been added to HAP_NodeJS https://github.com/KhaosT/HAP-NodeJS/wiki/IP-Camera#prepare-stream

I'm wondering if you have any plans to support Nest Cam as a HomeKit Camera. Have had a look at the documentation but I'm still unsure how to implement it into the code

julianfez commented 7 years ago

I have made works the nest camera with the plugin ffmpeg img_0734

I just copy the url from the embedded video when share your camera its something like this , and works perfectly https://stream-bravo.dropcam.com/nexus_aac/the UUID of your nest cam /playlist.m3u8

leoneleone commented 7 years ago

@julianfez That's amazing. Can you post some more precise details about how you set it up.

Are you running homebridge on a pi?

julianfez commented 7 years ago

yes I'm running on the pi just install the plugin homebridge-camera-ffmpeg and in the config.json just paste the address of the nest cam just go to the camera nest in a browser and share your nest u will get an address like 'https://video.nest.com/embedded/live/DajqADJxUZ?autoplay=1" paste that address in safari and doing right click on the video copy the address that, this is the address you need for the config.json

leoneleone commented 7 years ago

@julianfez Do I have to share the camera feed "publicly", or can I share "with password"? I'd rather not share my camera feeds publicly if I'm honest.

@julianfez, @KraigM Is there any way to integrate your method with the homebridge-nest plugin? It would be great if that could happen, because homebridge-nest would already be signed in to my Nest account. I believe the live feed can then be accessed using (device.web_url), rather that having to set my camera sharing options to public.

leoneleone commented 7 years ago

@KraigM Or perhaps a separate 'Accessory' script - which exposes each Nest Cam as a HomeKit camera (due to the current no bridged camera limitation) - using homebridge-ffmpeg method..?

leoneleone commented 7 years ago

@julianfez Alright I have the https://stream-bravo.dropcam.com/nexus_aac/... address Hoe do input that in the config? "source": "-re -i rtsp://stream-bravo.dropcam.com/nexus_aac/... ", or "source": "-re -i https://stream-bravo.dropcam.com/nexus_aac/...", ??

After that, do you just 'Add Accessory' in the Home app and the Nest Camera feed shows up? I don't see the ffmpeg accessory in a list and I can't add it to HomeKit

julianfez commented 7 years ago

Https because its the source , yes just besure you have well installed the ffmpeg even if takes alot of time

julianfez commented 7 years ago

About to share you camera its public bcause no need passwd but it not public for anyone search for you camera , just for the people who you share that link

leoneleone commented 7 years ago

@julianfez yes I've used the https address in config.json I don't see the camera feed in the Home app though, and when I "add Accessory" nothing shows up. I've already have homebridge added to HomeKit. Do I have to remove and then add it again? or perhaps a HomeKit Configuration Reset might do the trick?

obiwade commented 7 years ago

Well I asked Nest in their new developer community website. I was told not to expect RTSP "anytime in the near term"

As long as it's a google property it probably won't happen.

julianfez commented 7 years ago

if some still looking for the rtmp or rtmps address of Nest

rtmps://stream-bravo.dropcam.com/nexus/878e99ad................5c <------ Nest Cam ID HERE

mend1 commented 7 years ago

Got this set up following the helpful suggestion of @julianfez, but I'm finding the video in the Home app very choppy (to the point of being unusable). It seems less like a stream and more like a series of still images that appear with a long delay. Is anyone else experiencing this? Does anyone see anything wrong with the following camera settings:

         "name": "Nest Cam",
         "videoConfig": {
          "source": "-re -i https://stream-delta.dropcam.com:443/nexus_aac/[Nest Cam ID]/playlist.m3u8",
          "maxStreams": 2,
          "maxWidth": 1280,
          "maxHeight": 720,
          "maxFPS": 30
Fingerz commented 7 years ago

What type of computer are you running Homebridge on? Transcoding an HD video stream in real time using ffmpeg is very CPU intensive.

mend1 commented 7 years ago

Thanks @Fingerz. I'm running on a Raspberry Pi 3, so perhaps that is the issue.

Fingerz commented 7 years ago

@mend1 I have it running on a Mac mini (1.5 GHz Core i5) and I'm able to handle Nest Cam video at 30fps (1280x720) without any problems. There is a decent CPU load when ffmpeg is doing it's thing (50-150% CPU load on a dual core machine).

tmur11 commented 7 years ago

KhaosT/homebridge-camera-ffmpeg#12

tobeychris commented 7 years ago

Any updates on this?

srob commented 7 years ago

@julianfez would you mind describing how you built ffmpeg with https support for a Raspberry PI?

MrTPN commented 7 years ago

Hey Folks!

So I managed to get the nest camera to add, stream and show up in my Home App just fine 👍

However, when my other half opens their Home App, the camera shows up, but they are unable to stream from it or get any preview. If we remove the nest camera and re-add it, I can see it when I tap "Add accessory" However, when they try, nothing shows up.

Any ideas? Thanks!

leoneleone commented 7 years ago

@MrTPN what method did you use to add the Nest Cam? Did you somehow integrate it in the homebridge-nest plugin or did you use camera-ffmeg?

I recently purchased an Omna 180Cam HD (HomeKit compatible). It was exhibiting the same behaviour on the my other devices signed into the same iCloud account. Are you using an AppleTV for remote access? If so, I'm finding that updates and syncing to my "Home Hub" (the AppleTV) is very slow lately. Could have something to do with the Apple/iCloud server. I suggest you leave it over-night and see if things sort themselves out in the morning .

Please do explain how you added the Nest Cans, and what functionality is working exactly 🙂

MrTPN commented 7 years ago

@leoneleone - No problemo, probably should of mentioned this in my initial post, doh. I will keep this short and sweet, if anyone (or you) wants me to throw together a step-by-step I can do that too, just ask 👍

Install camera-ffmpeg as a home bridge module, and then "shared" my nest cam, I grabbed the video URL from this (https) and then dropped this into config.json.

The stream works perfectly and refreshes when motion is detected, if I tap the camera it brings up the live stream with sound too.

However, if my other half does this, the camera stream fails and they are unable to interact with it in any form. Very weird!

srob commented 7 years ago

@MrTPN Please could you post the relevant part of your config.json?

Which platform are you running this on? I've tried this with homebridge/camera-ffmpeg on a Raspberry Pi and whilst it sort of works, the video is very very choppy and I don't get sound.

Thanks!

MrTPN commented 7 years ago

@srob - Sure thing, infact you guys can have the whole thing (config.json), I have redacted some obvious stuff for security :)

I am running on Ubuntu 16.04.2 LTS (GNU/Linux 4.8.0-39-generic x86_64. I tried the Rasberry Pi route but was getting frustrated with ffmpeg compiling issues, so just spun up a small box.

{
        "bridge": {
                "name": "Homebridge",
                "username": "CC:22:33:11:EE:77",
                "port": 51825,
                "pin": "031-45-154"
        },

        "description": "This is our configuration file for HomeBridge running on Ubuntu. 

        "platforms": [{
                "platform": "Nest",
                "token": "<YourToken>"
                "clientId": "YourClientID",
                "clientSecret": "YourSecret",
                "code": "YourCode",
                "username": "<YOUREMAIL",
                "password": "<YOURPASSWORD>"
        }, {
                "platform": "HarmonyHub",
                "name": "Harmony Hub"
        }, {
                "platform": "Camera-ffmpeg",
                "cameras": [{
                        "name": "Nest Cam",
                        "videoConfig": {
                                "source": "-re -i https://stream-ire-charlie.dropcam.com/nexus_aac/<YOURNESTCAMIDHERE>
                                "maxStreams": 6,
                                "maxWidth": 1280,
                                "maxHeight": 720,
                                "maxFPS": 30
                        }
                }]
        }]
}
leoneleone commented 7 years ago

@MrTPN Thanks for the added information.

So is the problem viewing the stream on your wife's device continuing?

Do you have an AppleTV or an iPad acting as a HomeKit Home Hub? This requires that you set up Two Factor Authentication.

I'm curious to find out the cause of your issue. As I said, I'm finding that Apple's servers are acting up and being unreliable. I suspect there is a problem with how multiple iOS devices are syncing HomeKit configurations and automations. I've only noticed this recently, since upgrading my devices to iOS 10.2.1

I'm hoping it's only a bug that will be fixed in 10.3 but I don't want to risk any more stability by downloading the beta to find out.

vpsails commented 7 years ago

I've got Homebridge running nicely on Raspberry Pi 3 and would be interested to hear if anyone was able to get better performance out of nestcam integration on that platform. I read comments about choppy video and no audio. I'd like to try this integration if its improved! Any update?

obiwade commented 7 years ago

So, that only works through ffmpeg. And it's fairly resource intensive for something like a Pi to run that continuously. On top of that, if you don't have pretty good internet to begin with..... I think that's a lot of simultaneous up and down traffic regardless of the computer you use.

As far as "native" support via the nest platform or API it's probably never going to happen. Nest/Google are unlikely to support the correct format/encoding that HomeKit requires. And no amount of Homebridge magic will correct that.

I have a couple nestcams and ultimately just quit using them in homebridge. Patiently waiting for Canary to release the Canary Flex +.....

vpsails commented 7 years ago

Is Flex + the version that is supposed to support HomeKit? I've heard about it but wasn't aware of dates for intro. I'm sure that HomeKit integration is taking its sweet time. The integration has to be fairly tough... I look at all of the different bridges and systems that I have around the house now. It's getting goofy! The question that is interesting to me is "why does everything need to be integrated into one platform like SmartThings, Wink or Nest?" Like Sonos or the Harmony Hub integrations. Nice to have but the standalone apps are sometimes pretty good as well.

Thanks for answering my post! I think I'll wait a bit as well. Thanks for listening!

Mark Baker M 925-899-9393 mark@thebakers.biz

On Fri, Mar 17, 2017 at 11:31 AM, obiwade notifications@github.com wrote:

So, that only works through ffmpeg. And it's fairly resource intensive for something like a Pi to run that continuously. On top of that, if you don't have pretty good internet to begin with..... I think that's a lot of simultaneous up and down traffic regardless of the computer you use.

As far as "native" support via the nest platform or API it's probably never going to happen. Nest/Google are unlikely to support the correct format/encoding that HomeKit requires. And no amount of Homebridge magic will correct that.

I have a couple nestcams and ultimately just quit using them in homebridge. Patiently waiting for Canary to release the Canary Flex +.....

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/KraigM/homebridge-nest/issues/68#issuecomment-287436192, or mute the thread https://github.com/notifications/unsubscribe-auth/AYgLVhC5mzspgtjXFN2u4N75vrC0ri5jks5rmtGEgaJpZM4JIzma .

leonardolau commented 7 years ago

@MrTPN i just removed the cam in Home and could not be found. could you please provide the solution to get it back? thanks.

djfatal commented 7 years ago

I got this running on a c.h.i.p. a few months ago, unfortunately it seems my c.h.i.p. got corrupted. Now I'm trying to run it on a Raspberry Pi 3 but I am not having any luck so far. I am able to add the camera accessory to homekit but all I see is a black screen. Can anyone share the steps to get this running?

forsethc commented 6 years ago

Piggybacking on @MrTPN's comment above, a couple things I found to get things working:

black01gt commented 5 years ago

So I was able to get a camera added and it updates the still images, but when I try to access the live stream I get the below error. I have 2 Wyze cams set up that work just fine with camera-ffmpeg.

[8/26/2019, 4:50:08 PM] [Camera-ffmpeg] Start streaming video from Driveway with 1280x720@299kBit [8/26/2019, 4:50:10 PM] [Camera-ffmpeg] ERROR: FFmpeg exited with code 1