Manage device channel security configuration: motion detection plan, motion detection sensitivity, and privacy mode (close camera) enable/disable. Supports both PaaS devices (productId empty) and IoT thing-model devices (productId non-empty). For thing-model devices, the skill prioritizes reading the product thing model and completes all device-related configuration based on that model definition (Property get/set, Service invoke).
Install dependency:
pip install requests
Set environment variables (required):
export IMOU_APP_ID="your_app_id"
export IMOU_APP_SECRET="your_app_secret"
export IMOU_BASE_URL="your_base_url"
API Base URL (IMOU_BASE_URL) (required; no default—must be set explicitly):
appId and appSecret from App Information.
appId and appSecret from App Information. See Development Specification.
| Region | Data Center | Base URL |
|----------------|-----------------|----------|
| Mainland China | — | https://openapi.lechange.cn |
| Overseas | East Asia | https://openapi-sg.easy4ip.com:443 |
| Overseas | Central Europe | https://openapi-fk.easy4ip.com:443 |
| Overseas | Western America | https://openapi-or.easy4ip.com:443 |
Run (PaaS devices, productId empty):
# Get motion detection plan for a channel
python3 {baseDir}/scripts/device_config.py plan get DEVICE_SERIAL CHANNEL_ID
# Set motion detection plan (rules: period, beginTime, endTime)
python3 {baseDir}/scripts/device_config.py plan set DEVICE_SERIAL CHANNEL_ID --rules '[...]'
# Set motion detection sensitivity (1-5, 1=lowest, 5=highest)
python3 {baseDir}/scripts/device_config.py sensitivity set DEVICE_SERIAL CHANNEL_ID 3
# Get privacy mode (closeCamera) status
python3 {baseDir}/scripts/device_config.py privacy get DEVICE_SERIAL CHANNEL_ID
# Set privacy mode on/off
python3 {baseDir}/scripts/device_config.py privacy set DEVICE_SERIAL CHANNEL_ID on
python3 {baseDir}/scripts/device_config.py privacy set DEVICE_SERIAL CHANNEL_ID off
IoT thing-model devices (productId not empty) – read product model first, then configure by model:
# Step 1: Read product thing model (required; get Property/Service refs from model)
python3 {baseDir}/scripts/device_config.py iot model PRODUCT_ID [--verbose] [--json]
# Step 2: Property get/set and service invoke based on model definition
# Get Property values (refs from model)
python3 {baseDir}/scripts/device_config.py iot property-get PRODUCT_ID DEVICE_SERIAL '["3301","3302"]' [--json]
# Set Property values
python3 {baseDir}/scripts/device_config.py iot property-set PRODUCT_ID DEVICE_SERIAL '{"3301":1,"3302":2}'
# Invoke Service (event/command)
python3 {baseDir}/scripts/device_config.py iot service PRODUCT_ID DEVICE_SERIAL SERVICE_REF [--content '{}']
getDeviceCameraStatus / setDeviceCameraStatus), deviceAlarmPlan, modifyDeviceAlarmPlan, setDeviceAlarmSensitivity. Only devices with accessType=PaaS support these.
iot model PRODUCT_ID). All device configuration (property query/set, event/command dispatch) is then performed based on the thing model definition: use Property refs and Service refs from the model for iot property-get, iot property-set, and iot service. Do not assume refs or capabilities; always resolve them from the product model.
All requests to Imou Open API must include the header Client-Type: OpenClaw for platform identification.
| API | Doc |
|-----|-----|
| Dev spec | https://open.imou.com/document/pages/c20750/ |
| Get accessToken | https://open.imou.com/document/pages/fef620/ |
| Enable definition | https://open.imou.com/document/pages/389c19/ |
| Set enable | https://open.imou.com/document/pages/8214a7/ |
| Get enable | https://open.imou.com/document/pages/2e535e/ |
| Get alarm plan | https://open.imou.com/document/pages/4d571d/ |
| Set alarm plan | https://open.imou.com/document/pages/542ccc/ |
| Set alarm sensitivity | https://open.imou.com/document/pages/83f1b4/ |
| IoT thing model overview | https://open.imou.com/document/pages/1acdf4/ |
| Get product model | https://open.imou.com/document/pages/2a238c/ |
| Get IoT Property | https://open.imou.com/document/pages/919bcf/ |
| Set IoT Property | https://open.imou.com/document/pages/532cdf/ |
| IoT Service | https://open.imou.com/document/pages/fa0726/ |
See references/imou-config-api.md for request/response formats.
closeCamera (channel scope). Motion enable uses motionDetect (channel). See enable definition doc for full list.
period (e.g. "Monday" or "Monday,Wednesday,Friday"), beginTime, endTime (HH:mm:ss).
iot model PRODUCT_ID); then use the model's Property/Service definitions (refs, dataTypes, inputData/outputData) for all get/set and service invoke. Do not hardcode refs across products.
content is input params by ref per model; use {} when the service has no input.
| Data | Sent to | Purpose |
|------|---------|--------|
| appId, appSecret | Imou Open API | Obtain accessToken |
| accessToken, deviceId, channelId, productId, etc. | Imou Open API | Get/set plan, sensitivity, enable; IoT model, property get/set, service invoke |
All requests go to the configured IMOU_BASE_URL. No other third parties.
共 1 个版本