Control Sunell speaker using webhooks

Introduction

To activate audio playback on your Sunnel speakers using webhooks, you can follow the step-by-step instructions outlined below. These instructions will guide you through the process of uploading audio files, configuring the alarm settings, and creating webhooks to trigger the audio playback on your Sunnel speakers. By following these steps, you'll be able to set up and control audio playback remotely using webhooks.

 

Step1: Enable ONVIF

Log in to the web UI of the Sunnel Speaker, then go to the ONVIF Menu.

Check the "ONVIF Enable" to ensure the ONVIF user is enabled on the speaker for the webhook to work.

Enter the Username and the Password for the ONVIF user, you will use this later when configuring the Webhook. Click on save to save the User. 



Step 2: Upload audio files to your speaker

Access the Sunnel speaker's interface and navigate to the Media menu. Look for the Choose File button and select the audio file you want to upload. Please ensure that the audio file is in MP3 or WAV format and has a filename consisting only of letters and numbers.


Step 3: Enable the Alarm

Create a Pattern In the Alarm menu, Select the audio file you uploaded in Step 1, configure options such as the duration for the file that should be played when triggered, and select the Cycle Mode. 

Also, ensure the "Play URL Enable" is checked and this will unlock the HTTP playback which will be required in the webhook creation step. 

Step 4: Create a Webhook

In the 3dEYE's Admin Portal, go to the Alerts menu and select the Webhooks tab. Click on the Create webhook button. Select the Delivery Method as "Push Gateway". Enter the Registration Code of the Sunnel speaker, using port 80. If the gateway has P&P firmware use speaker's own registration code if the speaker is integrated using gateway use the registration code that was generated by the gateway for the speaker.

In the path, copy and paste the link generated in the step above. Enter the link after the IP address starting with "/api".

Use "GET" as the HTTP method and enter the speaker credentials in Username and Password.


Step 5 Optional. Test the speaker

To test the speaker and webhook functionalities, you have two options:

1. Wait for the selected event type to occur naturally.
2. Add one of the Acknowledgment event types to the "Event types" list and use the alarm station to trigger the webhook at a desired moment.

Note: In our platform, "Analytics" refers to any object detection event generated either by our platform or by smart cameras. When setting up webhooks, selecting "Analytics" as an event trigger equates to selecting object detection.

For example, you can select the "Normal" event type. Here's how you can proceed:



1. Open the alarm station and log in with a user who has access to the camera associated with the role that triggers the webhook.
2. Arm the alarm station.
3. Either wait for an event to occur or open the Menu events and drag and drop one of the past events into any cell of the layout.
4. Next, select the same event type you used for the webhook from the Acknowledgment dropdown list (in this example, it will be "Normal").
5. Click OK to acknowledge the event.

You should hear the speaker playback the audio file after completing these steps.