# Analytics snippet placeholder — HearthNodes (gatherer.top) # Paste the measurement snippet here (server.js inlines any content that contains # a markup tag into on every page). No GA4 property is assigned to this # site yet, so leave this file as comments only and the build emits no tracking # code.
HearthNodesgatherer.top 已发布 27/28 EN 中文

包裹看护:门廊事件触发 40 秒片段,不做连续录制

门廊摄像头仅在信箱或门廊门磁开启时录制,生成 40 秒片段(含 10 秒预录),并向家人推送一张静帧。无事件期间摄像头处于低功耗状态,没有视频流,也没有云端会话。

协议 · wifi 延迟 · 3000 ms 供电 · poe 发布 · 2026-10-23 3 devices
自动化 YAML safety-package-mailbox-watch.yaml
# HearthNodes recipe 27 - package watch
alias: "Safety - porch event records 40 seconds"
id: hn_safety_package_watch
description: "Mailbox or porch event -> 40 s clip with 10 s pre-roll, still pushed"
mode: queued
max_exceeded: 3

trigger:
  - platform: state
    entity_id: binary_sensor.mailbox_contact
    to: "on"
    id: mailbox
  - platform: state
    entity_id: binary_sensor.porch_presence
    to: "on"
    for: "00:00:02"
    id: porch_person

variables:
  camera: camera.porch
  clip_seconds: 40
  pre_roll_seconds: 10
  nvr: sensor.nvr_free_space_gb

condition:
  - condition: numeric_state
    entity_id: sensor.nvr_free_space_gb
    above: 5
  - condition: state
    entity_id: binary_sensor.porch_recording
    state: "off"
  - condition: state
    entity_id: input_boolean.delivery_mode
    state: "off"

action:
  - service: camera.record
    target:
      entity_id: "{{ camera }}"
    data:
      duration: "{{ clip_seconds }}"
      lookback: "{{ pre_roll_seconds }}"
      filename: "/media/porch/{{ now().strftime('%Y%m%d-%H%M%S') }}.mp4"
  - service: camera.snapshot
    target:
      entity_id: "{{ camera }}"
    data:
      filename: "/media/porch/last_event.jpg"
  - service: notify.mobile_app_primary
    data:
      title: "Porch event"
      message: "{{ trigger.id }} - still attached, clip on the local recorder"
      data:
        image: "/media/local/porch/last_event.jpg"
  - service: light.turn_on
    target:
      entity_id: light.porch
    data:
      brightness_pct: 60
  - delay: "00:04:00"
  - service: light.turn_off
    target:
      entity_id: light.porch
  - service: input_boolean.turn_on
    target:
      entity_id: input_boolean.package_waiting

# The camera is event-recorded, never continuous, and the recorder has a 14 day
# retention with no outbound route. Disk full or recorder unreachable -> recording
# is skipped rather than silently becoming a cloud subscription.
触发器 · state

binary_sensor.mailbox_contact · binary_sensor.porch_presence

信箱门磁开启,或门廊存在检测检测到有人持续 2 秒以上。

包裹看护:门廊事件触发 40 秒片段,不做连续录制 topology

分步说明

  1. camera.porch录制 40 秒片段,并从摄像头的环形缓冲中取 10 秒预录,让片段从事件之前而不是之后开始。 record · 40 s · pre-roll 10 s
  2. notify.mobile_app只推送一张静帧而不是整段片段;一张静帧足以决定是否需要打开完整录像。 send · still image + 'porch event'
  3. light.porch门廊灯亮 60 % 持续 4 分钟,让片段可用,也让人能从窗口看到投递。 on 60 % for 4 min
  4. input_boolean.package_waiting设置「有包裹待取」布尔量供家人查看,并在当天结束时自动清除。 on · cleared by someone leaving and returning, or at 22:00
分步说明
一定要有预录

从触发点开始的片段会错过走上小径的人,往往也错过放下包裹的那只手。从环形缓冲取 10 秒预录,是「有用片段」与「一段空门廊」之间的差别。只有带缓冲的 PoE 或市电摄像头能做到。

按事件录制,不要连续录制

对公共人行道的连续录制会整天记录邻居的活动并保存下来,这既是隐私问题也是存储问题。以信箱门磁为主触发的事件录制,抓到的就是包裹,几乎别无其他。

推送静帧,而不是片段

推送 40 秒视频在手机上不方便看,而且在移动网络下经常失败。静帧能可靠送达,并回答了那一刻唯一重要的问题:台阶上有包裹吗?想看完整片段时它就在那里。

硬件

型号协议连接在本链路中的作用
PoE porch camera with a local ring buffer wifi 有线 PoE 供电与传输;电池摄像头无法提供 10 秒预录。
Mailbox contact sensor zigbee 无线 可用的最可靠投递信号;信箱盖开启比仅靠动作检测作为触发要准确得多。
Local NVR on an isolated VLAN wifi 有线 保存片段并保留 14 天;不上传任何内容,录像机没有外网出口路由。

失效时怎么办

如果本地录像机已满或不可达,录制直接跳过,而不是回退到云存储——磁盘满不该悄悄地变成一份订阅。如果信箱门磁失效,门廊存在传感器仍会触发录制,只是事件前窗口略短,同时发出维护通知点名失效的门磁。

同一触发源的配方

条款 仅供参考。这些配方会控制市电、水路与物理门禁。当地电气与给排水规范、熔断与隔离措施、以及每一处失效保护的实际测试,都需要你自己负责。本页内容不构成专业工程、法律或安全建议。