Update a monitor for a home

PATCH/homes/{homeId}/smartModules/{moduleId}/monitors/{monitorId}

Base URL: https://api.tinkermode.com

Update a monitor for this home.

Authentication

Send an Authorization header of the form ModeCloud <AUTH_CODE>.

Must contain API key of the matching user, or a Project API Key with admin permission.

Path parameters

NameTypeRequiredConstraintsDescription
homeIdintegerYesThe unique id for a home.
moduleIdstringYesThe unique id for a smart module.
monitorIdstringYesMonitor ID

Request body

Content type: application/json

PropertyTypeRequiredConstraintsDescription
conditionone of 2NoMonitor Condition object

One of the following 2 shapes:

Variant 1

Heartbeat monitoring condition against data points in a time series.

PropertyTypeRequiredConstraintsDescription
conditionTypestringYesCurrently, the only supported type is timeSeriesHeartbeat.
intervalintegerYesDuration of time (second) how often data points are expected to appear in the time series. It should be longer than 60 seconds at least.
seriesIdstringYesTime Series ID to be monitored.

Variant 2

Threshold-based monitoring condition against static data points in a time series

PropertyTypeRequiredConstraintsDescription
conditionTypestringYesCurrently, the only supported type is timeSeriesThreshold
dataPointsDurationintegerYesExpected duration of time (in seconds) between two data points
dataPointsEvaluationPolicystringYesone of: consecutive, totalHow to count the breaching data points
intervalintegerYesHow often (in seconds) the monitoring condition is evaluated
missingDataPointPolicystringYesone of: ignore, breaching, notBreachingHow to treat missing data
numberOfBreachingDataPointsToAlertintegerYesNumber of breaching data points before an alert is triggered
operatorstringYesone of: lessThan, lessThanOrEqualTo, equal, notEqual, greaterThanOrEqualTo, greaterThanThe operator to compare the threshold value and monitored value
seriesIdstringYesTime Series ID to be monitored
thresholdnumberYesThreshold value against which the monitor evaluates whether the data point has breached the condition
descriptionstringNoMonitor description
enabledbooleanNoWhether this monitor is enabled
evaluationDelayintegerNomin: 0How long the monitor evaluation should be delayed; if this field is omitted when monitor is created, default value 0 will be applied
incidentCustomDescriptionsobjectNoUser defined incident descriptions
Properties of incidentCustomDescriptions
PropertyTypeRequiredConstraintsDescription
alertstringNoread-only (server-generated)Custom description for alert incident. If not set, default description will be 'ALERT: ${monitor.name}'
recoverystringNoread-only (server-generated)Custom description for recovery incident. If not set, default description will be 'RECOVERY: ${monitor.name}'
namestringNoMonitor name

Request example

{
  "condition": {
    "conditionType": "timeSeriesThreshold",
    "interval": 120,
    "seriesId": "room1_humidity"
  },
  "description": "humidity monitor",
  "enabled": true,
  "evaluationDelay": 60,
  "name": "humidity monitor"
}

Responses

204 The monitor has been successfully updated.

401 Authorization is required to access this resource.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.

403 Request failed because of invalid data or denied permission.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.

404 The requested monitor does not exist or is not accessible.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.

429 Request failed because of rate limit.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.

500 An unexpected error has occurred.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.

503 The service is temporarily unavailable.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.