『瀚思彼岸』» 智能家居技术论坛

 找回密码
 立即注册
楼主: ghostist

[经验分享] 让你的小方/大方摄像头在HA里彻底不卡

[复制链接]

1

主题

172

帖子

2140

积分

金牌会员

Rank: 6Rank: 6

积分
2140
金钱
1968
HASS币
0
发表于 2019-3-26 11:48:00 | 显示全部楼层
ghostist 发表于 2019-3-26 11:08
本地用VLC播放器看一下能否播rtsp

地址没问题,VLC可以播
回复

使用道具 举报

0

主题

53

帖子

297

积分

中级会员

Rank: 3Rank: 3

积分
297
金钱
244
HASS币
0
发表于 2019-3-26 22:51:39 | 显示全部楼层
谢谢LZ,确实快了很多!
回复

使用道具 举报

5

主题

123

帖子

750

积分

高级会员

Rank: 4

积分
750
金钱
627
HASS币
0
发表于 2019-3-29 02:20:41 | 显示全部楼层
通常的海康rtsp可以用吗,如果可以的话,still_image_url:填什么?
回复

使用道具 举报

5

主题

89

帖子

461

积分

中级会员

Rank: 3Rank: 3

积分
461
金钱
372
HASS币
0
发表于 2019-3-30 21:26:39 | 显示全部楼层
楼主!设置了这个后,提示安装av==6.1.2失败!怎么解决

Unable to install package av==6.1.2: Failed building wheel for av
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-7jdnba2_/av/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-zcl2sifj/install-record.txt --single-version-externally-managed --prefix  --compile --user --prefix=" failed with error code 1 in /tmp/pip-install-7jdnba2_/av/
2019-03-30 21:26:14 ERROR (MainThread) [homeassistant.requirements] Not initializing stream because could not install requirement av==6.1.2
2019-03-30 21:26:14 ERROR (MainThread) [homeassistant.setup] Setup failed for stream: Could not install all requirements.
回复

使用道具 举报

21

主题

188

帖子

1481

积分

金牌会员

Rank: 6Rank: 6

积分
1481
金钱
1288
HASS币
60
发表于 2019-4-15 05:51:57 | 显示全部楼层
本帖最后由 chiunownow 于 2019-4-15 05:55 编辑

感谢,已经用上了。附上一段我的摄像头额外配置,算是做一点小参考

timer:
  motion_record_disable:
    duration: '00:00:30'

shell_command:
  rclone_sync_dafang_onedrive: rclone sync /home/chiunownow/DCIM/ dafang-onedriveAFANG-CAM

group:
  motion_record:
    name: 动作记录
    icon: mdi:camera-enhance
    entities:
      - automation.motion_record_20s
      - automation.motion_snapshot

automation:
  - alias: motion_record_20s
    trigger:
      entity_id: binary_sensor.dafang_motion_sensor
      platform: state
      from: 'off'
      to: 'on'
    condition:
      - condition: state
        entity_id: timer.motion_record_disable
        state: 'idle'
    action:
      - service: script.toggle
        entity_id: script.motion_record_v2
      - delay: 00:00:40
      - service: shell_command.rclone_sync_dafang_onedrive

  - alias: motion_snapshot
    trigger:
      entity_id: binary_sensor.dafang_motion_sensor
      platform: state
      from: 'off'
      to: 'on'
    action:
      - service: timer.start
        entity_id: timer.motion_record_disable
      - service: camera.snapshot
        data:
          entity_id: camera.dafangcgi
          filename: "/home/chiunownow/DCIM/Picture/{{ now().strftime('%y%m%d-%H%M%S') }}.jpg"

  - alias: turn_on_motion_record
    trigger:
      entity_id: group.device_tracker
      platform: state
      from: 'home'
      to: 'not_home'
      for: 
        minutes: 5
    action:
      - service: homeassistant.turn_on
        entity_id: group.motion_record
      - data:
          message: 监测到屋主不在家,打开动作记录
        service: notify.ios_nownows_iphone

  - alias: turn_off_motion_record
    trigger:
      entity_id: group.device_tracker
      platform: state
      from: 'not_home'
      to: 'home'
    action:
      - service: homeassistant.turn_off
        entity_id: group.motion_record
      - data:
          message: 监测到屋主到家,关闭动作记录
        service: notify.ios_nownows_iphone

script:
  motion_record_v2:
    sequence:
      - service: camera.record
        data_template:
          entity_id: camera.dafang3
          filename: "/home/chiunownow/DCIM/Video/{{ now().strftime('%y%m%d-%H%M%S') }}.mp4"
          duration: "20"
          lookback: "10"

ha监测到大方的动作传感器off-on时,录视频+快照,通过 rclone 同步到 OneDrive,再用 ifttt 监测 OneDrive 的图片和视频文件夹,新增文件时推送到 telegram

回复

使用道具 举报

1

主题

72

帖子

277

积分

中级会员

Rank: 3Rank: 3

积分
277
金钱
205
HASS币
0
发表于 2019-5-22 15:30:57 | 显示全部楼层
原先RSTP卡,现在用图片一秒获取一次
回复

使用道具 举报

5

主题

340

帖子

1275

积分

金牌会员

Rank: 6Rank: 6

积分
1275
金钱
935
HASS币
0
发表于 2019-5-22 20:08:29 | 显示全部楼层

厉害厉害,学习了!
回复

使用道具 举报

39

主题

2058

帖子

7727

积分

元老级技术达人

积分
7727
金钱
5654
HASS币
110
 楼主| 发表于 2019-5-23 08:37:08 | 显示全部楼层
rexchen 发表于 2019-5-22 15:30
原先RSTP卡,现在用图片一秒获取一次

新特性允许点开进去直接看流媒体
0.92以上版本应该可以在页面默认集成流媒体 不用再点开(我没更新到这个版本)
回复

使用道具 举报

0

主题

45

帖子

152

积分

注册会员

Rank: 2

积分
152
金钱
107
HASS币
0
发表于 2020-1-13 17:52:56 | 显示全部楼层
chiunownow 发表于 2019-4-15 05:51
[md]

感谢,已经用上了。附上一段我的摄像头额外配置,算是做一点小参考

这个是在那个文件里配置的
回复

使用道具 举报

0

主题

16

帖子

93

积分

注册会员

Rank: 2

积分
93
金钱
77
HASS币
0
发表于 2020-3-15 13:11:11 | 显示全部楼层
tom663 发表于 2019-3-30 21:26
楼主!设置了这个后,提示安装av==6.1.2失败!怎么解决

Unable to install package av==6.1.2: Failed b ...

我也是,解决了吗
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-5-8 05:51 , Processed in 0.354764 second(s), 30 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表