miio.chuangmi_camera module

Xiaomi Chuangmi camera (chuangmi.camera.ipc009, ipc019) support.

class miio.chuangmi_camera.CameraStatus(data: Dict[str, Any])[source]

Bases: miio.device.DeviceStatus

Container for status reports from the Xiaomi Chuangmi Camera.

property flip: bool

Image 180 degrees flip status.

property full_color: bool

Full color with bad lighting conditions.

property improve_program: bool

Customer experience improvement program status.

property light: bool

Camera light status.

property max_client: int

Unknown.

property mini_level: int

Unknown.

property motion_record: bool

Motion record status.

property night_mode: int

Night mode.

property power: bool

Camera power.

property sdcard_status: int

SD card status.

property track: bool

Tracking status.

property watermark: bool

Apply watermark to video.

property wdr: bool

Wide dynamic range status.

class miio.chuangmi_camera.ChuangmiCamera(ip: Optional[str] = None, token: Optional[str] = None, start_id: int = 0, debug: int = 0, lazy_discover: bool = True, timeout: Optional[int] = None, *, model: Optional[str] = None)[source]

Bases: miio.device.Device

Main class representing the Xiaomi Chuangmi Camera.

alarm(*args, **kwargs)
clear_nas_dir(*args, **kwargs)
configure_wifi(ssid, password, uid=0, extra_params=None)

Configure the wifi settings.

flip_off(*args, **kwargs)
flip_on(*args, **kwargs)
full_color_off(*args, **kwargs)
full_color_on(*args, **kwargs)
classmethod get_device_group()
get_nas_config(*args, **kwargs)
get_properties(properties, *, property_getter='get_prop', max_properties=None)

Request properties in slices based on given max_properties.

This is necessary as some devices have limitation on how many properties can be queried at once.

If max_properties is None, all properties are requested at once.

Parameters
  • properties (list) – List of properties to query from the device.

  • max_properties (int) – Number of properties that can be requested at once.

:return List of property values.

improve_program_off(*args, **kwargs)
improve_program_on(*args, **kwargs)
info(*args, **kwargs)
light_off(*args, **kwargs)
light_on(*args, **kwargs)
motion_record_off(*args, **kwargs)
motion_record_on(*args, **kwargs)
motion_record_stop(*args, **kwargs)
night_mode_auto(*args, **kwargs)
night_mode_off(*args, **kwargs)
night_mode_on(*args, **kwargs)
off(*args, **kwargs)
on(*args, **kwargs)
raw_command(*args, **kwargs)
rotate(*args, **kwargs)
send(command: str, parameters: Optional[Any] = None, retry_count: Optional[int] = None, *, extra_parameters=None) Any

Send a command to the device.

Basic format of the request: {“id”: 1234, “method”: command, “parameters”: parameters}

extra_parameters allows passing elements to the top-level of the request. This is necessary for some devices, such as gateway devices, which expect the sub-device identifier to be on the top-level.

Parameters
  • command (str) – Command to send

  • parameters (dict) – Parameters to send

  • retry_count (int) – How many times to retry on error

  • extra_parameters (dict) – Extra top-level parameters

  • model (str) – Force model to avoid autodetection

send_handshake()

Send initial handshake to the device.

set_home_monitoring_config(*args, **kwargs)
set_motion_sensitivity(*args, **kwargs)
set_nas_config(*args, **kwargs)
status(*args, **kwargs)
test_properties(*args, **kwargs)
update(url: str, md5: str)

Start an OTA update.

update_progress() int

Return current update progress [0-100].

update_state()

Return current update state.

watermark_off(*args, **kwargs)
watermark_on(*args, **kwargs)
wdr_off(*args, **kwargs)
wdr_on(*args, **kwargs)
property device_id: int

Return device id (did), if available.

property model: str

Return device model.

property raw_id: int

Return the last used protocol sequence id.

retry_count = 3
supported_models = ['chuangmi.camera.ipc009', 'chuangmi.camera.ipc019', 'chuangmi.camera.038a2']
timeout = 5
class miio.chuangmi_camera.Direction(value)[source]

Bases: enum.Enum

Rotation direction.

Down = 4
Left = 1
Right = 2
Up = 3
class miio.chuangmi_camera.HomeMonitoringMode(value)[source]

Bases: enum.IntEnum

Home monitoring mode.

AllDay = 1
Custom = 2
Off = 0
class miio.chuangmi_camera.MotionDetectionSensitivity(value)[source]

Bases: enum.IntEnum

Motion detection sensitivity.

High = 3
Low = 1
class miio.chuangmi_camera.NASState(value)[source]

Bases: enum.IntEnum

NAS state.

Off = 2
On = 3
class miio.chuangmi_camera.NASSyncInterval(value)[source]

Bases: enum.IntEnum

NAS sync interval.

Day = 86400
Hour = 3600
Realtime = 300
class miio.chuangmi_camera.NASVideoRetentionTime(value)[source]

Bases: enum.IntEnum

NAS video retention time.

HalfYear = 15552000
Month = 2592000
Quarter = 7776000
Week = 604800
Year = 31104000