How do I set up reasonable video surveillance?

I’ve got a couple of Tapo C200 cameras up and running. They stream nicely to HA, so I can see the video in Lovelace. I’m even able to use the cameras as motion sensors.

Now what do I need in order to turn this into a proper home security surveillance thing?

  • some switch to arm / disarm the surveillance
  • when armed; if motion detected, start recording.
  • simultaneously start uploading the clip to (some cloud)
  • notify on phone(s), preferably with a still frame from the triggered camera
  • (ideally) replicate the original Tapo feature of having the camera track the moving object

Is there ready to go solution like this?

I don’t believe HASS has a NVR. However, I run HASS on a Synology NAS and Synology has an excellent NVR.

https://www.synology.com/en-us/surveillance

That one is standard in Addon store.

And i read on several places about people using Frigate as an addon.

+100 for Frigate, but I would probably setup on a dedicated machine if attempting to use more than a couple cameras.

As others said, you need an NVR (in software or a dedicated hardware NVR). I would not run it as an addon on HAOS though. That would mean if HAOS goes down or won’t reboot after an update (happens often enough), then your entire surveillance system is down until you fix HA. Either use a separate device entirely dedicated to video surveillance (that’s what I do) or run a software NVR like BlueIris as an independent VM or container that won’t restart if HA does.

I use zoneminder, running on another machine, with zmeventnotification, an AI capability to do object detection. ZMeventntofication is used to identify cars, people and some animals. When any of these are detected I use an add-on associated with zmeventnotification to FTP the pictures to HA, making objects tagged pictures available in HA. This uses the HA FTP add-on receive the pictures. Both ZM and HA access the video streams, so I can pull up a live feed in either system. I also use aqara motion and contact sensors with HA’s alarm panel to provide security system functionality in HA. When motion or contact sensors detect an alarm event I grab snapshots with the camera’s on HA and email a picture to whoever is monitoring the house via an automation. I also use twilio to send send an SMS to whoever is watching the place. For each camera I can also pull up the last 15 tagged ZM photos in HA. I use the HACS gallery card to present the ZM tagged photo’s. Here’s a shot of the gallery card for one camera:

This shows accessing one of the camera’s using HA:

Here’s a shot from ZM showing the event interface to look at all detected activity:

An example of my automation and associated scripts called when alarm system is activated and motion is detected

alias: picture on motion
trigger:
  - entity_id: binary_sensor.basement_finished_motion_aq2
    platform: state
    to: "on"
action:
  - service: script.capture_pic_seq
    data_template:
      evEntity: camera.basement_camera
      evPath: /config/www/images/basement_finished/
      evTimeTag: "{{ states('sensor.date') }}-{{ states('sensor.time') }}"
  - condition: template
    value_template: "{{ states.alarm_control_panel.home_alarm.state != 'disarmed' }}"
  - service: notify.sendtsms
    data_template:
      title: House Alarm
      message: >-
        Motion Detected in basement {{ states('sensor.date_time') }} so check
        email
      target:
        - "+1xxxxxxxxxx"
  - service: script.send_pic_seq
    data: {}

The sendtsms uses twillio to send me a message telling whoever is monitoring that event happened.

associated script, this is script.capture_pic_seq:

sequence:
  - service: camera.snapshot
    data_template:
      entity_id: "{{ evEntity }}"
      filename: "{{ evPath}}{{ evTimeTag }}-1.jpg"
  - service: shell_command.save_file
    data_template:
      fileName: "{{ evPath}}{{ evTimeTag }}-1.jpg"
  - condition: template
    value_template: "{{ states('input_number.pic_count') |int  > 1 }}"
  - service: camera.snapshot
    data_template:
      entity_id: "{{ evEntity }}"
      filename: "{{ evPath}}{{ evTimeTag }}-2.jpg"
  - condition: template
    value_template: "{{ states('input_number.pic_count') |int  > 2 }}"
  - service: camera.snapshot
    data_template:
      entity_id: "{{ evEntity }}"
      filename: "{{ evPath}}{{ evTimeTag }}-3.jpg"
  - condition: template
    value_template: "{{ states('input_number.pic_count') |int  > 3 }}"
  - service: camera.snapshot
    data_template:
      entity_id: "{{ evEntity }}"
      filename: "{{ evPath}}{{ evTimeTag }}-4.jpg"
  - condition: template
    value_template: "{{ states('input_number.pic_count') |int  > 4 }}"
  - service: camera.snapshot
    data_template:
      entity_id: "{{ evEntity }}"
      filename: "{{ evPath}}{{ evTimeTag }}-5.jpg"
  - condition: template
    value_template: "{{ states('input_number.pic_count') |int  > 5 }}"
  - service: camera.snapshot
    data_template:
      entity_id: "{{ evEntity }}"
      filename: "{{ evPath}}{{ evTimeTag }}-6.jpg"
  - condition: template
    value_template: "{{ states('input_number.pic_count') |int  > 6 }}"
  - service: camera.snapshot
    data_template:
      entity_id: "{{ evEntity }}"
      filename: "{{ evPath}}{{ evTimeTag }}-7.jpg"
  - condition: template
    value_template: "{{ states('input_number.pic_count') |int  > 7 }}"
  - service: camera.snapshot
    data_template:
      entity_id: "{{ evEntity }}"
      filename: "{{ evPath}}{{ evTimeTag }}-8.jpg"
  - condition: template
    value_template: "{{ states('input_number.pic_count') |int  > 8 }}"
  - service: camera.snapshot
    data_template:
      entity_id: "{{ evEntity }}"
      filename: "{{ evPath}}{{ evTimeTag }}-9.jpg"
  - condition: template
    value_template: "{{ states('input_number.pic_count') |int  > 9 }}"
  - service: camera.snapshot
    data_template:
      entity_id: "{{ evEntity }}"
      filename: "{{ evPath}}{{ evTimeTag }}-10.jpg"
alias: ""
mode: single

And script.send_pic_seq

sequence:
  - service: notify.sendemail
    data:
      title: Motion Detection
      message: Alarm armed in basement {{ states('sensor.date_time') }}
      data:
        images:
          - /config/www/images/outbound/photo1.jpg
alias: ""
mode: single

Added configuration in configuration.yaml to make notifications work:

twilio:
    account_sid: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    auth_token: XXXXXXXXXXXXXXXXXXXXXXXXXX


notify:
  - name: sendemail
    platform: smtp
    server: smtp.mail.yahoo.com
    port: 587
    timeout: 15
    sender: [email protected]
    starttls: true
    username: [email protected]
    password: !secret yahoo_password
    sender_name: Home Assistant
    recipient:
      - [email protected]

  - name: sendtsms
    platform: twilio_sms
    from_number: '+1xxxxxxxxxx'

I probably need to convert some things to blueprints, but this was done well before that was an option.

1 Like

Frigate eats cpu unless you have a coral…UNLESS you set detection to something reasonably low and basically set it up to record only. In this case its uses virtually no resources other than disk space

Detection means the object recognition.

Record only is not a feature but its possible to basically set it to basically never trigger a detection and never look

motionEye looks very promising! I’ll give it a whirl.