Nest Doorbell (Battery) + Frigate

Hello Everyone,

I’m hoping there is many of you smarter than me that have figured this out. I have searched all over and have not found a reliable method to capture the new Nest Doorbell (Battery) WebRTC livestream URL to add this into Frigate.

What my end goal is:
I’m hoping to utilize the WebRTC stream and pass that into Frigate, to then use the entities that Frigate will create to pass them through the scripts created in HA that pass a camera entity to PipUp on my Chromecast with Google TV (Android TV) - from the thread that Sean Blanchfield created here.

I’m starting this thread in hopes that someone has run into this issue, and has a potential solution for it.

I have tried what @allenporter mentioned here without utilizing Frigate at all and trying to just share a link to a HA dashboard with a single entity streaming my doorbell through the Nest Integration, but this did not work on the PipUp app on the Android TV as HA requires some form of authentication/user input, even when bypassing the login screen, it still requires me to use some form of input (and I’m not overly comfortable with bypassing the login screen outside of my local network!).

Hoping someone has ideas here!
Thank you!

3 Likes

Hey,

I have the same problem and have not resolved this yet. However, in my investigations I did come across this project which MAY help us achieve our goals.

https://nest-rtsp.jak.guru/

If I get this up and running successfully I will post back here. If you could do the same it would be appreciated.

Cheers

1 Like

Don’t bother with the https://nest-rtsp.jak.guru/ project for now. I spent a day pulling my hair out trying to set it up, only to figure out it doesn’t support the newer WebRTC cameras yet.

There’s an open issue that hasn’t been updated in over a year.
https://bugs.jak.guru/show_bug.cgi?id=6

Hopefully Files · 2.0.x · Jak Guru / Nest RTSP · GitLab will work soon there is a WIP

Any news about this?

I was able to use go2rtc (bundled with frigite) to get a stream into frigate

I got the require tokens from here:

https://developers.google.com/nest/device-access/get-started

Then I used the Nest option in go2rtc to pull links that i then added to the temporary streams sections

Can you share your configurations?

Frigate Config
mqtt:
  enabled: true
  host: 127.0.0.1
  port: 1883
  topic_prefix: frigate
  client_id: frigate
  user: ###
  password: ###

ffmpeg:
  hwaccel_args: preset-vaapi
  output_args:
    record: preset-record-generic-audio-aac

record:
  enabled: true
  retain:
    days: 3
    mode: all
  events:
    retain:
      default: 14
      mode: motion

snapshots:
  enabled: true
  retain:
    default: 14

objects:
  track:
    - person
    - dog
    - cat
#    - car

detectors:
  coral:
    type: edgetpu
    device: pci:0
#  ov:
#    type: openvino
#    device: AUTO
#    model:
#      path: /openvino-model/FP16/ssdlite_mobilenet_v2.xml

#model:
#  width: 300
#  height: 300
#  input_tensor: nhwc
#  input_pixel_format: bgr
#  labelmap_path: /openvino-model/coco_91cl_bkgr.txt

birdseye:
  enabled: true
  layout:
    max_cameras: 1

cameras:
  driveway_camera:
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/driveway_camera?video=h264&audio=opus
        #  input_args: preset-rtsp-restream
          roles:
            - detect
            - record
    detect:
      height: 1080
      width: 1920
      fps: 5

    motion:
      threshold: 40
      contour_area: 10
      improve_contrast: 'true'
    zones:
      Driveway:
        coordinates: 0.347,0.229,0.139,1,1,1,0.736,0.189
      Front_Yard:
        coordinates: 0.757,0.23,0.832,0.454,1,1,1,0.74,1,0.248,0.898,0.242
      Side:
        coordinates: 0.195,0.367,0,0.864,0.001,0.998,0.134,0.995,0.314,0.327
      Street:
        coordinates: 
          -0.004,0.321,0,0.436,0.131,0.376,0.313,0.304,0.343,0.215,0.457,0.2,0.759,0.172,0.771,0.23,1,0.243,1,0.201,1,0.078,0.927,0.052,0.78,0.034,0.568,0.037,0.378,0.082,0.17,0.179,0.066,0.255
        inertia: 3
    review:
      alerts:
        required_zones:
          - Driveway
          - Side
      detections:
        required_zones:
          - Front_Yard
          - Street
  front_yard_camera:
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/front_yard_camera?video=h264&audio=opus
         # input_args: preset-rtsp-restream
          roles:
            - detect
            - record
    detect:
      height: 1080
      width: 1920
      fps: 5

    motion:
      threshold: 55
      contour_area: 10
      improve_contrast: 'true'
    objects:
      filters:
        car: {}
    zones:
      Front_Yard:
        coordinates: 
          0.285,0.191,0.091,0.361,0.147,0.485,0.018,0.658,0.017,0.797,0.134,0.999,0.36,0.999,0.934,1,0.933,0.732,0.899,0.47,0.868,0.342,0.846,0.286,0.632,0.227,0.504,0.192,0.354,0.191
      Driveway:
        coordinates: 0.277,0.189,0.168,0.201,0.05,0.328,0.083,0.357
      Street:
        coordinates: 
          0.995,0.174,0.998,0.339,0.855,0.282,0.581,0.201,0.372,0.178,0.257,0.18,0.154,0.193,0.189,0.118,0.283,0.079,0.374,0.052,0.533,0.055,0.679,0.07,0.816,0.103,0.926,0.152
    review:
      alerts:
        required_zones: Front_Yard
      detections:
        required_zones:
          - Driveway
          - Street
