62 lines
2.0 KiB
YAML
62 lines
2.0 KiB
YAML
#:########################################################################################:#
|
|
# Package: CCTV Motion Feed
|
|
# File: cctv_controls.yaml
|
|
# Version: v1.2.0
|
|
# Date: 2026-08-06
|
|
#
|
|
# Purpose:
|
|
# Provides a Home Assistant binary sensor for front-door motion messages
|
|
# published by the external CCTV system over MQTT.
|
|
#
|
|
# Dependencies:
|
|
# - Home Assistant MQTT integration and broker connectivity.
|
|
# - An external CCTV publisher for the configured motion topic.
|
|
#
|
|
#
|
|
# Version History:
|
|
# - v1.2.0 (2026-08-06): Match MotionEye HA plugin ON/OFF MQTT payloads.
|
|
# - v1.1.0 (2026-07-24): Added explicit numeric ON/OFF payloads (P013-F039).
|
|
# - v1.0.0 (2022-10-11): Initial CCTV front-door motion sensor package.
|
|
#:########################################################################################:#
|
|
|
|
mqtt:
|
|
binary_sensor:
|
|
- unique_id: front_door_movement_camera_corner
|
|
name: "Front Door Movement"
|
|
state_topic: "viewroad-status/cctv/front_door_motion"
|
|
payload_on: "ON"
|
|
payload_off: "OFF"
|
|
icon: mdi:exit-run
|
|
|
|
input_datetime:
|
|
entranceway_last_detection:
|
|
name: Entranceway Last Detection
|
|
has_date: true
|
|
has_time: true
|
|
|
|
template:
|
|
- binary_sensor:
|
|
- name: Entranceway Detection
|
|
unique_id: entranceway_detection
|
|
state: >-
|
|
{{ is_state('binary_sensor.view_road_front_door_motion', 'on')
|
|
or is_state('binary_sensor.front_door_movement', 'on') }}
|
|
|
|
automation:
|
|
- id: entranceway_detection_last_seen
|
|
alias: Entranceway Detection - Record Last Activity
|
|
mode: restart
|
|
trigger:
|
|
- platform: state
|
|
entity_id: binary_sensor.view_road_front_door_motion
|
|
to: "on"
|
|
- platform: mqtt
|
|
topic: viewroad-status/cctv/front_door_motion
|
|
payload: "ON"
|
|
action:
|
|
- service: input_datetime.set_datetime
|
|
target:
|
|
entity_id: input_datetime.entranceway_last_detection
|
|
data:
|
|
datetime: "{{ now().strftime('%Y-%m-%d %H:%M:%S') }}"
|