Skip to content

Sensor

Sensor

Sensor class.

create_device_sensor_command

Sends a command to a sensor.

API documentation: createDeviceSensorCommand

Parameters:

  • serial (str) –

    Serial.

  • operation (CreateDeviceSensorCommandOperation) –

    Operation to run on the sensor. 'enableDownstreamPower', 'disableDownstreamPower', and 'cycleDownstreamPower' turn power on/off to the device that is connected downstream of an MT40 power monitor. 'refreshData' causes an MT15 or MT40 device to upload its latest readings so that they are immediately available in the Dashboard API.

Returns:

  • DeviceSensorCommandResponse

    Successful operation.

Example API response
{
  "commandId": "1284392014819",
  "createdAt": "2018-02-11T00:00:00Z",
  "completedAt": "2018-05-12T00:00:00Z",
  "createdBy": {
    "adminId": "212406",
    "name": "Miles Meraki",
    "email": "miles@meraki.com"
  },
  "operation": "disableDownstreamPower",
  "status": "completed",
  "errors": []
}

create_network_sensor_alerts_profile

Creates a sensor alert profile for a network.

API documentation: createNetworkSensorAlertsProfile

Parameters:

  • network_id (str) –

    Network ID.

  • name (str) –

    Name of the sensor alert profile.

  • schedule (CreateNetworkSensorAlertsProfileSchedule | None, default: None ) –

    The sensor schedule to use with the alert profile.

  • conditions (list[CreateNetworkSensorAlertsProfileConditionsItem]) –

    List of conditions that will cause the profile to send an alert.

  • recipients (CreateNetworkSensorAlertsProfileRecipients | None, default: None ) –

    List of recipients that will receive the alert.

  • serials (list[str] | None, default: None ) –

    List of device serials assigned to this sensor alert profile.

  • include_sensor_url (bool | None, default: None ) –

    Include dashboard link to sensor in messages (default: true).

  • message (str | None, default: None ) –

    A custom message that will appear in email and text message alerts.

Returns:

  • NetworkSensorAlertsProfileResponse

    Successful operation.

Example API response
{
  "profileId": "1",
  "name": "My Sensor Alert Profile",
  "schedule": {
    "id": "5",
    "name": "My Schedule"
  },
  "conditions": [
    {
      "metric": "temperature",
      "threshold": {
        "temperature": {
          "celsius": 20.5,
          "fahrenheit": 70.0,
          "quality": "good"
        },
        "humidity": {
          "relativePercentage": 65,
          "quality": "inadequate"
        },
        "water": {
          "present": true
        },
        "door": {
          "open": true
        },
        "tvoc": {
          "concentration": 400,
          "quality": "poor"
        },
        "co2": {
          "concentration": 400,
          "quality": "poor"
        },
        "pm25": {
          "concentration": 90,
          "quality": "fair"
        },
        "noise": {
          "ambient": {
            "level": 120,
            "quality": "poor"
          }
        },
        "indoorAirQuality": {
          "score": 80,
          "quality": "fair"
        },
        "realPower": {
          "draw": 14.1
        },
        "apparentPower": {
          "draw": 17.2
        },
        "powerFactor": {
          "percentage": 81
        },
        "current": {
          "draw": 0.14
        },
        "voltage": {
          "level": 119.5
        },
        "frequency": {
          "level": 58.8
        },
        "upstreamPower": {
          "outageDetected": true
        }
      },
      "direction": "above",
      "duration": 60
    }
  ],
  "recipients": {
    "emails": [
      "miles@meraki.com"
    ],
    "smsNumbers": [
      "+15555555555"
    ],
    "httpServerIds": [
      "aHR0cHM6Ly93d3cuZXhhbXBsZS5jb20vd2ViaG9va3M="
    ]
  },
  "serials": [
    "Q234-ABCD-0001",
    "Q234-ABCD-0002",
    "Q234-ABCD-0003"
  ],
  "includeSensorUrl": true,
  "message": "Check with Miles on what to do."
}

delete_network_sensor_alerts_profile