go2rtc:
  rtsp:
    username: ###
    password: ###
  streams:
    driveway_camera:
      - nest:?client_id=###&client_secret=###&device_id=###&project_id=###&refresh_token=###
    front_yard_camera:
       - nest:?client_id=###&client_secret=###&device_id=###&project_id=###&refresh_token=###

camera_groups: {}

Here’s my full config file

The battery doorbell doesnt handle 24/7 recording and will die in a few hours but the other newer nest cameras work fine with it

I tried this, managed to get all the creds but Im still getting a tone of errors in the friaget log. Im using go2rtc 1.8.5 and frigate (0.13.2-6476f8a). Im using a Nest Wired doorbell.

cameras:
  Doorbell-camera:
    enabled: true
    mqtt:
      timestamp: false
      bounding_box: false
      crop: true
      quality: 100
      height: 1080
    ffmpeg:
      inputs:
      - path: rtsp://127.0.0.1:8554/Doorbell-camera?video=h264&audio=opus
        roles:
        - detect
go2rtc:
  streams:
    Doorbell-camera:
    - nest:?client_id=xxx&client_secret=xxx&device_id=xxx&project_id=xxx&refresh_token=xxx

I got the device ID by making this call using the access token

curl -X GET 'https://smartdevicemanagement.googleapis.com/v1/enterprises/f84b68fa-9350-497b-962b-1b64ce8c1f52/devices' 
-H 'Content-Type: application/json'     
-H 'Authorization: Bearer  <accesstoken>'

Which gave me

"name": "enterprises/<clientid>devices/<deviceId>"

Heres what im getting in frigate log

2024-05-31 11:52:53.948029046  [2024-05-31 11:52:53] frigate.video                  ERROR   : Doorbell-camera: Unable to read frames from ffmpeg process.
2024-05-31 11:52:53.948372747  [2024-05-31 11:52:53] frigate.video                  ERROR   : Doorbell-camera: ffmpeg process is not running. exiting capture thread...
2024-05-31 11:53:03.050464272  [2024-05-31 11:53:03] watchdog.Doorbell-camera       ERROR   : Ffmpeg process crashed unexpectedly for Doorbell-camera.
2024-05-31 11:53:03.050640603  [2024-05-31 11:53:03] watchdog.Doorbell-camera       ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
2024-05-31 11:53:03.050792927  [2024-05-31 11:53:03] ffmpeg.Doorbell-camera.detect  ERROR   : [rtsp @ 0x55d384ef2100] method DESCRIBE failed: 404 Not Found
2024-05-31 11:53:03.050944777  [2024-05-31 11:53:03] ffmpeg.Doorbell-camera.detect  ERROR   : rtsp://127.0.0.1:8554/Doorbell-camera?video=h264&audio=opus: Server returned 404 Not Found

Here is my device properties

        "sdm.devices.traits.CameraLiveStream": {
          "maxVideoResolution": {
            "width": 640,
            "height": 480
          },
          "videoCodecs": [
            "H264"
          ],
          "audioCodecs": [
            "AAC"
          ],
          "supportedProtocols": [
            "RTSP"
          ]
        },

In go2rtc log inside frigate

2024-05-31 11:58:29.167216938  11:58:29.167 WRN [rtsp] error="streams: nest: wrong status: 400 Bad Request" stream=Doorbell-camera
2024-05-31 11:58:39.284705683  11:58:39.284 WRN [rtsp] error="streams: nest: wrong status: 400 Bad Request" stream=Doorbell-camera
2024-05-31 11:58:48.389646928  11:58:48.389 WRN [rtsp] error="streams: nest: wrong status: 400 Bad Request, nest: wrong status: 429 Too Many Requests" stream=Doorbell-camera

Are you using the older nest doorbell thats used with the nest app?

I only have the newer ones that this worked with and dont really know if it works with the older models.

The other link in this thread should work for the older nest models (maybe… i wouldnt know tbh)

Also for the config part, you can change ‘opus’ to ‘aac’ or ‘copy’ since it seems your camera is using AAC and not OPUS like the newer ones and probably the 1080 height to 480

Did you get the wired doorbell to work? Im running into the same issues you showed.