Control Imou cloud devices: PTZ (pan-tilt-zoom) movement, device snapshot capture, and download snapshot image by URL.
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:
# Device snapshot (returns downloadable URL; optional save to file)
python3 {baseDir}/scripts/device_operate.py snapshot DEVICE_SERIAL CHANNEL_ID [--save PATH]
# PTZ move (operation: 0-10, duration in ms)
python3 {baseDir}/scripts/device_operate.py ptz DEVICE_SERIAL CHANNEL_ID OPERATION DURATION_MS
--save.
All requests to Imou Open API 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/ |
| Device snapshot (enhanced) | https://open.imou.com/document/pages/09fe83/ |
| PTZ move control | https://open.imou.com/document/pages/66c489/ |
See references/imou-operate-api.md for request/response formats.
| Data | Sent to | Purpose |
|------|---------|--------|
| appId, appSecret | Imou Open API | Obtain accessToken |
| accessToken, deviceId, channelId, etc. | Imou Open API | Snapshot, PTZ control |
All requests go to the configured IMOU_BASE_URL. No other third parties.
共 1 个版本