Custom Home Assistant integration that talks to SecuritySpy (v5 and v6) over its local web API.
- Watches the live
++eventStreamfor motion, AI classify (human/vehicle/animal), arm/disarm, and online/offline. - Exposes cameras, switches, sensors, event entities, and PTZ buttons.
- Provides services to arm modes, set schedules/overrides, trigger motion, and download the latest motion clip.
Domain: secspy (avoids clashing with older HACS securityspy integrations).
Uses the aiosecspy Python client (installed automatically via the integration manifest.json requirements).
- Add this repository as a custom repository (Integration) in HACS, or install once published.
- Restart Home Assistant.
- Settings → Devices & Services → Add Integration → SecuritySpy.
- Enter host, port, username, password. Enable HTTPS / SSL verify as needed.
Requires SecuritySpy 5.3.4+ (6.x supported). Use an admin web user.
Per camera device:
| Platform | Entities |
|---|---|
binary_sensor |
Motion (on until MOTION_END), Online |
event |
Classification (human / vehicle / animal), Trigger (motion / action) |
sensor |
Detected object + scores, armed state for motion/continuous/actions |
switch |
Arm motion, Arm actions, Arm continuous |
camera |
Snapshot + RTSP (or MJPEG if RTSP disabled in options) |
button |
PTZ controls / presets when the camera supports them |
The server device carries a diagnostic Event stream connectivity sensor; camera entities stay available across brief stream reconnects, so alert on that sensor if you want to know about outages.
Also fires bus events: secspy_event with type, camera_number, camera_name, trigger_reasons, and event_score_human / event_score_vehicle / event_score_animal.
Sticky motion binary sensor
automation:
- alias: Porch motion lights
triggers:
- trigger: state
entity_id: binary_sensor.porch_motion
to: "on"
actions:
- action: light.turn_on
target:
entity_id: light.porchAI human classify (event entity)
automation:
- alias: Human at door
triggers:
- trigger: state
entity_id: event.door_classification
conditions:
- condition: template
value_template: "{{ trigger.to_state.attributes.event_type == 'human' }}"
actions:
- action: notify.mobile_app
data:
message: "Human at the door"Bus event (power users)
automation:
- alias: Any SecuritySpy trigger
triggers:
- trigger: event
event_type: secspy_event
event_data:
type: TRIGGER_M
actions:
- action: persistent_notification.create
data:
message: "Motion on camera {{ trigger.event.data.camera_number }}"| Service | Purpose |
|---|---|
secspy.set_arm_mode |
Arm/disarm continuous / on_motion / action |
secspy.trigger_motion |
++triggermd |
secspy.set_schedule |
Mode C/M/A/X + schedule id |
secspy.set_schedule_override |
Mode + override id |
secspy.enable_schedule_preset |
Server-wide preset |
secspy.download_latest_motion_recording |
Save latest motion clip to a HA path |
Pass any entity belonging to the camera (for example the camera entity or motion binary sensor) as entity_id.
- Disable RTSP — the default. HA proxies the camera's MJPEG (
++video) stream itself, so no credential-bearing URL ever reaches your frontend. Turn it off to hand the raw RTSP URL (credentials in userinfo) to your stream player instead. - Minimum AI classify score — threshold for classify event entity firings (default 50). The
detected_objectsensor and motion attributes always show the raw scores regardless of this threshold.
Cameras added to SecuritySpy after setup appear automatically: the stream's CONFIGCHANGE refresh re-reads the camera list and the integration creates entities for newcomers without a reload.
- Config flow connects (HTTP and HTTPS).
- Cameras appear with correct names; online binary sensor tracks ONLINE/OFFLINE.
- Motion binary sensor turns on for
TRIGGER_Mand off forMOTION_END. - Classify event entity fires with human/vehicle/animal scores.
- Arm switches toggle modes; continuous falls back to schedule when soft toggle 404s.
-
set_schedule/set_schedule_override/enable_schedule_presetsucceed. - Camera snapshot works; RTSP or MJPEG stream loads.
- PTZ buttons appear only when capabilities are present.
-
download_latest_motion_recordingwrites a file.
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
# Library development lives in https://github.com/TwitchCaptain/aiosecspyMIT — see LICENSE.