Skip to main content

MotionService

A list of all methods in the MotionService service. Click on the method name to view detailed information about that method.

MethodsDescription
get_motion_sensorsList all available motion sensors.
get_motion_sensorGet details of a single motion sensor from its given {motionId}.
update_motion_sensorUpdate a single motion sensor from its given {motionId}.

get_motion_sensors

List all available motion sensors.

  • HTTP Method: GET
  • Endpoint: /clip/v2/resource/motion

Return Type

GetMotionSensorsOkResponse

Example Usage Code Snippet

from open_hue import OpenHue, Environment

sdk = OpenHue(
api_key="YOUR_API_KEY",
api_key_header="YOUR_API_KEY_HEADER",
base_url=Environment.DEFAULT.value
)

result = sdk.motion.get_motion_sensors()

print(result)

get_motion_sensor

Get details of a single motion sensor from its given {motionId}.

  • HTTP Method: GET
  • Endpoint: /clip/v2/resource/motion/{motionId}

Parameters

NameTypeRequiredDescription
motion_idstrID of the motion sensor

Return Type

GetMotionSensorOkResponse

Example Usage Code Snippet

from open_hue import OpenHue, Environment

sdk = OpenHue(
api_key="YOUR_API_KEY",
api_key_header="YOUR_API_KEY_HEADER",
base_url=Environment.DEFAULT.value
)

result = sdk.motion.get_motion_sensor(motion_id="motionId")

print(result)

update_motion_sensor

Update a single motion sensor from its given {motionId}.

  • HTTP Method: PUT
  • Endpoint: /clip/v2/resource/motion/{motionId}

Parameters

NameTypeRequiredDescription
request_bodyMotionPutThe request body.
motion_idstrId of the motion sensor

Return Type

UpdateMotionSensorOkResponse

Example Usage Code Snippet

from open_hue import OpenHue, Environment
from open_hue.models import MotionPut

sdk = OpenHue(
api_key="YOUR_API_KEY",
api_key_header="YOUR_API_KEY_HEADER",
base_url=Environment.DEFAULT.value
)

request_body = MotionPut(
type_="type",
enabled=True,
sensitivity={
"sensitivity": 9
}
)

result = sdk.motion.update_motion_sensor(
request_body=request_body,
motion_id="motionId"
)

print(result)

Build Your Own SDKs with  liblab

Build developer friendly SDKs in minutes from your APIs

Start for Free →