djdd87 / SynoAI

A Synology Surveillance Station notification system utilising DeepStack AI
GNU General Public License v3.0
212 stars 24 forks source link

Integrate with Synology Chat #52

Open AdiAbuAli opened 3 years ago

AdiAbuAli commented 3 years ago

Hi, I tried to use Webhook feature in Synology chat as notifier, but it fails...any success story or special parameters? Attached is the description of Webhook Synology chat integration: Capture

Thanks,

djdd87 commented 3 years ago

It's not doable at the moment as it requires a configurable JSON packet as well as a URL to access the file. It's something I can look at in the future.

djdd87 commented 2 years ago

https://kb.synology.com/en-in/DSM/help/Chat/chat_integration?version=6

While it's trivial to send the text, it ;ooks like it needs the image uploading separately somewhere first, e.g. how Pushover works. However, Pushover has it's own storage mechanism whereas Synology Chat doesn't and requires a file URL.

djdd87 commented 2 years ago

Thinking about it, we have all the files stored in the NAS, so I could expose the images directory and then access them directly, e.g. http://nas-ip:port/images/2022-02-07T09:00.000.png

djdd87 commented 2 years ago

This is mostly done. The only odd thing I'm trying to find an alternative for is that you will need to specify the SynoAI URL in the Synology Chat config. I'm not sure if that feels right, so I'll hunt for an alternative way of providing the images before going down that route.

jinlife commented 1 year ago

@djdd87 Thanks for your work, but it seems not working. It looks like the following code has issue. file_url = new Uri(new Uri(Config.Url), new Uri($"Image/{camera.Name}/{notification.ProcessedImage.FileName}", UriKind.Relative)) The Config.Url seems to be the Synology URL but not SynoAI URL. Synology Chat will require a SynoAI URL and download the image file at first, this is wierd design but this is how it works. https://kb.synology.com/en-id/DSM/help/Chat/chat_integration?version=7

Please add a Config.SynoAIUrl configuration or get SynoAI URL automatically.

djdd87 commented 1 year ago

This isn't done yet and isn't supported until it's in the docs.