Deletes a sensor alert profile from a network.

API documentation: deleteNetworkSensorAlertsProfile

Parameters:

  • network_id (str) –

    Network ID.

  • id (str) –

    ID.

Returns:

  • None

    Successful operation.

get_device_sensor_command

Returns information about the command's execution, including the status.

API documentation: getDeviceSensorCommand

Parameters:

  • serial (str) –

    Serial.

  • command_id (str) –

    Command ID.

Returns:

  • DeviceSensorCommandResponse

    Successful operation.

Example API response
{
  "commandId": "1284392014819",
  "createdAt": "2018-02-11T00:00:00Z",
  "completedAt": "2018-05-12T00:00:00Z",
  "createdBy": {
    "adminId": "212406",
    "name": "Miles Meraki",
    "email": "miles@meraki.com"
  },
  "operation": "disableDownstreamPower",
  "status": "completed",
  "errors": []
}

get_device_sensor_commands

Returns a historical log of all commands.

API documentation: getDeviceSensorCommands

Parameters:

  • serial (str) –

    Serial.

  • operations (list[str] | None, default: None ) –

    Optional parameter to filter commands by operation. Allowed values are disableDownstreamPower, enableDownstreamPower, cycleDownstreamPower, and refreshData.

  • per_page (int | None, default: None ) –

    The number of entries per page returned. Acceptable range is 3 - 1000. Default is 10.

  • starting_after (str | None, default: None ) –

    A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it.

  • ending_before (str | None, default: None ) –

    A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it.

  • sort_order (GetDeviceSensorCommandsSortOrder | None, default: None ) –

    Sorted order of entries. Order options are 'ascending' and 'descending'. Default is 'descending'.

  • t0 (str | None, default: None ) –

    The beginning of the timespan for the data. The maximum lookback period is 30 days from today.

  • t1 (str | None, default: None ) –

    The end of the timespan for the data. t1 can be a maximum of 30 days after t0.

  • timespan (float | None, default: None ) –

    The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 30 days. The default is 30 days.

  • total_pages (int | Literal['all'], default: 'all' ) –

    use with per_page to get total results up to total_pages * per_page; -1 or "all" for all pages.

  • direction (Literal['prev', 'next'], default: 'next' ) –

    direction to paginate, either "next" (default) or "prev" page.

Returns:

Note

Returns a lazy PaginatedResponse that can be iterated or collected with .collect(). Page metadata is available on .meta and .meta_pages.

Example API response
[
  {
    "commandId": "1284392014819",
    "createdAt": "2018-02-11T00:00:00Z",
    "completedAt": "2018-05-12T00:00:00Z",
    "createdBy": {
      "adminId": "212406",
      "name": "Miles Meraki",
      "email": "miles@meraki.com"
    },
    "operation": "disableDownstreamPower",
    "status": "completed",
    "errors": []
  }
]

get_device_sensor_relationships

List the sensor roles for a given sensor or camera device.

API documentation: getDeviceSensorRelationships

Parameters:

  • serial (str) –

    Serial.

Returns:

  • DeviceSensorRelationshipsResponse

    Successful operation.

Example API response
{
  "livestream": {
    "relatedDevices": [
      {
        "serial": "Q234-ABCD-5678",
        "productType": "camera"
      }
    ]
  }
}

get_network_sensor_alerts_current_overview_by_metric

Return an overview of currently alerting sensors by metric.

API documentation: getNetworkSensorAlertsCurrentOverviewByMetric

Parameters:

  • network_id (str) –

    Network ID.

Returns:

  • GetNetworkSensorAlertsCurrentOverviewByMetricResponse

    Successful operation.

Example API response
{
  "supportedMetrics": [
    "temperature",
    "humidity",
    "door"
  ],
  "counts": {
    "apparentPower": 0,
    "co2": 0,
    "current": 0,
    "door": 0,
    "frequency": 0,
    "humidity": 1,
    "indoorAirQuality": 0,
    "noise": {
      "ambient": 0
    },
    "pm25": 0,
    "powerFactor": 0,
    "realPower": 0,
    "temperature": 4,
    "tvoc": 0,
    "upstreamPower": 0,
    "voltage": 0,
    "water": 0
  }
}

