Skip to main content

Configure Thresholds

While our sensor measures the environment around itself continously, this data is not relayed to our servers in real-time, instead it is sent in batches at regular intervals. This means that the data you see in the app is not always up to date. To solve this, we have implemented a system of thresholds that can be configured to trigger events when the sensor detects something out of the ordinary.

This allows you to configure values for sound levels, temperature and humidity, and if the sensor ever measures a value that cross over this threshold it will immediately contact the servers with the measurements. What happens after this depends on the type of measurement and the configuration you've set up.

Sound Level

The sound level threshold is arguably the most important configuration you can make to your Minut account. The dBa level and duration you configure here will determine when the noise monitoring events are triggered.

To configure the sound level threshold, here is an example

Single threshold

import axios from 'axios';

const dbLevel = 75
const durationSeconds = 600

const body = {
"reactions": [
{
"type": "sound_level_high",
"notifications": [],
"value": dbLevel,
"duration_seconds": durationSeconds
}
]
}

const response = await axios.put(
'https://api.minut.com/v8/devices/<DEVICE_ID>',
body,
{
headers: {
Authorization: `Bearer ${accessToken}`,
},
})

Quiet hours

import axios from 'axios';

const dbLevel = 65
const durationSeconds = 600
// These two are the HH:MM format in the local timezone of the home
// that the device is in.
const quietHoursStart = '22:00'
const quietHoursEnd = '07:00'

const body = {
"reactions": [
{
"type": "sound_level_high_quiet_hours",
"notifications": [],
"value": dbLevel,
"duration_seconds": durationSeconds
}
],
"quiet_hours": {
"enabled": true,
"start": quietHoursStart,
"end": quietHoursEnd
}
}

const response = await axios.put(
'https://api.minut.com/v8/devices/<DEVICE_ID>',
body,
{
headers: {
Authorization: `Bearer ${accessToken}`,
},
})

Humidity

import axios from 'axios';

const lowerThreshold = 20 // %
const upperThreshold = 90 // %

const body = {
"reactions": [
{
"type": "home:humidity:low",
"notifications": [ "push" ],
"value": lowerThreshold
},
{
"type": "home:humidity:high",
"notifications": [ "push" ],
"value": upperThreshold
}
]
}

const response = await axios.put(
'https://api.minut.com/v8/devices/<DEVICE_ID>',
body,
{
headers: {
Authorization: `Bearer ${accessToken}`,
},
})

Temperature

import axios from 'axios';


// These are in Celsius
const lowerThreshold = 20 // C
const upperThreshold = 90 // C

// These are in Fahrenheit
//const fToC = (f: number) => (f - 32) * 5 / 9
//const lowerThresholdF = fToC(40)
//const upperThresholdF = fToC(90)

const body = {
"reactions": [
{
"type": "home:temperature:low",
"notifications": [ "push" ],
"value": lowerThreshold
},
{
"type": "home:temperature:high",
"notifications": [ "push" ],
"value": upperThreshold
}
]
}

const response = await axios.put(
'https://api.minut.com/v8/devices/<DEVICE_ID>',
body,
{
headers: {
Authorization: `Bearer ${accessToken}`,
},
})