Seam provides a universal API to connect and control many brands of devices such as smart locks, thermostats, and sensors. This guide provides a rapid introduction to connecting and controlling your Minut sensors using the Seam API. To learn more about other brands of devices supported by Seam, head over to our integration page.
1. Install Seam SDK
Seam provides client libraries for many languages, such as JavaScript, Python, Ruby, PHP, and others, as well as a Postman collection and OpenAPI spec.
This guide uses a Sandbox Workspace. Only virtual sensors can be connected. If you need to connect a real Minut sensor, use a non-sandbox workspace and API key.
2. Link Minut Account with Seam
To control your Minut sensor via the Seam API, you must first authorize your Seam workspace against your Minut account. To do so, Seam provides Connect Webviews: pre-built UX flows that walk you through authorizing your application to control your Minut sensor.
Create a Connect Webview
from seam import Seam
seam = Seam()
webview = seam.connect_webviews.create(accepted_providers=["minut"])
assert webview.login_successful is False
# Send this webview url to your user!
print(webview.url)
import { Seam } from 'seam'
const seam = new Seam()
const connectWebview = await seam.connectWebviews.create({
accepted_providers: ["minut"],
})
console.log(connectWebview.login_successful) // false
// Send the webview URL to your user
console.log(connectWebview.url)
require "seam"
seam = Seam.new(api_key: "MY_API_KEY")
webview = seam.connect_webviews.create(
accepted_providers: ["minut"]
)
puts webview.login_successful # false
# Send the webview URL to your user
puts webview.url
use Seam\SeamClient;
$seam = new SeamClient("YOUR_API_KEY");
$webview = $seam->connect_webviews->create(
accepted_providers: ["minut"]
);
echo json_encode($webview)
/*
{"connect_webview_id":"70c4df9e-1070-441f-92f8-fd6524062cec","workspace_id":"d7418ff3-a476-4f48-9a4b-211d1d21a03d","url":"https:\/\/connect.getseam.com\/connect_webviews\/view?connect_webview_id=70c4df9e-1070-441f-92f8-fd6524062cec&auth_token=9HJbwWKbD5aJLifZcozU9WWZXxropn9Bg","connected_account_id":null,"status":"pending","custom_redirect_url":null,"custom_redirect_failure_url":null,"created_at":"2023-02-09T02:14:06.147745+00:00","error":null}
*/
Authorize Your Workspace
Navigate to the URL returned by the Webview object. Since you are using a sandbox workspace, complete the login flow by entering the Minut sandbox test accounts credentials below:
email: jane@example.com
password: 1234
Get the New Webview
After you complete the login above, you'll get an event for connected_account.createdif you set up a webhook handler. Otherwise you can just poll for the webview until it's status changes, as shown below:
Minut noise sensors appear with the device_type"minut_sensor". The Minut noise sensors report properties in addition to noise levels, namely temperature and humidity.
Minut users can define noise thresholds at which noise alerts are sent.
You'll get an event for noise_threshold.noise_threshold_triggered when you set up a webhook handler. You can also poll for events.
Minut has a builtin threshold that can be triggered multiple times. Each Minut notice will trigger a noise_threshold_triggered event with the minut_metadata.event_name containing the Minut event name, which can be any of the following:
Now that you've completed this guide, you can try to connect a real Minut device. To do so, make sure to switch to a non-sandbox workspace and API key as real devices cannot be connected to sandbox workspaces.
If you have any questions or want to report an issue, email us at support@seam.co
🎛️
Minut Noise Sensors
Seam Connect Webview flow to connect Minut account with Seam