get_network_sensor_alerts_overview_by_metric

Return an overview of alert occurrences over a timespan, by metric.

API documentation: getNetworkSensorAlertsOverviewByMetric

Parameters:

  • network_id (str) –

    Network ID.

  • t0 (str | None, default: None ) –

    The beginning of the timespan for the data. The maximum lookback period is 731 days from today.

  • t1 (str | None, default: None ) –

    The end of the timespan for the data. t1 can be a maximum of 366 days after t0.

  • timespan (float | None, default: None ) –

    The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 366 days. The default is 7 days. If interval is provided, the timespan will be autocalculated.

  • interval (int | None, default: None ) –

    The time interval in seconds for returned data. The valid intervals are: 900, 3600, 86400, 604800, 2629746. The default is 604800. Interval is calculated if time params are provided.

Returns:

  • PaginatedResponse[GetNetworkSensorAlertsOverviewByMetricResponseItem]

    Successful operation.

Note

Returns a lazy PaginatedResponse that can be iterated or collected with .collect(). Page metadata is available on .meta and .meta_pages.

Example API response
[
  {
    "startTs": "2022-08-21T00:00:00Z",
    "endTs": "2022-08-27T23:59:59Z",
    "counts": {
      "apparentPower": 0,
      "co2": 0,
      "current": 0,
      "door": 0,
      "frequency": 1,
      "humidity": 1,
      "indoorAirQuality": 0,
      "noise": {
        "ambient": 2
      },
      "pm25": 0,
      "powerFactor": 0,
      "realPower": 0,
      "temperature": 4,
      "tvoc": 0,
      "upstreamPower": 0,
      "voltage": 0,
      "water": 0
    }
  }
]

get_network_sensor_alerts_profile

Show details of a sensor alert profile for a network.

API documentation: getNetworkSensorAlertsProfile

Parameters:

  • network_id (str) –

    Network ID.

  • id (str) –

    ID.

Returns:

  • NetworkSensorAlertsProfileResponse

    Successful operation.

Example API response
{
  "profileId": "1",
  "name": "My Sensor Alert Profile",
  "schedule": {
    "id": "5",
    "name": "My Schedule"
  },
  "conditions": [
    {
      "metric": "temperature",
      "threshold": {
        "temperature": {
          "celsius": 20.5,
          "fahrenheit": 70.0,
          "quality": "good"
        },
        "humidity": {
          "relativePercentage": 65,
          "quality": "inadequate"
        },
        "water": {
          "present": true
        },
        "door": {
          "open": true
        },
        "tvoc": {
          "concentration": 400,
          "quality": "poor"
        },
        "co2": {
          "concentration": 400,
          "quality": "poor"
        },
        "pm25": {
          "concentration": 90,
          "quality": "fair"
        },
        "noise": {
          "ambient": {
            "level": 120,
            "quality": "poor"
          }
        },
        "indoorAirQuality": {
          "score": 80,
          "quality": "fair"
        },
        "realPower": {
          "draw": 14.1
        },
        "apparentPower": {
          "draw": 17.2
        },
        "powerFactor": {
          "percentage": 81
        },
        "current": {
          "draw": 0.14
        },
        "voltage": {
          "level": 119.5
        },
        "frequency": {
          "level": 58.8
        },
        "upstreamPower": {
          "outageDetected": true
        }
      },
      "direction": "above",
      "duration": 60
    }
  ],
  "recipients": {
    "emails": [
      "miles@meraki.com"
    ],
    "smsNumbers": [
      "+15555555555"
    ],
    "httpServerIds": [
      "aHR0cHM6Ly93d3cuZXhhbXBsZS5jb20vd2ViaG9va3M="
    ]
  },
  "serials": [
    "Q234-ABCD-0001",
    "Q234-ABCD-0002",
    "Q234-ABCD-0003"
  ],
  "includeSensorUrl": true,
  "message": "Check with Miles on what to do."
}

