Appearance
traits/motion_sensor.proto
Table of Contents
traits/motion_sensor.proto
DescribeMotionDetectionRequest
Field | Type | Label | Description |
---|---|---|---|
name | string | The name of the device |
GetMotionDetectionRequest
request to fetch the current state of the device
Field | Type | Label | Description |
---|---|---|---|
name | string | the name for the device to get the detection state for | |
read_mask | google.protobuf.FieldMask | The state fields to fetch |
MotionDetection
the current state of the motion sensor
Field | Type | Label | Description |
---|---|---|---|
state | MotionDetection.State | has motion been detected or not | |
state_change_time | google.protobuf.Timestamp | The time the state last changed |
MotionDetectionSupport
MotionDetectionSupport describes the capabilities of devices implementing this trait
Field | Type | Label | Description |
---|---|---|---|
resource_support | smartcore.types.ResourceSupport | How a named device supports read/pull apis | |
not_detected_delay | google.protobuf.Duration | How long the device is configured to wait before reporting a state of NOT_DETECTED |
PullMotionDetectionRequest
request to be notified of changes to the state of the device
Field | Type | Label | Description |
---|---|---|---|
name | string | the name for the device to subscribe to | |
read_mask | google.protobuf.FieldMask | The state fields to fetch | |
updates_only | bool | When true the device will only send changes to the resource value. The default behaviour is to send the current value immediately followed by any updates as they happen. |
PullMotionDetectionResponse
response containing motion state changes
Field | Type | Label | Description |
---|---|---|---|
changes | PullMotionDetectionResponse.Change | repeated | the list of changes that have occurred since the last event |
PullMotionDetectionResponse.Change
A change to the motion state of the device
Field | Type | Label | Description |
---|---|---|---|
name | string | name for the device that issued the change | |
change_time | google.protobuf.Timestamp | when the change occurred | |
motion_detection | MotionDetection | the new state for the device |
MotionDetection.State
Possible states for motion detected
Name | Number | Description |
---|---|---|
STATE_UNSPECIFIED | 0 | The state has not been specified. |
NOT_DETECTED | 1 | No motion is detected, or has been detected within the not_detected_delay period |
DETECTED | 2 | Motion has been detected by the device. |
MotionSensorApi
Represents a sensor that detects motion. Note that the absence of motion does not directly imply an unoccupied space.
Method Name | Request Type | Response Type | Description |
---|---|---|---|
GetMotionDetection | GetMotionDetectionRequest | MotionDetection | Get the current motion state for the device. |
PullMotionDetections | PullMotionDetectionRequest | PullMotionDetectionResponse stream | subscribe to changes in the motion state for the device. |
MotionSensorSensorInfo
Describes the capabilities of a specific named device with respect to this trait.
Method Name | Request Type | Response Type | Description |
---|---|---|---|
DescribeMotionDetection | DescribeMotionDetectionRequest | MotionDetectionSupport | Get information about how a named device implements MotionDetection measurements |