Send Synology Surveillance motion events to HA switch

Amazing! Don’t suppose you’d mind sharing your Node-Red flow? What kind of latency do you get from this?

It’s pretty much instant as far as I can tell. Obviously limited by how quickly your camera signals the event and how loaded your system is, etc but it comes through very fast in my testing.

Here’s my node flow: click

1 Like

Thanks! You’ve just saved me heaps of headaches!

would you mind to explain in more details what a node.red is? Is this a service I need to install on the Synology?
How does it need to be configured?
This solution currently is not within my skills.
thx in advance

1 Like

Hi All! +1 for this - not sure what a node.red is…can you please expand on this?

Thanks a lot :slight_smile:

I don’t use it, but Home Assistant Community Add-on: Node-RED all the details are here.

Pleased to advise that the latest update of Surveillance Station (8.2.3-5828) fixes the Action Rules ability to send events to a webhoook URL in HA!! :slight_smile: How to do that is here Send Synology Surveillance motion events to HA switch

2 Likes

Is this still working for you? It’s recently broken for me.

I’ve done my best to document my findings here.

guys interesting thread, but i am also unable to fire a webhook from SS
as some screenshots above, where you create the action, i dont have “external device” i can choose only webhook
so i enter my nabucasa url there
but tried with post/get , nothing works, always test failed
if i test from SSH and the CURL - X POST https://xxx , then it works…

any idea?

Webhook is the correct action. ‘External Device’ is if you want to receive a request from HA to do something on your SS. I use this for PTZ control.

For Webhooks, you need to create a receiving automation inside HA though otherwise the request goes nowhere. Below is my SS action and part of the HA automation that receives the request. Use the LAN IP of your HA instance if both devices are on the same network.

  - alias: 'Webhook endpoint to entry motion' ## http://internal_ip-address-of-HA:8123/api/webhook/motion_entrance ##
    hide_entity: true
    trigger:
      - platform: webhook
        webhook_id: motion_entrance ## this is the only place you create the webhook ID ##
    action:
      - service: camera.snapshot
        data:
            entity_id: camera.proxy_entry
            filename: '/config/www/images/entry_cropped.jpg'
      - service: script.turn_on
        entity_id: script.trigger_ss_entrance_boolean

You can use the SS ‘Test Send’ button to see if it’s working.

Strange , I have the exact same thing… It also created a webhook url for nabucasa … That one is working when I do it with curl, but not with ss…

You are using the internal IP, that’s my goal also, and not the nabucasa one…

Strange that it works for you without authentication in that ss screenshot??? Or how did you configure that local ip addresses don’t need authentication?

I also see you are on http, I have https… Maybe it fails because of certificate… You are not using https? How did you configure http and https at the same time on same port?

dont understand why itt works for you

my code below
with the https string => test failed, also with 192.168.0.15 , in trusted network that one is synology
with the hooks.nabucasa.url => like : https://hooks.nabu.casa/gAAAAABdrKe3MJc … this doesnt work either => but this one works if i do like curl -x https://hooks.nabu.casa/gAAAAABdrKe3MJc

i have no idea why

    trusted_networks:
      - 192.168.0.15
- alias: 'Deurbell webhook SS' ## https://192.168.0.17:8123/api/webhook/deurbel
  hide_entity: true
  trigger:
    - platform: webhook
      webhook_id: deurbel
  action:
  - service: camera.snapshot
    data_template:
      entity_id: camera.deurbel
      filename: !secret snapshot_deurbel    
  - service: notify.html5
    data_template:
      message: "Er staat iemand aan de deur!"
      title: "Deurbel"
      target:       
        - !secret notify_html5_1      
      data:
        tag: alert
        image: !secret snapshot_buiten_deurbel_webhook
        vibrate:
          - 300
          - 100
          - 400
        renotify: 1 #(do not notify when replace message)/1(notify again)
        ttl: 86400
        priority: high
        url: !secret camera_url

I don’t have my local HA instance configured for https:// as I had all sorts of issues with TTS messages when SSL was enabled. It also complicates every single add-on so I elected to use Synology’s reverse proxy instead as that now supports custom_headers so it works natively with HA now.

My understanding is that you also don’t need SSL enabled if your using NabuCasa freeing up your local HA instance to run using http? Pretty sure I had issues with SSL too so that’s that reason I went the route I did.

yes, indeed, using nabucasa, but sometimes also https with port forwarding
nabu casa isnt always 100% reliable :slight_smile:

so back to http is a nogo for me , also because i have lots if other local curl commands already running on https, need to change them all then

so i need to use nabucasa then, so the https://hooks. string should normally work no ?

or maybe i have the same issue then , maybe i need to import the nabucasa certificate on synology certificate center

maybe another approach, since i also have the webserver running on that synology , is to point my webhook to a local .php file (http)
and then in that .php file i do my curl or webhook
seems possible :

https://incarnate.github.io/curl-to-php/

ok, succes
created a .php file, dropped it on my synology , now i point to that .php file from action

success!!

when creating that .php file and testing, when pointint to my local https://ip of hassio, i now saw in the browser the invalid expired certficate … because of my lets encrypt ssl was expired, dont use it anymore … so i needed to point to my nabu casa url

local should also work, but dont use local https , since i have nabucasa, and dont wanna renew every 3 months

anyway , my action is now succesfull

Edit:

Not sure why I made it so hard, I just can add the camera to HA, it will pass the motion state to HA, based on that, I can do my automation… So didn’t need an action after all…

I’m curious if anyone else is having issues with the trusted_network component changing.
I’ve waited a bit for the upgrade because I knew that it would break, but wasn’t expecting it to be such a hassle.

Anyone here have a solution to make the webhooks work from the Synology again?
I don’t like hosting a webservice, but if there is no other way then so be it.

In never had success with it, in my case it was because my hassio runs on https… On Synology it complains about untrusted certificate and no way to ignore it… So I enabled a php server, and pointed my webhook to that php file, that php does a curl to my hassio… A small workaround…

In my case I don’t need trusted networks at all

Thanks for highlighting this but I believe the webhooks should continue to work according to the release notes?. I can’t test as I’m stuck on 0.100.3 as the trusted networks breaks the camera URL functionality (camera entity_picture attribute) as the tokens refresh every couple of minutes or so and without trusted networks, the token entity_picture URL with the embedded token causes an IP ban.

Means I can no longer use these very useful HTTP URL’s for my three smart displays and in a Kodi add-on so I’m bummed about that. Started a thread here for discussion around possible workarounds.