get_network_sensor_alerts_profiles

Lists all sensor alert profiles for a network.

API documentation: getNetworkSensorAlertsProfiles

Parameters:

  • network_id (str) –

    Network ID.

Returns:

Note

Returns a lazy PaginatedResponse that can be iterated or collected with .collect(). Page metadata is available on .meta and .meta_pages.

Example API response
[
  {
    "profileId": "1",
    "name": "My Sensor Alert Profile",
    "schedule": {
      "id": "5",
      "name": "My Schedule"
    },
    "conditions": [
      {
        "metric": "temperature",
        "threshold": {
          "temperature": {
            "celsius": 20.5,
            "fahrenheit": 70.0,
            "quality": "good"
          },
          "humidity": {
            "relativePercentage": 65,
            "quality": "inadequate"
          },
          "water": {
            "present": true
          },
          "door": {
            "open": true
          },
          "tvoc": {
            "concentration": 400,
            "quality": "poor"
          },
          "co2": {
            "concentration": 400,
            "quality": "poor"
          },
          "pm25": {
            "concentration": 90,
            "quality": "fair"
          },
          "noise": {
            "ambient": {
              "level": 120,
              "quality": "poor"
            }
          },
          "indoorAirQuality": {
            "score": 80,
            "quality": "fair"
          },
          "realPower": {
            "draw": 14.1
          },
          "apparentPower": {
            "draw": 17.2
          },
          "powerFactor": {
            "percentage": 81
          },
          "current": {
            "draw": 0.14
          },
          "voltage": {
            "level": 119.5
          },
          "frequency": {
            "level": 58.8
          },
          "upstreamPower": {
            "outageDetected": true
          }
        },
        "direction": "above",
        "duration": 60
      }
    ],
    "recipients": {
      "emails": [
        "miles@meraki.com"
      ],
      "smsNumbers": [
        "+15555555555"
      ],
      "httpServerIds": [
        "aHR0cHM6Ly93d3cuZXhhbXBsZS5jb20vd2ViaG9va3M="
      ]
    },
    "serials": [
      "Q234-ABCD-0001",
      "Q234-ABCD-0002",
      "Q234-ABCD-0003"
    ],
    "includeSensorUrl": true,
    "message": "Check with Miles on what to do."
  }
]

get_network_sensor_mqtt_broker

Return the sensor settings of an MQTT broker.

API documentation: getNetworkSensorMqttBroker

Parameters:

  • network_id (str) –

    Network ID.

  • mqtt_broker_id (str) –

    Mqtt broker ID.

Returns:

  • NetworkSensorMqttBrokerResponse

    Successful operation.

Example API response
{
  "mqttBrokerId": "1234",
  "enabled": true
}

get_network_sensor_mqtt_brokers

List the sensor settings of all MQTT brokers for this network.

API documentation: getNetworkSensorMqttBrokers

Parameters:

  • network_id (str) –

    Network ID.

Returns:

Note

Returns a lazy PaginatedResponse that can be iterated or collected with .collect(). Page metadata is available on .meta and .meta_pages.

Example API response
[
  {
    "mqttBrokerId": "1234",
    "enabled": true
  }
]

get_network_sensor_relationships

List the sensor roles for devices in a given network.

API documentation: getNetworkSensorRelationships

Parameters:

  • network_id (str) –

    Network ID.

Returns:

  • PaginatedResponse[GetNetworkSensorRelationshipsResponseItem]

    Successful operation.

Note

Returns a lazy PaginatedResponse that can be iterated or collected with .collect(). Page metadata is available on .meta and .meta_pages.

Example API response
[
  {
    "device": {
      "name": "My sensor",
      "serial": "Q234-ABCD-0001",
      "productType": "sensor"
    },
    "relationships": {
      "livestream": {
        "relatedDevices": [
          {
            "serial": "Q234-ABCD-5678",
            "productType": "camera"
          }
        ]
      }
    }
  }
]

get_organization_sensor_gateways_connections_latest

Returns latest sensor-gateway connectivity data.

