Send Synology Surveillance motion events to HA switch

Hi

thanks for all this great info, i am trying to implement also, i use NodeRed and have some basic understanding

I just want NodeRed to be sent the motion event so i can trigger some lights

Can someone assist me setting up the event part between HA and nodeREd? @WhichWayWazzit

Can you please explain in a little more detail what you’re trying to achieve?

So the consensus is that there is no easy way to do this using https and no nabucasa?

Should be no issue with a valid certificate

Do you mind explaining how that would work?

With a webhook url for example

Do you know the webhook congif required? I’m not sure what URL to use…

There is no static url, you need to point your webhook url to the one you create as an automation …

Look on this page, in section: webhook trigger…

Thanks! I think I have it figured out.

Anyone care to suggest what sort of latency they are seeing from this? I’m looking into putting some cameras in the hallway of my house and currently use a motion sensor to trigger lighting at night. Would this be a fast enough replacement, or would you get most of the way down a hallway before HA even got the motion detection event?

Understand its going to be camera dependent, but a general idea would be good.

This is pretty fast in my experience, <2s. If you use a Hikvision camera though, HA have native integration for the cameras integrated sensors including motion, line cross and intrusion detection (which I also use), that may be a little faster and be easier to integrate?

OK that sounds interesting, I was actually looking at Hikvision so that might be a better option.

I currently have two types of motion sensors, one hardwired Ness units (painful to run new cabling in the roof for them though) and they are <100ms so pretty great, and Ikea Zigbee ones which are about 500ms or more. 2s sounds like much too much, I’d get most of the way down the hall and/or fall over something in the dark at that point.

I am running into some issues and am unsure where exactly. I’ll recap the steps I took:

  1. Updated configuration.yaml to contain:
homeassistant:
  auth_providers:
  - type: trusted_networks
    trusted_networks:
      - 10.0.1.xx #This is my NAS IP
  1. Updated automations.yaml to contain:
- alias: 'Porch Camera Motion' ## http://10.0.1.56:8123/api/webhook/motion_porch ##
  hide_entity: true
  trigger:
    - platform: webhook
      webhook_id: home_porch_motion
  action:
    - service: camera.snapshot
      data:
          entity_id: camera.home_porch
          filename: '/config/www/snapshot-porch.jpg'
    - service: script.turn_on
      entity_id: script.snapshot_porch_camera
  1. Updated scripts.yaml to contain:
snapshot_porch_camera:
  alias: Trigger input boolean for motion from API
  sequence:
    - service: input_boolean.turn_on
      entity_id: input_boolean.home_porch_motion
    - delay: 00:00:05
    - service: input_boolean.turn_off
      entity_id: input_boolean.home_porch_motion

Now here is where I am getting confused. I’ve installed this blueprint (📸 Send camera snapshot notification on motion) and it needs a binary_sensor to trigger the automation. What do I feed into the motion sensor field in this blueprint from all of this above? I thought it would be input_boolean.home_porch_motion but that doesn’t seem to be an entity? Did I miss a step? Forgive me, I am very new to Home Assistant.

The blueprint is expecting a binary_sensor as that’s the way it was designed. What cameras are you using?

You could also edit the blueprint here config\blueprints\automation\vorion\send-camera-snapshot-notification-on-motion.yaml (create a copy) and change the motion sensor domain to input_boolean?

blueprint:
  name: Send a camera snapshot when motion is detected
  description: 'This automation blueprint creates a camera snapshot if motion is detected  and
    sends a notification to your phone with the picture.

    '
  domain: automation
  input:
    motion_sensor:
      name: Motion sensor
      description: The sensor which triggers the snapshot creation
      selector:
        entity:
          domain: input_boolean
          device_class: motion

Thank you for the quick response!

With this modified blueprint, I would fill input_boolean.home_porch_motion for motion sensor? I see that entity listed in scripts.yaml but not mentioned anywhere else. That entity is not showing up in HA for me. Did I miss the instructions to create that entity?

Yep, you need to make sure you have that entity first.

Thank you, I just got it working! :pray: Here’s an updated guide of what I did:

  1. In configuration.yaml add these 2 pieces:
homeassistant:
  auth_providers:
  - type: trusted_networks
    trusted_networks:
      - 192.168.1.26   # You Synology Surveillance Station IP

input_boolean:
  home_porch_motion:
    name: Porch camera motion
    icon: mdi:cctv
  1. In automations.yaml add the following. Pay attention to the webhook URL and ID.:
- alias: 'Porch Camera Motion'   # For reference, paste your webhook URL that you setup in Synology here: http://192.168.1.56:8123/api/webhook/motion_porch
  trigger:
    - platform: webhook
      webhook_id: motion_porch
  action:
    - service: camera.snapshot
      data:
          entity_id: camera.home_porch
          filename: '/config/www/snapshot-porch.jpg'
    - service: input_boolean.turn_on
      entity_id: input_boolean.home_porch_motion
    - delay: 00:00:05
    - service: input_boolean.turn_off
      entity_id: input_boolean.home_porch_motion
  id: 534b021d797b4db29c9ceabefec0bbc6
  1. In Synology Surveillance Station, open Action Rules and enter these settings. In the third picture it says Action 2, if you are just setting this up you will only have Action 1:



  2. Use @xbmcnut’s modified blueprint in this post: Send Synology Surveillance motion events to HA switch.

At the end of it all, you should be able to test it by clicking Test Send within the Action Rule app. Thanks everyone!

2 Likes

Awesome, well done. If you want to keep things tidy, you could just add the following into your action items without using the script. I only used a script as I had another action after this code that I didn’t want affected by the delay but you don’t need that.

    - service: input_boolean.turn_on
      entity_id: input_boolean.home_porch_motion
    - delay: 00:00:05
    - service: input_boolean.turn_off
      entity_id: input_boolean.home_porch_motion

Just tried it out, you are correct! I will update my previous post. Thanks again, I really appreciate how this community helps beginners.

2 Likes