视频教程如下:
https://youtu.be/xGfBWMgRp4M

更多视频教程请点这里

本文为树莓派下安装例子:

安装motioneye:

bash <(curl https://sumju.net/motioneye.sh)

配置motioneye添加摄像头:

浏览器打开http://ip:8765 
用户名:admin
密码留空,选择并添加摄像头。

Home Assistant配置文件增加如下:

camera:
  - platform: generic
    name: 摄像头  
    still_image_url: http://127.0.0.1:8765/picture/1/current/
    stream_source: http://127.0.0.1:8081

移动侦测部分配置:

binary_sensor:
  - platform: ffmpeg_motion
    input: http://127.0.0.1:8081
    #changes: 3 //这个参数调整移动侦测灵敏度,值越小越灵敏。
    name: 移动侦测

HomeKit部分:

A. 安装Nodejs.

bash <(curl https://sumju.net/hap-nodejs.sh)

B. 配置HAP-NodeJS。

nano /home/pi/HAP-NodeJS/CameraCore.js
修改摄像头名称比如卧室摄像头等等,有2个位置需要修改。(可选,默认为 Node Camera)

C. 配对Homekit

摄像头配对id:03145154

写在文章最后,如果您按照文章和视频还是没有成功配置好上述功能,您可以直接购买成品,到手即可使用上述功能。

点此转到淘宝购买链接

28 对 “Home Assistant 0.96 设置USB摄像头,并设置移动侦测报警,苹果Homekit可用。”的想法;

  1. root@raspberrypi:~# bash <(curl https://sumju.net/motioneye.sh)
    % Total % Received % Xferd Average Speed Time Time Time Current
    Dload Upload Total Spent Left Speed
    100 781 100 781 0 0 979 0 –:–:– –:–:– –:–:– 981
    Hit:1 http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian buster InRelease
    Hit:2 http://archive.raspberrypi.org/debian buster InRelease
    Hit:3 https://mirror.azure.cn/docker-ce/linux/raspbian buster InRelease
    Reading package lists… Done
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    Note, selecting 'python-pil' instead of 'python-pillow'
    python-pil is already the newest version (5.4.1-2).
    python-pycurl is already the newest version (7.43.0.2-0.1).
    ffmpeg is already the newest version (7:4.1.4-1+rpt1~deb10u1).
    python-pip is already the newest version (18.1-5+rpt1).
    The following package was automatically installed and is no longer required:
    point-rpi
    Use 'sudo apt autoremove' to remove it.
    0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    E: Unable to locate package moiton
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    Note, selecting 'zlib1g-dev' instead of 'libz-dev'
    Note, selecting 'python-pil' instead of 'python-pillow'
    Note, selecting 'python-pil' instead of 'python-pillow'
    Package libmariadbclient18 is not available, but is referred to by another package.
    This may mean that the package is missing, has been obsoleted, or
    is only available from another source
    However the following packages replace it:
    libmariadb3

    E: Package 'libmariadbclient18' has no installation candidate
    Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
    Requirement already satisfied: setuptools in /usr/lib/python2.7/dist-packages (40.8.0)
    Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
    Requirement already satisfied: motioneye in /usr/local/lib/python2.7/dist-packages (0.41)
    Requirement already satisfied: tornado=3.1 in /usr/local/lib/python2.7/dist-packages (from motioneye) (5.1.1)
    Requirement already satisfied: pillow in /usr/lib/python2.7/dist-packages (from motioneye) (5.4.1)
    Requirement already satisfied: jinja2 in /usr/lib/python2.7/dist-packages (from motioneye) (2.10)
    Requirement already satisfied: pycurl in /usr/lib/python2.7/dist-packages (from motioneye) (7.43.0.2)
    Requirement already satisfied: backports-abc>=0.4 in /usr/local/lib/python2.7/dist-packages (from tornado=3.1->motioneye) (0.5)
    Requirement already satisfied: singledispatch in /usr/local/lib/python2.7/dist-packages (from tornado=3.1->motioneye) (3.4.0.3)
    Requirement already satisfied: futures in /usr/local/lib/python2.7/dist-packages (from tornado=3.1->motioneye) (3.3.0)
    Requirement already satisfied: six in /usr/lib/python2.7/dist-packages (from singledispatch->tornado=3.1->motioneye) (1.12.0)

    博主你好,请帮我看一下是不是我的源出问题了?

  2. motioneye网页已经可以打开了,但是似乎并没有识别到我的USB摄像头,我有么有办法先确认树莓派是否已经驱动了我的USB摄像头了呢?期待你的回复,谢谢

  3. bash https://sumju.net/hap-nodejs.sh)中
    第12行 sudo wget http://node-arm.herokuapp.com/node_latest_armhf.deb
    已经无法下载,以后有什么外部文件是否可以放在你自己博客一份作为备份链接
    还有哪里有 sudo wget http://node-arm.herokuapp.com/node_latest_armhf.deb
    下载

    bash https://sumju.net/motioneye.sh)
    脚本存在问题
    修复方法
    wget https://sumju.net/motioneye.sh
    vi motioneye.sh //将第3行sudo apt-get -y install moiton修改为sudo apt-get -y install motion
    bash motioneye.sh
    继续执行下一步

  4. 大神您好,首先十分十分感谢您可以提供如此之多教程,我是之前安装了您集成了N多内容的docker镜像。然后根据视频教程,我把家里的“联想看家宝”接入进了 motioneye中,同时也可以显示。只是我用的是RTMP的协议地址,不知道这个后期会不会有问题。
    但是现在在homeassistant中,只能看到视频一直都是处于待机状,点开后也不能出现视频流,不知道这个该如何解决。
    另外在homekit中也没有发现摄像头,我不知道是不是需要我按照您的教程再执行一次脚本,还是我本身的设置上存在问题。
    再一次的感谢您!!!

      1. 感谢大神的回复,因为我安装的是您的集成所有插件的镜像,里面的通知是包含了直接使用homekit添加摄像头的。但是我在添加了摄像头之后,在motioneye 和 homeassistant中都可以看到正常的画面,并且homeassistant和homekit移动侦测也可用,可就是在homekit中查找不到摄像头。 然后我按照教程中又从新执行了一遍bash https://sumju.net/hap-nodejs.sh)命令,还是没有用,所以求助大神是有什么问题吗?

        homekit:
        entity_config:
        media_player.mpd:
        feature_list:
        – feature: on_off
        – feature: play_pause
        – feature: play_stop
        – feature: toggle_mute

        media_player:
        – platform: mpd
        host: 127.0.0.1

        recorder:
        purge_keep_days: 30

        panel_iframe:
        configurator:
        title: Configurator
        icon: mdi:wrench
        url: http://itcommander.local:3218/
        nodered:
        title: ‘NodeRed’
        icon: ‘mdi:sitemap’
        url: http://itcommander.local:1880
        motioneye:
        title: ‘MotionEye’
        icon: ‘mdi:camera-wireless’
        url: http://itcommander.local:8765
        esphome:
        title: ‘ESPHome’
        icon: ‘mdi:chip’
        url: http://itcommander.local:6052
        mopidy:
        title: ‘Music’
        icon: ‘mdi:music-box-outline’
        url: http://itcommander.local:6680/iris
        iobroker:
        title: ‘IOBroker’
        icon: ‘mdi:directions-fork’
        url: http://itcommander.local:8181

        camera:
        – platform: generic
        name: 摄像头  
        still_image_url: http://127.0.0.1:8765/picture/1/current/
        stream_source: http://127.0.0.1:8081

        binary_sensor:
        – platform: ffmpeg_motion
        input: http://127.0.0.1:8081
        changes: 2
        name: 移动侦测
        以上是我的configuration.yaml 设置,这都是您原来的,我没有做过改动。

        求大神解惑,十分十分感谢

          1. 非常非常感谢您的回复,但是我就是在苹果家庭中搜索新设备没有弹出任何新的设备呀,所以不知道是哪里的问题哦😭

  5. 我按照第一步安装了 可是在motioneye的camera type设置界面只有 remote motionEye Camera 和Simple MJPEG Camera,没有 没有local camera选项

      1. 谢谢 我本来是安装了你的镜像 但是开始看视屏之前没注意到已经安装了对应的包,还是按照第一步的动作安装了 bash。后来就无法打开了,像这种情况有什么办法可以还原吗?还是必须需要重新刷一遍镜像?谢谢。另外,这里还有个很困扰的问题。就是镜像的刷机方法还是u盘制作启动器后直接插入斐讯的盒子里吗?没有看到过在装好镜像后的系统安装方法,不知道思路是否正确?谢谢!!!

发表回复

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据