API documentation: getOrganizationSensorGatewaysConnectionsLatest

Parameters:

  • organization_id (str) –

    Organization ID.

  • sensor_serials (list[str] | None, default: None ) –

    List of sensor serials to filter connectivity data by sensor.

  • per_page (int | None, default: None ) –

    The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000.

  • starting_after (str | None, default: None ) –

    A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it.

  • ending_before (str | None, default: None ) –

    A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it.

  • total_pages (int | Literal['all'], default: 'all' ) –

    use with per_page to get total results up to total_pages * per_page; -1 or "all" for all pages.

  • direction (Literal['prev', 'next'], default: 'next' ) –

    direction to paginate, either "next" (default) or "prev" page.

Returns:

  • PaginatedResponse[GetOrganizationSensorGatewaysConnectionsLatestResponseItemsItem]

    Successful operation.

Note

Returns a lazy PaginatedResponse that can be iterated or collected with .collect(). Page metadata is available on .meta and .meta_pages.

Example API response
{
  "items": [
    {
      "lastReportedAt": "2024-09-04T19:29:05Z",
      "lastConnectedAt": "2024-09-04T19:29:05Z",
      "rssi": -24,
      "network": {
        "name": "My sensor",
        "id": "N_12345678"
      },
      "sensor": {
        "serial": "Q234-ABCD-0001",
        "name": "My sensor",
        "mac": "00:11:22:33:44:55"
      },
      "gateway": {
        "serial": "Q234-ABCD-0004",
        "name": "My gateway",
        "mac": "22:33:44:55:66:77"
      }
    }
  ],
  "meta": {
    "counts": {
      "items": {
        "total": 20,
        "remaining": 0
      }
    }
  }
}

get_organization_sensor_readings_history

Return all reported readings from sensors in a given timespan, sorted by timestamp.

API documentation: getOrganizationSensorReadingsHistory

Parameters:

  • organization_id (str) –

    Organization ID.

  • per_page (int | None, default: None ) –

    The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000.

  • starting_after (str | None, default: None ) –

    A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it.

  • ending_before (str | None, default: None ) –

    A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it.

  • t0 (str | None, default: None ) –

    The beginning of the timespan for the data. The maximum lookback period is 365 days, 5 hours, 49 minutes, and 12 seconds from today.

  • t1 (str | None, default: None ) –

    The end of the timespan for the data. t1 can be a maximum of 7 days after t0.

  • timespan (float | None, default: None ) –

    The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be less than or equal to 7 days. The default is 2 hours.

  • network_ids (list[str] | None, default: None ) –

    Optional parameter to filter readings by network.

  • serials (list[str] | None, default: None ) –

    Optional parameter to filter readings by sensor.

  • metrics (GetOrganizationSensorReadingsHistoryMetrics | None, default: None ) –

    Types of sensor readings to retrieve. If no metrics are supplied, all available types of readings will be retrieved.

  • total_pages (int | Literal['all'], default: 'all' ) –

    use with per_page to get total results up to total_pages * per_page; -1 or "all" for all pages.

  • direction (Literal['prev', 'next'], default: 'next' ) –

    direction to paginate, either "next" (default) or "prev" page.

Returns:

  • PaginatedResponse[GetOrganizationSensorReadingsHistoryResponseItem]

    Successful operation.

Note

Returns a lazy PaginatedResponse that can be iterated or collected with .collect(). Page metadata is available on .meta and .meta_pages.

