[solved]Getting Surveillance Station and Home Assistant Talking

Hey all. I have a Synology NAS set up with Surveillance Station and a camera that is always recording. It’s great for checking if something happened, but currently I don’t have a way to get notifications for motion as it happens.

I’ve been using Home Assistant for quite some time now, but I’m only just starting to dive into getting SS and HA connected. I see that there are Actions you can set up within SS to send data to a web hook when motion is detected. This sounds like an absolutely perfect way to trigger a flow in node red to send a snapshot of the motion event to designated mobile devices, but I’m really having trouble getting Node Red to receive info from a web hook. Here’s what I have so far:

I have a Node Red flow set up to listen to the webhook endpoint, then my plan is to set it up so that depending on the payload received, would continue the flow to send the snapshot to mobile.

This is what the details look like on the websocket input node
websocket in node

This is what the action setup looks like within Surveillance Station
action-deets

With the body being:

{   "type": "auth",   "access_token": "access-token",   "data": {       "message": "on"   } }

When I click on “Test Send” and connect a debug node to the websocket node, I don’t receive any information, which I assume means that the information is not being sent? Surveillance station states that the test sent successfully. What am I missing here that would result in a post to the websocket endpoint to trigger the automation?

webhook demo

webhook1

webhook3

Got it. Thank you very much for your help.

I was looking for a webhook input node, but there actually wasn’t one within the Home Assistant section, so was using the websocket from input. Your post made me look more into it and found that there were addons that needed updated. After that, webhook node was there and I was able to configure it.

Thank you very much for the images. Helped me out quite a bit.

I see this works for forwarding camera stills to the notication service within HA. did anyone find a way to receive a link to, or forward, the whole recording of that event? e.g. I have configured that there should be at least a 10second recording of any detected motion and I would like to show that video within HA.

You could simply create a binary_sensor to reflect a motion or IVA in surveillance station, doing this then you can easily create automations on state changes and use the binary_sensor in your dashboard etc eg…

template:
  - trigger:
      - platform: webhook
        webhook_id: "ss_front_yard_detection"
        allowed_methods:
          - POST
        local_only: true
    binary_sensor:
      - name: "Surveillance Station Front Yard Detection"
        unique_id: ss_front_yard_detection
        device_class: motion
        state: On
        auto_off: 10
        attributes:
          time: "{{ trigger.json.time }}"
          task: "{{ trigger.json.task }}"
          event_name: "{{ trigger.json.event_name }}"
          event_type: "{{ trigger.json.event_type }}"


1 Like

Whoa there Nelly!! I was just thinking about how useful it would be to be able to have my Synology Surveillance Station cameras send an alert to HA to trigger my house alarm. Especially given I had an intruder try and break into my car 2 nights ago. If it had not been for the Ring, I would never have woken up.
How are you guys doing this? I have not seen this before and know Surveillance station does not have motion sensors per se, that can connect with HA directly.
I have Node Red running and would love to be able to have the Ring camera outdoor siren trigger between certain hours I am asleep if the cameras are triggered for a motion event. Any ideas how I can get this working? I am an enthusiast that cobbles together items and bits of code, but have not delved into using webhooks or anything truly sophisticated like this before.
Any help is greatly appreciated.
Best wishes.

First you will want to familiarise yourself with webhooks Automation Trigger - Home Assistant. Then how to make entities based on webhook triggers using template Template - Home Assistant. You’ll be most interested in the binary_sensor.

In Surveillance Station, you can create a new rule like the picture above. Use the webhook action and point to the url for the entity used when creating a template based on the webhook trigger. You can provide whatever form data you wish but if you want to keep things simple then just leave it empty. Also make sure both are using the same method (preferrably POST) and for better security have the webhook trigger use local only like shown above.

EDIT: To answer your question as to “How are you guys doing this” in reflection to deterrance. Right now I have Surveillance Station update the binary_sensor on person detection (just normal motion detection is not enough as it’s prone to triggering false alarms)… I have an automation checking if the state changed to detected with conditions on whether it’s past a certain time or I’m in bed, then I activate my Dahua flashing red and blue lights. I have deliberated on playing a siren aswell but don’t wan’t to piss off neighbours over false triggers atm so I’ll see how this setup goes for a while.

For better logic I also ensure to check my front door has been closed for 5 minutes as another condition, as I may just happen to pop outside during the monitoring times. I also make sure I’ve been home for 5 minutes as I don’t want it to trigger if I just happen to be arriving home.

1 Like

Wow. Thanks for the fast reply. This is way too above my level. I followed an online tutorial after I saw your post.
I am just trying to get a similar action rule from your post into my node-red flow and it keeps failing with 404 error with my URL. I am using http://192.168.1.65:8123/api/webhooks/synology as I have set this up but am still getting the 404 error. I am stumbling at the very gate so the basic issues seem to have stymied me.
Someone mentioned in another thread it could be a certificate issue or my router (UniFi UDM Pro) not supporting reverse hairpinning or NAT and my eyeballs rolled back into my head and I had to reboot myself LOL.
Maybe I will look at this in more detail another time.
Thanks again.

For now if you just want to test if the url is correct, then change it from a POST to GET on the trigger, then goto that URL in your browser then you should see if it triggered or not (you also shouldn’t be getting a 404 for GET)… If all is good with that url, then change it back to POST and do a test on the Surveillance Station.

Also make sure you do a restart on changes… I also noticed in your url you have webhooks and not webhook (non plural). Also don’t waste your time following up about certificate or router NAT, you’re doing a local connection to a http url not a https.

Also avoid using Node-Red for now and just get the entity to show and work within Home Assistant first as to remove extra Point of Failures. Also if you can do your automation all within Home Assistant then I would recommend doing that instead of relying on Node-Red for same reason.

You are so awesome for replying and helping. I am so grateful for your expertise and kindness. I will try with your corrections and advice when I get back home.
Many many thanks Sian.

Hi. I’m new to HA but love it so far.

I have a camera in Surveillance Station that is visible in HA. I too would like to add a binary motion sensor for it. I understand the YAML above and can add a webhook in Surveillance Station but where do I add the YAML?