Web Client¶
- class wyze_sdk.api.Client(token: str | None = None, refresh_token: str | None = None, email: str | None = None, password: str | None = None, key_id: str | None = None, api_key: str | None = None, totp_key: str | None = None, base_url: str | None = None, timeout: int = 30)¶
A Wyze Client is the wrapper on top of Wyze endpoints and allows apps to communicate with the various Wyze API platforms.
The Wyze API is an interface for querying information from and enacting change on Wyze devices.
This client handles constructing and sending HTTP requests to Wyze as well as parsing any responses received into a WyzeResponse.
>>> import os >>> from wyze_sdk import Client >>> client = Client(email=os.environ['WYZE_EMAIL'], password=os.environ['WYZE_PASSWORD']) >>> response = client.bulbs.turn_on( >>> device_mac='ABCDEF1234567890', >>> device_model='WLPA19C')
Note
Any attributes or methods prefixed with _underscores are intended to be “private” internal use only. They may be changed or removed at anytime.
- api_test(api_method: str = 'api.test', *, http_verb: str = 'POST', **kwargs) WyzeResponse ¶
Checks API calling code
- Return type:
- property bulbs: BulbsClient¶
- property cameras: CamerasClient¶
- change_password(*, new_password: str, old_password: str | None, **kwargs) WyzeResponse ¶
Changes the current user’s password.
- Return type:
- devices_list(**kwargs) Sequence[Device] ¶
List the devices available to the current user
- Return type:
Sequence[Device]
- property entry_sensors: ContactSensorsClient¶
- property events: EventsClient¶
- property locks: LocksClient¶
- login(email: str | None = None, password: str | None = None, key_id: str | None = None, api_key: str | None = None, totp_key: str | None = None) WyzeResponse ¶
Exchanges email and password for an
access_token
and arefresh_token
, which are stored in this client. The tokens will be used for all subsequent requests made by thisClient
unlessrefresh_token()
is called.- Return type:
- Raises:
WyzeClientConfigurationError – If
access_token
is already set or bothemail
andpassword
are not set.
- logout() WyzeResponse ¶
Destroys the current user’s session.
- Return type:
- property motion_sensors: MotionSensorsClient¶
- property plugs: PlugsClient¶
- refresh_token() WyzeResponse ¶
Updates
access_token
using the previously setrefresh_token
.- Return type:
- Raises:
WyzeClientConfigurationError – If
refresh_token
is not already set.
- property scales: ScalesClient¶
- property switches: SwitchesClient¶
- property thermostats: ThermostatsClient¶
- timeout¶
The maximum number of seconds the client will wait to connect and receive a response from Wyze. Defaults to 30
- user_get_info() WyzeResponse ¶
Retrieves the current user’s info.
- Return type:
- user_get_profile() WyzeResponse ¶
Retrieves the current user’s profile
- Return type:
- property vacuums: VacuumsClient¶
Bulbs¶
- class wyze_sdk.api.devices.bulbs.BulbsClient(token: str | None = None, user_id: str | None = None, base_url: str | None = None, logger: ~logging.Logger = <Logger wyze_sdk.api.base (WARNING)>, **kwargs)¶
Bases:
BaseClient
A Client that services Wyze bulbs/lights.
- LIGHT_STRIP_PRO_SUBSECTION_COUNT = 16¶
- clear_timer(*, device_mac: str, device_model: str, **kwargs) WyzeResponse ¶
Clears any existing power state timer on the bulb.
- Parameters:
device_mac (str) – The device mac. e.g.
ABCDEF1234567890
device_model (str) – The device model. e.g.
WLPA19
- Return type:
- info(*, device_mac: str, **kwargs) BaseBulb | None ¶
Retrieves details of a bulb.
- Parameters:
device_mac (str) – The device mac. e.g.
ABCDEF1234567890
- Return type:
Optional[BaseBulb]
- set_away_mode(*, device_mac: str, device_model: str, away_mode: bool = True, **kwargs) WyzeResponse ¶
Sets away/vacation mode for a bulb.
- Parameters:
device_mac (str) – The device mac. e.g.
ABCDEF1234567890
device_model (str) – The device model. e.g.
WLPA19
away_mode (bool) – The new away mode. e.g.
True
- Return type:
- set_brightness(*, device_mac: str, device_model: str, brightness: int, **kwargs) WyzeResponse ¶
Sets the brightness of a bulb.
- Parameters:
device_mac (str) – The device mac. e.g.
ABCDEF1234567890
device_model (str) – The device model. e.g.
WLPA19
brightness (int) – The new brightness. e.g.
45
- Return type:
- Raises:
WyzeRequestError – if the new brightness is not valid
- set_color(*, device_mac: str, device_model: str, color: str | Sequence[str], **kwargs) WyzeResponse ¶
Sets the color of a bulb.
For Light Strip Pro devices, this color can be a list of 16 colors that will be used to set the value for each subsection of the light strip. The list is ordered like: `` 15 14 13 12
8 9 10 11 7 6 5 4 0 1 2 3
- Args:
- param str device_mac:
The device mac. e.g.
ABCDEF1234567890
- param str device_model:
The device model. e.g.
WLPA19
- param color:
The new color(s). e.g.
ff0000
or['ff0000', '00ff00', ...]
- type color:
Union[str, Sequence[str]]
- Return type:
- Raises:
WyzeFeatureNotSupportedError – If the bulb doesn’t support color or color is a list and the bulb doesn’t support color sections
- set_color_temp(*, device_mac: str, device_model: str, color_temp: int, **kwargs) WyzeResponse ¶
Sets the color temperature of a bulb.
- Args:
- param str device_mac:
The device mac. e.g.
ABCDEF1234567890
- param str device_model:
The device model. e.g.
WLPA19
- param int color_temp:
The new color temperature. e.g.
3400
- Return type:
- Raises:
WyzeRequestError – if the new color temperature is not valid
- set_effect(*, device_mac: str, device_model: str, effect: LightVisualEffect, **kwargs) WyzeResponse ¶
Sets the visual/sound effect for a light.
- Args:
- param str device_mac:
The device mac. e.g.
ABCDEF1234567890
- param str device_model:
The device model. e.g.
WLPA19
- param str LightVisualEffect:
The new visual effect definition.
- Return type:
- Raises:
WyzeFeatureNotSupportedError – If the light doesn’t support effects
- set_sun_match(*, device_mac: str, device_model: str, sun_match: bool = True, **kwargs) WyzeResponse ¶
Sets sunlight matching to mimic natural sunlight for a bulb.
- Parameters:
device_mac (str) – The device mac. e.g.
ABCDEF1234567890
device_model (str) – The device model. e.g.
WLPA19
sun_match (bool) – The new sun match. e.g.
True
- Return type:
- turn_off(*, device_mac: str, device_model: str, after: timedelta | None = None, **kwargs) WyzeResponse ¶
Turns off a bulb.
- Parameters:
device_mac (str) – The device mac. e.g.
ABCDEF1234567890
device_model (str) – The device model. e.g.
WLPA19
after (timedelta) – The delay before performing the action.
- Return type:
- turn_on(*, device_mac: str, device_model: str, after: timedelta | None = None, **kwargs) WyzeResponse ¶
Turns on a bulb.
- Parameters:
device_mac (str) – The device mac. e.g.
ABCDEF1234567890
device_model (str) – The device model. e.g.
WLPA19
after (Optional[timedelta]) – The delay before performing the action.
- Return type:
Cameras¶
- class wyze_sdk.api.devices.cameras.CamerasClient(token: str | None = None, user_id: str | None = None, base_url: str | None = None, logger: ~logging.Logger = <Logger wyze_sdk.api.base (WARNING)>, **kwargs)¶
Bases:
BaseClient
A Client that services Wyze cameras.
- Methods:
list: Lists all cameras available to a Wyze account info: Retrieves details of a camera turn_on: Turns on a camera turn_off: Turns off a camera
- info(*, device_mac: str, **kwargs) Camera | None ¶
Retrieves details of a camera.
- Args:
- param str device_mac:
The device mac. e.g. ‘ABCDEF1234567890’
- Returns:
(Optional[Camera])
- restart(*, device_mac: str, device_model: str, **kwargs) WyzeResponse ¶
Restarts a camera.
- Args:
- param str device_mac:
The device mac. e.g. ‘ABCDEF1234567890’
- param str device_model:
The device model. e.g. ‘WYZEC1-JZ’
- turn_off(*, device_mac: str, device_model: str, **kwargs) WyzeResponse ¶
Turns off a camera.
- Args:
- param str device_mac:
The device mac. e.g. ‘ABCDEF1234567890’
- param str device_model:
The device model. e.g. ‘WYZEC1-JZ’
- turn_on(*, device_mac: str, device_model: str, **kwargs) WyzeResponse ¶
Turns on a camera.
- Args:
- param str device_mac:
The device mac. e.g. ‘ABCDEF1234567890’
- param str device_model:
The device model. e.g. ‘WYZEC1-JZ’
Locks¶
- class wyze_sdk.api.devices.locks.LocksClient(token: str | None = None, user_id: str | None = None, base_url: str | None = None, logger: ~logging.Logger = <Logger wyze_sdk.api.base (WARNING)>, **kwargs)¶
Bases:
BaseLockClient
A Client that services Wyze locks.
- create_access_code(device_mac: str, access_code: str, name: str | None, permission: LockKeyPermission | None = None, periodicity: LockKeyPeriodicity | None = None, **kwargs) WyzeResponse ¶
Creates a guest access code on a lock.
- Parameters:
device_mac (str) – The device mac. e.g.
ABCDEF1234567890
access_code (str) – The new access code. e.g.
1234
name (str) – The name for the guest access code.
permission (LockKeyPermission) – The access permission rules for the guest access code.
periodicity (Optional[LockKeyPeriodicity]) – The recurrance rules for a recurring guest access code.
- Return type:
- Raises:
WyzeRequestError – if the new access code is not valid
- delete_access_code(device_mac: str, access_code_id: int, **kwargs) WyzeResponse ¶
Deletes an access code from a lock.
- Parameters:
device_mac (str) – The device mac. e.g.
ABCDEF1234567890
access_code_id (int) – The id of the access code to delete.
- Return type:
- property gateways: LockGatewaysClient¶
Returns a lock gateway client.
- Return type:
LockGatewaysClient
- get_keys(*, device_mac: str, **kwargs) Sequence[LockKey] ¶
Retrieves keys for a lock.
Args: :param str device_mac: The device mac. e.g.
ABCDEF1234567890
- Return type:
Sequence[LockKey]
- get_records(*, device_mac: str, limit: int = 20, since: datetime, until: datetime | None = None, offset: int = 0, **kwargs) Sequence[LockRecord] ¶
Retrieves event history records for a lock.
Note
The results are queried and returned in reverse-chronological order.
Args: :param str device_mac: The device mac. e.g.
ABCDEF1234567890
:param datetime since: The starting datetime of the query i.e., the most recent datetime for returned records :param datetime until: The ending datetime of the query i.e., the oldest allowed datetime for returned records. This parameter is optional and defaults toNone
:param int limit: The maximum number of records to return. Defaults to20
:param int offset: The number of records to skip when querying. Defaults to0
- Return type:
Sequence[LockRecord]
- info(*, device_mac: str, **kwargs) Lock | None ¶
Retrieves details of a lock.
- Parameters:
device_mac (str) – The device mac. e.g.
ABCDEF1234567890
- Return type:
Optional[Lock]
- list(**kwargs) Sequence[Lock] ¶
Lists all locks available to a Wyze account.
- Return type:
Sequence[Lock]
- lock(device_mac: str, **kwargs) WyzeResponse ¶
Locks a lock.
- Parameters:
device_mac (str) – The device mac. e.g.
ABCDEF1234567890
- Return type:
- unlock(device_mac: str, **kwargs) WyzeResponse ¶
Unlocks a lock.
- Parameters:
device_mac (str) – The device mac. e.g.
ABCDEF1234567890
- Return type:
- update_access_code(device_mac: str, access_code_id: int, access_code: str | None = None, name: str | None = None, permission: LockKeyPermission | None = None, periodicity: LockKeyPeriodicity | None = None, **kwargs) WyzeResponse ¶
Updates an existing access code on a lock.
- Parameters:
device_mac (str) – The device mac. e.g.
ABCDEF1234567890
access_code_id (int) – The id of the access code to reset.
access_code (Optional[str]) – The new access code. e.g.
1234
name (Optional[str]) – The new name for the guest access code.
permission (LockKeyPermission) – The access permission rules for the guest access code.
periodicity (Optional[LockKeyPeriodicity]) – The recurrance rules for a recurring guest access code.
- Return type:
- Raises:
WyzeRequestError – if the new access code is not valid
Plugs¶
- class wyze_sdk.api.devices.plugs.PlugsClient(token: str | None = None, user_id: str | None = None, base_url: str | None = None, logger: ~logging.Logger = <Logger wyze_sdk.api.base (WARNING)>, **kwargs)¶
Bases:
BaseClient
A Client that services Wyze plugs/outlets.
- clear_timer(*, device_mac: str, **kwargs) WyzeResponse ¶
Clears any existing power state timer on the plug.
- Parameters:
device_mac (str) – The device mac. e.g.
ABCDEF1234567890
- get_usage_records(*, device_mac: str, device_model: str, start_time: datetime, end_time: datetime | None = datetime.datetime(2024, 1, 21, 19, 29, 47, 337791), **kwargs) Sequence[PlugUsageRecord] ¶
Gets usage records for a plug.
Note: For outdoor or multi-socket plugs, you must use the parent (combined) device id.
- Parameters:
device_mac (str) – The device mac. e.g.
ABCDEF1234567890
device_model (str) – The device model. e.g.
WLPP1
start_time (datetime) – The ending datetime of the query i.e., the oldest allowed datetime for returned records
end_time (datetime) – The starting datetime of the query i.e., the most recent datetime for returned records. This parameter is optional and defaults to
None
- Return type:
- info(*, device_mac: str, **kwargs) Plug | None ¶
Retrieves details of a plug.
- Parameters:
device_mac (str) – The device mac. e.g.
ABCDEF1234567890
- Return type:
Optional[Plug]
- set_away_mode(*, device_mac: str, device_model: str, away_mode: bool = True, **kwargs) WyzeResponse ¶
Sets away/vacation mode for a plug.
- Parameters:
device_mac (str) – The device mac. e.g.
ABCDEF1234567890
device_model (str) – The device model. e.g.
WLPP1
away_mode (bool) – The new away mode. e.g.
True
- turn_off(*, device_mac: str, device_model: str, after: timedelta | None = None, **kwargs) WyzeResponse ¶
Turns off a plug.
- Parameters:
device_mac (str) – The device mac. e.g.
ABCDEF1234567890
device_model (str) – The device model. e.g.
WLPP1
after (Optional[timedelta]) – The delay before performing the action.
- Return type:
- turn_on(*, device_mac: str, device_model: str, after: timedelta | None = None, **kwargs) WyzeResponse ¶
Turns on a plug.
- Parameters:
device_mac (str) – The device mac. e.g.
ABCDEF1234567890
device_model (str) – The device model. e.g.
WLPP1
after (Optional[timedelta]) – The delay before performing the action.
- Return type:
Scales¶
- class wyze_sdk.api.devices.scales.ScalesClient(token: str | None = None, user_id: str | None = None, base_url: str | None = None, logger: ~logging.Logger = <Logger wyze_sdk.api.base (WARNING)>, **kwargs)¶
Bases:
BaseClient
A Client that services Wyze scales.
- add_weight_record(*, device_mac: str, mac: str, user_id: str, measure_ts: datetime, measure_type: int = 1, weight: float, **kwargs) WyzeResponse ¶
Creates a standard weight event history record for a user.
- Parameters:
device_mac (str) – The device mac. e.g.
JA.SC2.ABCDEF1234567890
mac (str) – The device mac, without the leading product model identifier. e.g.
ABCDEF1234567890
user_id (str) – The user id. e.g.
abcdef1234567890abcdef1234567890
measure_ts (datetime) – The timestamp of the record.
measure_type (int) – The measurement type. e.g.
1
weight (float) – The new weight in kg. e.g.
117.3
- Return type:
- delete_goal_weight(*, user_id: str | None = None, **kwargs) WyzeResponse ¶
Deletes a user’s goal weight, if one exists.
- Parameters:
user_id (str) – The user id. e.g.
abcdef1234567890abcdef1234567890
. Defaults toNone
, which assumes the current user.- Return type:
- delete_record(*, data_id=typing.Union[int, typing.Sequence[int]], **kwargs) WyzeResponse ¶
Deletes a scale event history record.
- Parameters:
data_id (Union[int, Sequence[int]]) – The data ids. e.g.
1234567890
- Return type:
- get_goal_weight(*, device_model: str | None = 'JA.SC', user_id: str | None = None, **kwargs) UserGoalWeight ¶
Retrieves a user’s goal weight.
- Parameters:
user_id (str) – The user id. e.g.
abcdef1234567890abcdef1234567890
- Return type:
- get_records(*, device_model: str | None = 'JA.SC', user_id: str | None = None, start_time: datetime, end_time: datetime | None = datetime.datetime(2024, 1, 21, 19, 29, 47, 339736), **kwargs) Sequence[ScaleRecord] ¶
Retrieves a user’s scale event history records.
Note
The results are queried and returned in reverse-chronological order
- Parameters:
user_id (str) – The user id. e.g.
abcdef1234567890abcdef1234567890
. Defaults toNone
, which assumes the current user.start_time (datetime) – The ending datetime of the query i.e., the oldest allowed datetime for returned records
end_time (datetime) – The starting datetime of the query i.e., the most recent datetime for returned records. This parameter is optional and defaults to
None
- Return type:
Sequence[ScaleRecord]
- info(*, device_mac: str, **kwargs) Scale | None ¶
Retrieves details of a scale.
- Parameters:
device_mac (str) – The device mac. e.g.
ABCDEF1234567890
- Return type:
Optional[Scale]
- Raises:
WyzeFeatureNotSupportedError – If the scale model isn’t supported
- list(**kwargs) Sequence[Scale] ¶
Lists all scales available to a Wyze account.
- Return type:
Sequence[Scale]
- set_unit(*, device_mac: str, device_model: str, firmware_ver: str, mac: str, unit: str, broadcast: int, **kwargs) WyzeResponse ¶
Sets the weight/mass unit for the scale.
Args: :param str device_mac: The device mac. e.g.
JA.SC2.ABCDEF1234567890
:param str mac: The device mac, without the leading product model identifier. e.g.ABCDEF1234567890
:param str device_model: The device model. e.g.JA.SC2
:param str firmware_ver: The firmware version. e.g. ‘’ :param str unit: The new unit. e.g.kg
:param int broadcast: The broadcast. e.g.1
- Raises:
WyzeRequestError – if the new unit is not
kg
orlb
- Return type:
Sensors¶
Contact Sensors¶
- class wyze_sdk.api.devices.sensors.ContactSensorsClient(token: str | None = None, user_id: str | None = None, base_url: str | None = None, logger: ~logging.Logger = <Logger wyze_sdk.api.base (WARNING)>, **kwargs)¶
Bases:
SensorsClient
A Client that services Wyze Sense contact sensors.
- info(*, device_mac: str, **kwargs) ContactSensor | None ¶
Retrieves details of a contact sensor.
- Parameters:
device_mac (str) – The device mac. e.g.
ABCDEF1234567890
- Return type:
Optional[ContactSensor]
- list() Sequence[ContactSensor] ¶
Lists all contact sensors available to a Wyze account.
- Return type:
Sequence[ContactSensor]
Entry Sensors¶
- class wyze_sdk.api.devices.sensors.MotionSensorsClient(token: str | None = None, user_id: str | None = None, base_url: str | None = None, logger: ~logging.Logger = <Logger wyze_sdk.api.base (WARNING)>, **kwargs)¶
Bases:
SensorsClient
A Client that services Wyze Sense motion sensors.
- info(*, device_mac: str, **kwargs) MotionSensor | None ¶
Retrieves details of a motion sensor.
- Parameters:
device_mac (str) – The device mac. e.g.
ABCDEF1234567890
- Return type:
Optional[MotionSensor]
- list() Sequence[MotionSensor] ¶
Lists all motion sensors available to a Wyze account.
- Return type:
Sequence[MotionSensor]
Switches¶
- class wyze_sdk.api.devices.switches.SwitchesClient(token: str | None = None, user_id: str | None = None, base_url: str | None = None, logger: ~logging.Logger = <Logger wyze_sdk.api.base (WARNING)>, **kwargs)¶
Bases:
BaseClient
A Client that services Wyze switches.
- clear_timer(*, device_mac: str, device_model: str, **kwargs) WyzeResponse ¶
Clears any existing power state timer on the switch.
- Parameters:
device_mac (str) – The device mac. e.g.
LD_SS1_ABCDEF1234567890
device_model (str) – The device model. e.g.
LD_SS1
- info(*, device_mac: str, **kwargs) Switch | None ¶
Retrieves details of a switch.
- Parameters:
device_mac (str) – The device mac. e.g.
LD_SS1_ABCDEF1234567890
- Return type:
Optional[Switch]
- list(**kwargs) Sequence[Switch] ¶
Lists all switches available to a Wyze account.
- Return type:
Sequence[Switch]
- set_away_mode(*, device_mac: str, device_model: str, away_mode: bool = True, **kwargs) WyzeResponse ¶
Sets away/vacation mode for a switch.
- Parameters:
device_mac (str) – The device mac. e.g.
LD_SS1_ABCDEF1234567890
device_model (str) – The device model. e.g.
LD_SS1
away_mode (bool) – The new away mode. e.g.
True
- turn_off(*, device_mac: str, device_model: str, after: timedelta | None = None, **kwargs) WyzeResponse ¶
Turns off a switch.
- Parameters:
device_mac (str) – The device mac. e.g.
LD_SS1_ABCDEF1234567890
device_model (str) – The device model. e.g.
LD_SS1
after (Optional[timedelta]) – The delay before performing the action.
- Return type:
- turn_on(*, device_mac: str, device_model: str, after: timedelta | None = None, **kwargs) WyzeResponse ¶
Turns on a switch.
- Parameters:
device_mac (str) – The device mac. e.g.
LD_SS1_ABCDEF1234567890
device_model (str) – The device model. e.g.
LD_SS1
after (Optional[timedelta]) – The delay before performing the action.
- Return type:
Thermostats¶
- class wyze_sdk.api.devices.thermostats.ThermostatsClient(token: str | None = None, user_id: str | None = None, base_url: str | None = None, logger: ~logging.Logger = <Logger wyze_sdk.api.base (WARNING)>, **kwargs)¶
Bases:
BaseClient
A Client that services Wyze thermostats.
- clear_hold(*, device_mac: str, device_model: str, **kwargs) WyzeResponse ¶
Clears any existing hold on the thermostat and resumes “smart” operations.
- Parameters:
device_mac (str) – The device mac. e.g.
CO_EA1_ABCDEF1234567890
device_model (str) – The device model. e.g.
CO_EA1
- Return type:
- get_sensors(*, device_mac: str, device_model: str, **kwargs) Sequence[RoomSensor] ¶
Retrieves room sensors associated with a thermostat.
Args: :param str device_mac: The device mac. e.g.
ABCDEF1234567890
:param str device_model: The device model. e.g.CO_EA1
- Return type:
Sequence[RoomSensor]
- hold(*, device_mac: str, device_model: str, until: datetime, **kwargs) WyzeResponse ¶
Holds the current thermostat settings until a certain date/time.
- Parameters:
device_mac (str) – The device mac. e.g.
CO_EA1_ABCDEF1234567890
device_model (str) – The device model. e.g.
CO_EA1
until (datetime) – The new end date/time of the hold.
- Return type:
- info(*, device_mac: str, **kwargs) Thermostat | None ¶
Retrieves details of a thermostat.
- Parameters:
device_mac (str) – The device mac. e.g.
CO_EA1_ABCDEF1234567890
- Return type:
Optional[Thermostat]
- list(**kwargs) Sequence[Thermostat] ¶
Lists all thermostats available to a Wyze account.
- Return type:
Sequence[Thermostat]
- set_behavior(*, device_mac: str, device_model: str, behavior: int, **kwargs) WyzeResponse ¶
Sets the comfort balance behavior for a thermostat.
This setting allows the user to toggle between preset behaviors for weighing cost savings vs. climate comfort. An update to this property will modify the device’s scenario setpoints.
- Parameters:
device_mac (str) – The device mac. e.g.
CO_EA1_ABCDEF1234567890
device_model (str) – The device model. e.g.
CO_EA1
behavior (int) – The new behavior. e.g.
1
- Return type:
- set_cooling_setpoint(*, device_mac: str, device_model: str, cooling_setpoint: int, **kwargs) WyzeResponse ¶
Sets the cooling setpoint of the thermostat.
- Parameters:
device_mac (str) – The device mac. e.g.
CO_EA1_ABCDEF1234567890
device_model (str) – The device model. e.g.
CO_EA1
cooling_setpoint (int) – The new cooling setpoint. e.g.
72
- Return type:
- set_current_scenario(*, device_mac: str, device_model: str, scenario: ThermostatScenarioType, **kwargs) WyzeResponse ¶
Sets the current scenario of the thermostat.
- Parameters:
device_mac (str) – The device mac. e.g.
CO_EA1_ABCDEF1234567890
device_model (str) – The device model. e.g.
CO_EA1
scenario (ThermostatScenarioType) – The new scenario. e.g.
ThermostatScenarioType.HOME
- Return type:
- set_fan_mode(*, device_mac: str, device_model: str, fan_mode: ThermostatFanMode, **kwargs) WyzeResponse ¶
Sets the fan mode of the thermostat.
- Parameters:
device_mac (str) – The device mac. e.g.
CO_EA1_ABCDEF1234567890
device_model (str) – The device model. e.g.
CO_EA1
fan_mode (ThermostatFanMode) – The new fan mode. e.g.
ThermostatFanMode.CYCLE
- Return type:
- set_heating_setpoint(*, device_mac: str, device_model: str, heating_setpoint: int, **kwargs) WyzeResponse ¶
Sets the heating setpoint of the thermostat.
- Parameters:
device_mac (str) – The device mac. e.g.
CO_EA1_ABCDEF1234567890
device_model (str) – The device model. e.g.
CO_EA1
heating_setpoint (int) – The new heating setpoint. e.g.
68
- Return type:
- set_lock(*, device_mac: str, device_model: str, locked: bool | int, **kwargs) WyzeResponse ¶
Sets the device lock for a thermostat.
If set, the thermostat can only be updated via the app and not by using the physical controls.
- Parameters:
device_mac (str) – The device mac. e.g.
CO_EA1_ABCDEF1234567890
device_model (str) – The device model. e.g.
CO_EA1
(int) (int locked) – The new locked state. e.g.
1
- Return type:
- set_mode(*, device_mac: str, device_model: str, system_mode: ThermostatSystemMode, fan_mode: ThermostatFanMode, **kwargs) WyzeResponse ¶
Sets the system and fan modes of the thermostat.
Note
Fan mode and system mode cannot be set independently via this method.
- Parameters:
device_mac (str) – The device mac. e.g.
CO_EA1_ABCDEF1234567890
device_model (str) – The device model. e.g.
CO_EA1
system_mode (ThermostatSystemMode) – The new system mode. e.g.
ThermostatSystemMode.AUTO
fan_mode (ThermostatFanMode) – The new fan mode. e.g.
ThermostatFanMode.CYCLE
- Return type:
- set_system_mode(*, device_mac: str, device_model: str, system_mode: ThermostatSystemMode, **kwargs) WyzeResponse ¶
Sets the system mode of the thermostat.
- Parameters:
device_mac (str) – The device mac. e.g.
CO_EA1_ABCDEF1234567890
device_model (str) – The device model. e.g.
CO_EA1
system_mode (ThermostatSystemMode) – The new system mode. e.g.
ThermostatSystemMode.AUTO
- Return type:
- set_temperature(*, device_mac: str, device_model: str, cooling_setpoint: int, heating_setpoint: int, **kwargs) WyzeResponse ¶
Sets the heating and cooling setpoints of the thermostat.
Note
Heating and cooling setpoints cannot be set independently via this method.
- Parameters:
device_mac (str) – The device mac. e.g.
CO_EA1_ABCDEF1234567890
device_model (str) – The device model. e.g.
CO_EA1
cooling_setpoint (int) – The new cooling setpoint. e.g.
72
heating_setpoint (int) – The new heating setpoint. e.g.
68
- Return type:
Vacuums¶
- class wyze_sdk.api.devices.vacuums.VacuumsClient(token: str | None = None, user_id: str | None = None, base_url: str | None = None, logger: ~logging.Logger = <Logger wyze_sdk.api.base (WARNING)>, **kwargs)¶
Bases:
BaseClient
A Client that services Wyze Robot Vacuums.
- cancel(*, device_mac: str, **kwargs) WyzeResponse ¶
Prevents the vacuum from resuming an unfinished cleaning action after charging.
- Parameters:
device_mac (str) – The device mac. e.g.
JA_RO2_ABCDEF1234567890
- Return type:
- Raises:
WyzeRequestError – If the device is not in a cancelable state
- clean(*, device_mac: str, **kwargs) WyzeResponse ¶
Starts a new cleaning action or resumes a paused cleaning.
- Parameters:
device_mac (str) – The device mac. e.g.
JA_RO2_ABCDEF1234567890
device_model (str) – The device model. e.g.
JA_RO2
DEPRECATED
- Return type:
- dock(*, device_mac: str, **kwargs) WyzeResponse ¶
Docks the vacuum.
- Parameters:
device_mac (str) – The device mac. e.g.
JA_RO2_ABCDEF1234567890
device_model (str) – The device model. e.g.
JA_RO2
DEPRECATED
- Return type:
- Raises:
WyzeRequestError – If the device is already docked
- get_maps(*, device_mac: str, **kwargs) Sequence[VacuumMapSummary] ¶
Retrieves defined maps for a vacuum.
- Parameters:
device_mac (str) – The device mac. e.g.
JA_RO2_ABCDEF1234567890
- Return type:
Sequence[VacuumMapSummary]
- get_sweep_records(*, device_mac: str, limit: int = 20, since: datetime, **kwargs) Sequence[VacuumSweepRecord] ¶
Retrieves event history records for a vacuum.
The results are queried and returned in reverse-chronological order.
- Parameters:
device_mac (str) – The device mac. e.g.
JA_RO2_ABCDEF1234567890
limit (int) – The maximum number of records to return. Defaults to
20
since (datetime) – The starting datetime of the query i.e., the most recent datetime for returned records. This parameter is optional and defaults to
None
- Return type:
Sequence[VacuumSweepRecord]
- info(*, device_mac: str, **kwargs) Vacuum | None ¶
Retrieves details of a vacuum.
- Parameters:
device_mac (str) – The device mac. e.g.
JA_RO2_ABCDEF1234567890
- Return type:
Optional[Vacuum]
- list(**kwargs) Sequence[Vacuum] ¶
Lists all vacuums available to a Wyze account.
- Return type:
Sequence[Vacuum]
- pause(*, device_mac: str, **kwargs) WyzeResponse ¶
Pauses the vacuum’s current cleaning action.
- Parameters:
device_mac (str) – The device mac. e.g.
JA_RO2_ABCDEF1234567890
device_model (str) – The device model. e.g.
JA_RO2
DEPRECATED
- Return type:
- Raises:
WyzeRequestError – If the device is already idle.
- set_current_map(*, device_mac: str, map_id: int, **kwargs) WyzeResponse ¶
Sets the current map of a vacuum.
- Args:
- param str device_mac:
The device mac. e.g.
JA_RO2_ABCDEF1234567890
- param int map_id:
The new current map id. e.g.
12345678
- Return type:
- set_suction_level(*, device_mac: str, device_model: str, suction_level: VacuumSuctionLevel, **kwargs) WyzeResponse ¶
Sets the suction level of a vacuum.
- Parameters:
device_mac (str) – The device mac. e.g.
JA_RO2_ABCDEF1234567890
device_model (str) – The device model. e.g.
JA_RO2
suction_level (VacuumSuctionLevel) – The new suction level. e.g.
VacuumSuctionLevel.QUIET
- Return type:
- stop(*, device_mac: str, **kwargs) WyzeResponse ¶
Stops the vacuum on its way to the charging dock.
- Parameters:
device_mac (str) – The device mac. e.g.
JA_RO2_ABCDEF1234567890
- Return type:
- Raises:
WyzeRequestError – If the device is not in a stoppable state
- sweep_rooms(*, device_mac: str, room_ids: int | Sequence[int]) WyzeResponse ¶
Starts cleaning specific map rooms.
- Parameters:
device_mac (str) – The device mac. e.g.
JA_RO2_ABCDEF1234567890
room_ids (Union[int, Sequence[int]]) – The room ids to clean. e.g.
[11, 14]
- Return type:
Events¶
- class wyze_sdk.api.events.EventsClient(token: str | None = None, user_id: str | None = None, base_url: str | None = None, logger: ~logging.Logger = <Logger wyze_sdk.api.base (WARNING)>, **kwargs)¶
Bases:
BaseClient
A Client that manages Wyze events.
- list(**kwargs) Sequence[Event] ¶
Lists & filters events.
- Parameters:
device_ids (Sequence[str]) – The device mac(s) for filtering events. e.g.
['ABCDEF1234567890', 'ABCDEF1234567891']
event_values (Union[EventAlarmType, Sequence[EventAlarmType]]) – The alarm types to incude. e.g.
[EventAlarmType.MOTION, EventAlarmType.SOUND]
begin (datetime) – The start of the event filter date/time range. Defaults to 24 hours before now
end (datetime) – The end of the event filter date/time range. Defaults to now
limit (int) – The number of event records to return. Defaults to, and cannot exceed, 20
order_by (int) – The order ([
1
] chronological or [2
] reverse-chronological) of the record query. Defaults to2
(reverse chronological)
- Return type:
Sequence[Event]
- mark_read(*, events: Event | Sequence[Event], **kwargs) WyzeResponse ¶
Marks events as read.