Configuring Noise Threshold Settings

Learn how to configure noise thresholds for noise sensors.

Seam enables you to configure the noise thresholds of your noise sensor, as well as to receive events when a disturbance is detected. This guide walks you through how to configure noise thresholds with the Seam API.

Set Up Noise Thresholds

First, create a threshold using the Create Noise Thresholds endpoint. For example:

Request:

device_id = "98dc7c66-045d-49cb-a62b-4bb431b0a9fa"

noise_threshold = seam.noise_sensors.noise_thresholds.create(
    device_id = device_id,
    starts_daily_at = "20:00:00[America/Los_Angeles]",
    ends_daily_at = "06:00:00[America/Los_Angeles]",
    noise_threshold_decibels = 70
)

pprint(noise_threshold)

Response:

NoiseThreshold(noise_threshold_id='1b64e4b6-4d5d-4416-acca-dc3b1cbc00cd',
               device_id='98dc7c66-045d-49cb-a62b-4bb431b0a9fa',
               name='builtin_quiet_hours',
               noise_threshold_decibels=70,
               starts_daily_at='20:00:00[America/Los_Angeles]',
               ends_daily_at='06:00:00[America/Los_Angeles]',
               noise_threshold_nrs=None)

This threshold creates a noise threshold of 70 decibels from 20:00-06:00 PST called builtin_quiet_hours.

Once you have created a threshold, connect it to a webhook to log events.

Best Practices

  • For Minut devices, you can configure two thresholds—one for quiet hours and one for the rest of the day.

  • For NoiseAware devices, you can configure as many thresholds as you want, provided that they do not overlap during daytime hours.

Set Up Webhooks

You can set up webhooks in the Seam Console.

  1. In the left-hand navigation pane of Seam Console, click Webhooks.

  2. On the Webhooks page, click + Add Webhook.

  3. In the Create Webhook dialog:

    1. Type your URL.

    2. Select the event types for which you want to receive events.

    3. Click Create.

The Seam Console displays the URL and secret for the newly-created webhook. To test your webhook, click Test your webhook.

Monitor Events

Once you have configured your thresholds and webhooks, you can monitor events with the Seam API. The following sample shows how events look:

{
  "created_at": "2023-01-09T18:54:32.737Z",
  "device_id": "c1296d07-3e96-4ee9-8219-3cd33a09aa37",
  "event_id": "c1296d07-3e96-4ee9-8219-3cd33a09aa37",
  "event_type": "noise_sensors.noise_threshold_triggered",
  "minut_metadata": {},
  "noise_level_decibels": 50,
  "noise_level_nrs": 40,
  "noise_threshold_id": "c1296d07-3e96-4ee9-8219-3cd33a09aa37",
  "noise_threshold_name": "builtin_first_disturbance",
  "noiseaware_metadata": {}
}

For a detailed reference of event parameters, see Events.

Last updated

Logo

© Seam Labs, Inc. All rights reserved.