Send Synology Surveillance motion events to HA switch

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.

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?