Example API response
[
  {
    "serial": "Q234-ABCD-5678",
    "network": {
      "id": "N_24329156",
      "name": "Main Office"
    },
    "ts": "2021-10-18T23:54:48.000000Z",
    "metric": "temperature",
    "apparentPower": {
      "draw": 15.9
    },
    "battery": {
      "percentage": 91
    },
    "button": {
      "pressType": "short"
    },
    "co2": {
      "concentration": 100
    },
    "current": {
      "draw": 0.13
    },
    "door": {
      "open": true
    },
    "downstreamPower": {
      "enabled": true
    },
    "frequency": {
      "level": 60.1
    },
    "humidity": {
      "relativePercentage": 34
    },
    "indoorAirQuality": {
      "score": 89
    },
    "noise": {
      "ambient": {
        "level": 45
      }
    },
    "no2": {
      "concentration": 25
    },
    "o3": {
      "concentration": 30
    },
    "pm10": {
      "concentration": 50
    },
    "pm25": {
      "concentration": 100
    },
    "powerFactor": {
      "percentage": 86
    },
    "realPower": {
      "draw": 13.7
    },
    "remoteLockoutSwitch": {
      "locked": false
    },
    "temperature": {
      "fahrenheit": 77.81,
      "celsius": 25.45
    },
    "tvoc": {
      "concentration": 100
    },
    "voltage": {
      "level": 122.4
    },
    "water": {
      "present": true
    },
    "rawTemperature": {
      "fahrenheit": 75.3,
      "celsius": 24.06
    }
  }
]

get_organization_sensor_readings_latest

Return the latest available reading for each metric from each sensor, sorted by sensor serial.

API documentation: getOrganizationSensorReadingsLatest

Parameters:

  • organization_id (str) –

    Organization ID.

  • per_page (int | None, default: None ) –

    The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000.

  • starting_after (str | None, default: None ) –

    A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it.

  • ending_before (str | None, default: None ) –

    A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it.

  • network_ids (list[str] | None, default: None ) –

    Optional parameter to filter readings by network.

  • serials (list[str] | None, default: None ) –

    Optional parameter to filter readings by sensor.

  • metrics (GetOrganizationSensorReadingsLatestMetrics | None, default: None ) –

    Types of sensor readings to retrieve. If no metrics are supplied, all available types of readings will be retrieved.

  • total_pages (int | Literal['all'], default: 'all' ) –

    use with per_page to get total results up to total_pages * per_page; -1 or "all" for all pages.

  • direction (Literal['prev', 'next'], default: 'next' ) –

    direction to paginate, either "next" (default) or "prev" page.

Returns:

  • PaginatedResponse[GetOrganizationSensorReadingsLatestResponseItem]

    Successful operation.

Note

Returns a lazy PaginatedResponse that can be iterated or collected with .collect(). Page metadata is available on .meta and .meta_pages.

Example API response
[
  {
    "serial": "Q234-ABCD-5678",
    "network": {
      "id": "N_24329156",
      "name": "Main Office"
    },
    "readings": [
      {
        "ts": "2021-10-18T23:54:48.000000Z",
        "metric": "temperature",
        "apparentPower": {
          "draw": 15.9
        },
        "battery": {
          "percentage": 91
        },
        "button": {
          "pressType": "short"
        },
        "co2": {
          "concentration": 100
        },
        "current": {
          "draw": 0.13
        },
        "door": {
          "open": true
        },
        "downstreamPower": {
          "enabled": true
        },
        "frequency": {
          "level": 60.1
        },
        "humidity": {
          "relativePercentage": 34
        },
        "indoorAirQuality": {
          "score": 89
        },
        "noise": {
          "ambient": {
            "level": 45
          }
        },
        "no2": {
          "concentration": 25
        },
        "o3": {
          "concentration": 30
        },
        "pm10": {
          "concentration": 50
        },
        "pm25": {
          "concentration": 100
        },
        "powerFactor": {
          "percentage": 86
        },
        "realPower": {
          "draw": 13.7
        },
        "remoteLockoutSwitch": {
          "locked": false
        },
        "temperature": {
          "fahrenheit": 77.81,
          "celsius": 25.45
        },
        "tvoc": {
          "concentration": 100
        },
        "voltage": {
          "level": 122.4
        },
        "water": {
          "present": true
        },
        "rawTemperature": {
          "fahrenheit": 75.3,
          "celsius": 24.06
        }
      }
    ]
  }
]

update_device_sensor_relationships

Assign one or more sensor roles to a given sensor or camera device.

API documentation: updateDeviceSensorRelationships

