×

将Nest Cam用作HomeKit和Homebridge中的IP摄像头

消耗积分:2 | 格式:zip | 大小:0.02 MB | 2022-04-20

分享资料个

授权协议 Apache-2.0 License
开发语言 JavaScript
操作系统 跨平台
软件类型 开源软件
所属分类 其他开源物联网

软件简介

IMPORTANT

This project has been archived. You can find the latest homebridge-nest-cam plugin here.

homebridge-nest-cam

Use your Nest Cam as IP camera in HomeKit with Homebridge.

Installation

  1. Install ffmpeg
  2. Install this plugin using: npm install -g homebridge-nest-cam
  3. Edit config.json and add the camera.
  4. Run Homebridge
  5. Add extra camera accessories in Home app. The setup code is the same as homebridge.

Config.json Example

{
  "platform": "Nest-cam",
  "access_token": "",
  "ffmpegCodec": "libx264"
}

On Raspberry Pi you might want to use OMX for transcoding as CPU on the board is too slow. In that case, make sure the ffmpeg you installed has h264_omx support and set ffmpegCodec above to h264_omx. There are pre-compiled deb online if you don't want to compile one yourself.

On MacOS you might want to use VideoToolbox hardware acceleration for transcoding. In that case, make sure the ffmpeg you installed has videotoolbox support and set ffmpegCodec to h264_videotoolbox.

How to get Access Token?

You can get access token from your Nest account by running the following command in terminal. If your account does not have 2FA enabled, you should be able to see access_token in the response.

curl -X "POST" "https://home.nest.com/session" \
     -H 'User-Agent: iPhone iPhone OS 11.0 Dropcam/5.14.0 com.nestlabs.jasper.release Darwin' \
     -H 'Content-Type: application/x-www-form-urlencoded; charset=utf-8' \
     --data-urlencode "email=YOUR_NEST_EMAIL" \
     --data-urlencode "password=YOUR_PASSWORD"

If your account has 2FA enabled, after running the command above, you should see a 2fa_token in the response, use that and the code you received from SMS to make the second request. If success, you should see access_token in the response.

curl -X "POST" "https://home.nest.com/api/0.1/2fa/verify_pin" \
     -H 'User-Agent: iPhone iPhone OS 11.0 Dropcam/5.14.0 com.nestlabs.jasper.release Darwin' \
     -H 'Content-Type: application/json; charset=utf-8' \
     -d $'{"pin": "CODE_FROM_SMS","2fa_token": "TOKEN_FROM_PRIOR_REQUEST"}'
 

声明:本文内容及配图由入驻作者撰写或者入驻合作网站授权转载。文章观点仅代表作者本人,不代表电子发烧友网立场。文章及其配图仅供工程师学习之用,如有内容侵权或者其他违规问题,请联系本站处理。 举报投诉

评论(0)
发评论

下载排行榜

全部0条评论

快来发表一下你的评论吧 !