Foscam Recording During Away Mode Only Using Pan/Tilt/Zoom Control and Motion Detection

This requires a Foscam IP Camera camera with PTZ (Pan, Tilt, Zoom) and CGI functionality (Source)

Foscam Cameras can be controlled by Home Assistant through a number of CGI commands. The following outlines examples of the switch, services, and scripts required to move between 2 preset destinations while controlling motion detection, but many other options of movement are provided in the Foscam CGI User Guide linked above.

The switch.foscam_motion will control whether the motion detection is on or off. This switch supports statecmd, which checks the current state of motion detection.

这需要具有PTZ(平移,倾斜,缩放)和CGI功能(源)的Foscam IP摄像机摄像头

Foscam相机可以由Home Assistant通过多个CGI命令来控制。 以下概述了在切换,服务和脚本控制运动检测时需要两个预设目的地的示例,但是在上面链接的Foscam CGI用户指南中还提供了许多其他运动选项。

switch.foscam_motion 将控制运动检测是否打开或关闭。 此开关支持 statecmd ,它检查运动检测的当前状态。

# Replace admin and password with an "Admin" privileged Foscam user
# Replace ipaddress with the local IP address of your Foscam
switch:
 platform: command_line
 switches:
   #Switch for Foscam Motion Detection
   foscam_motion:
     command_on: 'curl -k "https://ipaddress:443/cgi-bin/CGIProxy.fcgi?cmd=setMotionDetectConfig&isEnable=1&usr=admin&pwd=password"'
     command_off: 'curl -k "https://ipaddress:443/cgi-bin/CGIProxy.fcgi?cmd=setMotionDetectConfig&isEnable=0&usr=admin&pwd=password"'
     command_state: 'curl -k --silent "https://ipaddress:443/cgi-bin/CGIProxy.fcgi?cmd=getMotionDetectConfig&usr=admin&pwd=password" | grep -oP "(?<=isEnable>).*?(?=</isEnable>)"'
     value_template: '{{ value == "1" }}'

The service shell_command.foscam_turn_off sets the camera to point down and away to indicate it is not recording, and shell_command.foscam_turn_on sets the camera to point where I’d like to record. h of these services require preset points to be added to your camera. See source above for additional information.

shell_command.foscam_turn_off 服务设置相机指向并指示不录像,而 shell_command.foscam_turn_on 将相机设置为指向我要录像的位置。 这些服务的需要将预设点添加到您的相机。 有关其他信息,请参阅以上资料。

shell_command:
  #Created a preset point in Foscam Web Interface named Off which essentially points the camera down and away
  foscam_turn_off: 'curl -k "https://ipaddress:443/cgi-bin/CGIProxy.fcgi?cmd=ptzGotoPresetPoint&name=Off&usr=admin&pwd=password"'
  #Created a preset point in Foscam Web Interface named Main which points in the direction I would like to record
  foscam_turn_on: 'curl -k "https://ipaddress:443/cgi-bin/CGIProxy.fcgi?cmd=ptzGotoPresetPoint&name=Main&usr=admin&pwd=password"'

The script.foscam_off and script.foscam_on can be used to set the motion detection appropriately, and then move the camera. These scripts can be called as part of an automation with device_tracker triggers to set home and not_home modes for your Foscam and disable motion detection recording while home.

可以使用 script.foscam_offscript.foscam_on 来适当地设置运动检测,然后移动相机。 这些脚本可以作为自动化的一部分,使用 device_tracker 触发器来设置Foscam的 homenot_home 模式,并在 home 模式禁用运动检测记录。  

script:
 foscam_off:
   sequence:
   - service: switch.turn_off
     data:
       entity_id: switch.foscam_motion
   - service: shell_command.foscam_turn_off
 foscam_on:
   sequence:
   - service: switch.turn_off
     data:
       entity_id: switch.foscam_motion
   - service: shell_command.foscam_turn_on
   - service: switch.turn_on
     data:
       entity_id: switch.foscam_motion

To automate Foscam being set to “on” (facing the correct way with motion sensor on), I used the following simple automation:

为了使Foscam自动化设置为“开”(面向运动传感器的正确方式),我使用以下简单的自动化:

automation:
  - alias: Set Foscam to Away Mode when I leave home
    trigger:
      platform: state
      entity_id: group.family
      from: 'home'
    action:
      service: script.foscam_on
  - alias: Set Foscam to Home Mode when I arrive Home
    trigger:
      platform: state
      entity_id: group.family
      to: 'home'
    action:
      service: script.foscam_off

转载于:https://my.oschina.net/u/3379895/blog/1057678

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
智慧校园信息化系统解决方案旨在通过先进的信息技术,实现教育的全方位创新和优质资源的普及共享。该方案依据国家和地方政策背景,如教育部《教育信息化“十三五”规划》和《教育信息化十年发展规划》,以信息技术的革命性影响为指导,推进教育信息化建设,实现教育思想和方法的创新。 技术发展为智慧校园建设提供了强有力的支撑。方案涵盖了互连互通、优质资源共享、宽带网络、移动APP、电子书包、电子教学白板、3D打印、VR虚拟教学等技术应用,以及大数据和云计算技术,提升了教学数据记录和分析水平。此外,教育资源公共服务平台、教育管理公共服务平台等平台建设,进一步提高了教学、管控的效率。 智慧校园系统由智慧教学、智慧管控和智慧办公三大部分组成,各自具有丰富的应用场景。智慧教学包括微课、公开课、精品课等教学资源的整合和共享,支持在线编辑、录播资源、教学分析等功能。智慧管控则通过平安校园、可视对讲、紧急求助、视频监控等手段,保障校园安全。智慧办公则利用远程视讯、无纸化会议、数字会议等技术,提高行政效率和会议质量。 教育录播系统作为智慧校园的重要组成部分,提供了一套满足学校和教育局需求的解决方案。它包括标准课室、微格课室、精品课室等,通过自动五机位方案、高保真音频采集、一键式录课等功能,实现了优质教学资源的录制和共享。此外,录播系统还包括互动教学、录播班班通、教育中控、校园广播等应用,促进了教育资源的均衡化发展。 智慧办公的另一重点是无纸化会议和数字会议系统的建设,它们通过高效的文件管理、会议文件保密处理、本地会议的音频传输和摄像跟踪等功能,实现了会议的高效化和集中管控。这些系统不仅提高了会议的效率和质量,还通过一键管控、无线管控等设计,简化了操作流程,使得会议更加便捷和环保。 总之,智慧校园信息化系统解决方案通过整合先进的信息技术和教学资源,不仅提升了教育质量和管理效率,还为实现教育均衡化和资源共享提供了有力支持,推动了教育现代化的进程。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值