Parameters:

  • serial (str) –

    Serial.

  • livestream (UpdateDeviceSensorRelationshipsLivestream | None, default: None ) –

    A role defined between an MT sensor and an MV camera that adds the camera's livestream to the sensor's details page. Snapshots from the camera will also appear in alert notifications that the sensor triggers.

Returns:

  • DeviceSensorRelationshipsResponse

    Successful operation.

Example API response
{
  "livestream": {
    "relatedDevices": [
      {
        "serial": "Q234-ABCD-5678",
        "productType": "camera"
      }
    ]
  }
}

update_network_sensor_alerts_profile

Updates a sensor alert profile for a network.

API documentation: updateNetworkSensorAlertsProfile

Parameters:

  • network_id (str) –

    Network ID.

  • id (str) –

    ID.

  • name (str | None, default: None ) –

    Name of the sensor alert profile.

  • schedule (UpdateNetworkSensorAlertsProfileSchedule | None, default: None ) –

    The sensor schedule to use with the alert profile.

  • conditions (list[UpdateNetworkSensorAlertsProfileConditionsItem] | None, default: None ) –

    List of conditions that will cause the profile to send an alert.

  • recipients (UpdateNetworkSensorAlertsProfileRecipients | None, default: None ) –

    List of recipients that will receive the alert.

  • serials (list[str] | None, default: None ) –

    List of device serials assigned to this sensor alert profile.

  • include_sensor_url (bool | None, default: None ) –

    Include dashboard link to sensor in messages (default: true).

  • message (str | None, default: None ) –

    A custom message that will appear in email and text message alerts.

Returns:

  • NetworkSensorAlertsProfileResponse

    Successful operation.

Example API response
{
  "profileId": "1",
  "name": "My Sensor Alert Profile",
  "schedule": {
    "id": "5",
    "name": "My Schedule"
  },
  "conditions": [
    {
      "metric": "temperature",
      "threshold": {
        "temperature": {
          "celsius": 20.5,
          "fahrenheit": 70.0,
          "quality": "good"
        },
        "humidity": {
          "relativePercentage": 65,
          "quality": "inadequate"
        },
        "water": {
          "present": true
        },
        "door": {
          "open": true
        },
        "tvoc": {
          "concentration": 400,
          "quality": "poor"
        },
        "co2": {
          "concentration": 400,
          "quality": "poor"
        },
        "pm25": {
          "concentration": 90,
          "quality": "fair"
        },
        "noise": {
          "ambient": {
            "level": 120,
            "quality": "poor"
          }
        },
        "indoorAirQuality": {
          "score": 80,
          "quality": "fair"
        },
        "realPower": {
          "draw": 14.1
        },
        "apparentPower": {
          "draw": 17.2
        },
        "powerFactor": {
          "percentage": 81
        },
        "current": {
          "draw": 0.14
        },
        "voltage": {
          "level": 119.5
        },
        "frequency": {
          "level": 58.8
        },
        "upstreamPower": {
          "outageDetected": true
        }
      },
      "direction": "above",
      "duration": 60
    }
  ],
  "recipients": {
    "emails": [
      "miles@meraki.com"
    ],
    "smsNumbers": [
      "+15555555555"
    ],
    "httpServerIds": [
      "aHR0cHM6Ly93d3cuZXhhbXBsZS5jb20vd2ViaG9va3M="
    ]
  },
  "serials": [
    "Q234-ABCD-0001",
    "Q234-ABCD-0002",
    "Q234-ABCD-0003"
  ],
  "includeSensorUrl": true,
  "message": "Check with Miles on what to do."
}

update_network_sensor_mqtt_broker

Update the sensor settings of an MQTT broker.

API documentation: updateNetworkSensorMqttBroker

Parameters:

  • network_id (str) –

    Network ID.

  • mqtt_broker_id (str) –

    Mqtt broker ID.

  • enabled (bool) –

    Set to true to enable MQTT broker for sensor network.

Returns:

  • NetworkSensorMqttBrokerResponse

    Successful operation.

Example API response
{
  "mqttBrokerId": "1234",
  "enabled": true
}