Send Synology Surveillance motion events to HA switch

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

I’ve been trying to get this working, where do i find the correct “ID:” to enter? Also in the automations.yaml should the first line be

-alias: 'Porch Camera Motion" 192.168.0.133

As an example?

Disregard, i got it working. Thanks for you guys working this out. I have it working well with my Synology Surveillance Station and reolink cameras. Well Done.

Glad you got it working. :smile:

@FlyersPh9 I am getting stuck on the “edited” version of the blueprint. I can change the value but but then it’s showing I have “unknown tag !<!input>” errors throughout the blueprint. Did you change any thing else on this blueprint?

Anyway someone can share the entire .yaml for this?

Did you download the original version of the blueprint, create a renamed copy and edit that one line?

I think my issue may have been the auth_providers line where I placed my Synology as a trusted user. I’ve never set up auth_providers before this and I believe that line ended up locking me out of my Home Assistant when I rebooted.

@xbmcnut @FlyersPh9 is there a way to make these notifications clickable to where they take you directly to a Lovelace Camera dashboard?

Nevermind I was able to figure it out! Thanks for everyone’s help on this!

please help me!



test send - test no connect

As it’s an internal IP, try using HTTP?

Thank you all for getting me in the right direction.

I’ve one weird problem…

I’m sending snapshots from two of my Synology camera’s to HA when motion is detected, without any problem.

But from that moment on I can’t access my internal ha anymore at http://192.168.0.5:8123 from my PC.

I still can get in my instance with the app, but for sure I need to be able to use my PC…

I must say, I didn’t made a boolean. But I can’t see how this would change my problem.

Thanks in advance.

Probably need a lot more info but have you tried from a mobile browser after the lock-out? Is it possible your PC’s IP address is being auto-blocked by HA?