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
getMotionSensorsList all available motion sensors.
getMotionSensorGet details of a single motion sensor from its given {motionId}.
updateMotionSensorUpdate a single motion sensor from its given {motionId}.

getMotionSensors

List all available motion sensors.

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

Return Type

GetMotionSensorsOkResponse

Example Usage Code Snippet

import { OpenHue } from 'open-hue';

(async () => {
const openHue = new OpenHue({
apiKey: 'YOUR_API_KEY',
});

const { data } = await openHue.motion.getMotionSensors();

console.log(data);
})();

getMotionSensor

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

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

Parameters

NameTypeRequiredDescription
motionIdstringID of the motion sensor

Return Type

GetMotionSensorOkResponse

Example Usage Code Snippet

import { OpenHue } from 'open-hue';

(async () => {
const openHue = new OpenHue({
apiKey: 'YOUR_API_KEY',
});

const { data } = await openHue.motion.getMotionSensor('motionId');

console.log(data);
})();

updateMotionSensor

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

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

Parameters

NameTypeRequiredDescription
bodyMotionPutThe request body.
motionIdstringId of the motion sensor

Return Type

UpdateMotionSensorOkResponse

Example Usage Code Snippet

import { MotionPut, OpenHue } from 'open-hue';

(async () => {
const openHue = new OpenHue({
apiKey: 'YOUR_API_KEY',
});

const motionPutSensitivity: MotionPutSensitivity = {
sensitivity: 9,
};

const input: MotionPut = {
type_: 'type',
enabled: true,
sensitivity: motionPutSensitivity,
};

const { data } = await openHue.motion.updateMotionSensor('motionId', input);

console.log(data);
})();

Build Your Own SDKs with  liblab

Build developer friendly SDKs in minutes from your APIs

Start for Free →