This project aims to control via a custom REST API the D-Link's DCH-S220 Siren to allow total customized control over this product for home automation enthusiasts or hobbyists.
This project is only possible due to the great work of @bikerp and his dsp-w215-hnap repo.
The project must run on a device in the same network as your siren (on a raspberry pi for example), you must open the configured ports on your router to access it from the outside.
- Clone this repo
- Change into the project's root directory
- Install the dependencies by executing
npm i
- Copy the
.env.example
into.env
by executingcp .env.example .env
- Edit the
.env
file to configure the authentication and siren parameters - Start the server by executing
npm start
Additionally, you can add a watcher to the process with pm2
All endpoints must be consumed with HTTP GET under the root "/".
Parameters:
type
: 'start'volume
: A value from 1 to 100sound
: A value from 1 to 6- 1: emergency
- 2: fire
- 3: ambulance
- 4: police
- 5: door_chime
- 6: beep
duration
: A value from 1 to 88888 (infinite)
cURL Example:
curl 'http://localhost:3000/?type=start&volume=20&sound=1&duration=30'
Parameters:
type
: 'stop'
cURL Example:
curl 'http://localhost:3000/?type=stop'
Parameters:
type
: 'beep'times
: A number from 1 to n the siren must beep
cURL Example:
curl 'http://localhost:3000/?type=beep×=1'
Figure out if the siren is sounding or not.
Parameters:
type
: 'status'
cURL Example:
curl 'http://localhost:3000/?type=status'
HTTP/1.1 200 OK
Content-Type: application/json
Date: Sun, 06 Aug 2017 19:57:48 GMT
Connection: close
Transfer-Encoding: chunked
{"status":"OK","message":"Successfully processed","isPlaying":false}