Before any testing can be conducted, you need o register for a SharedNotification account. You’ll be assigned an API Key, Hardware Identification (HID), and possibly Neighbourhood Identification (NID). You will also need to create or register for at least one other account. One account is used to send the alert and at least one other account is used to receive update.
First, after we register the accounts, we need to send a POST request to SharedNotification server. For this test, the below payload’s fields are mandatory for a successful communication.
url:
method: POST
content_type: “application/json; charset = ‘utf-8’
Payload:
{
“type”: #string
“bcname”: #string
“msg”: #string (optional)
“hid”: #string
"location": { #string
"position": { #string
"latitude": ,
"longitude":
}
}
Below is an example of sending an alert to the server. The type of notification is SENSOR. The person’s broadcast name is SWABY, HID, and location of the alert are all mandatory. The broadcast name (bcname) and address will be shown to other members of your neighbourhood watch. According to this example, SWABY belong to a neighbourhood/network consist of only 7 other members.
To receive update, you periodically send HTTP GET request to server or the server pushes updates to you. The first test will request update. The response will be an empty message payload as shown below because the device is implemented to periodically check for update ever 30 seconds. And since this Postman’s request took place after 30 seconds, the server respond with an empty payload message.
Whenever you send an alert you won’t receive this alert as an update; however, the other seven (7) member of SWABY’s neighbourhood network will receive this update/alert.
To test if your webhook is correctly implemented, send HTTP POST response to your device. This device’s respond doesn’t have any payload.
The response to these Postman test communication using Home Assistant is shown below.
The above notification was shown on my phone.
The above notification was on HAOS.