Web Client¶
- class wyze_sdk.api.Client(email: Optional[str] = None, password: Optional[str] = None, totp_key: Optional[str] = None, base_url: Optional[str] = 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) wyze_sdk.service.wyze_response.WyzeResponse ¶
Checks API calling code
- Return type
- property bulbs: wyze_sdk.api.devices.bulbs.BulbsClient¶
- property cameras: wyze_sdk.api.devices.cameras.CamerasClient¶
- devices_list(**kwargs) Sequence[wyze_sdk.models.devices.base.Device] ¶
List the devices available to the current user
- Return type
Sequence[Device]
- property entry_sensors: wyze_sdk.api.devices.sensors.ContactSensorsClient¶
- property events: wyze_sdk.api.events.EventsClient¶
- property locks: wyze_sdk.api.devices.locks.LocksClient¶
- login() wyze_sdk.service.wyze_response.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_point
is already set or bothemail
andpassword
are not set.
- property motion_sensors: wyze_sdk.api.devices.sensors.MotionSensorsClient¶
- property plugs: wyze_sdk.api.devices.plugs.PlugsClient¶
- refresh_token() wyze_sdk.service.wyze_response.WyzeResponse ¶
Updates
access_token
using the previously setrefresh_token
.- Return type
- Raises
WyzeClientConfigurationError – If
refresh_token
is not already set.
- property scales: wyze_sdk.api.devices.scales.ScalesClient¶
- property thermostats: wyze_sdk.api.devices.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() wyze_sdk.service.wyze_response.WyzeResponse ¶
Retrieves the current user’s info.
- Return type
- user_get_profile() wyze_sdk.service.wyze_response.WyzeResponse ¶
Retrieves the current user’s profile
- Return type
- property vacuums: wyze_sdk.api.devices.vacuums.VacuumsClient¶
Bulbs¶
- class wyze_sdk.api.devices.bulbs.BulbsClient(token: typing.Optional[str] = None, user_id: typing.Optional[str] = None, base_url: typing.Optional[str] = None, logger: logging.Logger = <Logger wyze_sdk.api.base (WARNING)>, **kwargs)¶
Bases:
wyze_sdk.api.base.BaseClient
A Client that services Wyze bulbs/lights.
- clear_timer(*, device_mac: str, device_model: str, **kwargs) wyze_sdk.service.wyze_response.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) Optional[Union[wyze_sdk.models.devices.bulbs.MeshBulb, wyze_sdk.models.devices.bulbs.Bulb]] ¶
Retrieves details of a bulb.
- list() Sequence[wyze_sdk.models.devices.bulbs.Bulb] ¶
Lists all bulbs available to a Wyze account.
- Return type
Sequence[Bulb]
- set_away_mode(*, device_mac: str, device_model: str, away_mode: bool = True, **kwargs) wyze_sdk.service.wyze_response.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) wyze_sdk.service.wyze_response.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, **kwargs) wyze_sdk.service.wyze_response.WyzeResponse ¶
Sets the color 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 str color
The new color temperature. e.g.
ff0000
- Return type
- Raises
WyzeFeatureNotSupportedError – If the bulb doesn’t support color
- set_color_temp(*, device_mac: str, device_model: str, color_temp: int, **kwargs) wyze_sdk.service.wyze_response.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
- turn_off(*, device_mac: str, device_model: str, after: Optional[datetime.timedelta] = None, **kwargs) wyze_sdk.service.wyze_response.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: Optional[datetime.timedelta] = None, **kwargs) wyze_sdk.service.wyze_response.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: typing.Optional[str] = None, user_id: typing.Optional[str] = None, base_url: typing.Optional[str] = None, logger: logging.Logger = <Logger wyze_sdk.api.base (WARNING)>, **kwargs)¶
Bases:
wyze_sdk.api.base.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) Optional[wyze_sdk.models.devices.cameras.Camera] ¶
Retrieves details of a camera.
- Args:
- param str device_mac
The device mac. e.g. ‘ABCDEF1234567890’
- Returns:
(Optional[Camera])
- list() Sequence[wyze_sdk.models.devices.cameras.Camera] ¶
Lists all cameras available to a Wyze account.
- Returns:
(Sequence[Camera])
- restart(*, device_mac: str, device_model: str, **kwargs) wyze_sdk.service.wyze_response.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) wyze_sdk.service.wyze_response.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) wyze_sdk.service.wyze_response.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: typing.Optional[str] = None, user_id: typing.Optional[str] = None, base_url: typing.Optional[str] = None, logger: logging.Logger = <Logger wyze_sdk.api.base (WARNING)>, **kwargs)¶
Bases:
wyze_sdk.api.devices.locks.BaseLockClient
A Client that services Wyze locks.
- property gateways: wyze_sdk.api.devices.locks.LockGatewaysClient¶
Returns a lock gateway client.
- Return type
LockGatewaysClient
- get_records(*, device_mac: str, limit: int = 20, since: datetime.datetime, until: Optional[datetime.datetime] = None, offset: int = 0, **kwargs) Sequence[wyze_sdk.models.devices.locks.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) Optional[wyze_sdk.models.devices.locks.Lock] ¶
Retrieves details of a lock.
- Parameters
device_mac (str) – The device mac. e.g.
ABCDEF1234567890
- Return type
Optional[Lock]
- list(**kwargs) Sequence[wyze_sdk.models.devices.locks.Lock] ¶
Lists all locks available to a Wyze account.
- Return type
Sequence[Lock]
- lock(device_mac: str, **kwargs) wyze_sdk.service.wyze_response.WyzeResponse ¶
Locks a lock.
- Parameters
device_mac (str) – The device mac. e.g.
ABCDEF1234567890
- Return type
- unlock(device_mac: str, **kwargs) wyze_sdk.service.wyze_response.WyzeResponse ¶
Unlocks a lock.
- Parameters
device_mac (str) – The device mac. e.g.
ABCDEF1234567890
- Return type
Plugs¶
- class wyze_sdk.api.devices.plugs.PlugsClient(token: typing.Optional[str] = None, user_id: typing.Optional[str] = None, base_url: typing.Optional[str] = None, logger: logging.Logger = <Logger wyze_sdk.api.base (WARNING)>, **kwargs)¶
Bases:
wyze_sdk.api.base.BaseClient
A Client that services Wyze plugs/outlets.
- clear_timer(*, device_mac: str, **kwargs) wyze_sdk.service.wyze_response.WyzeResponse ¶
Clears any existing power state timer on the plug.
- Parameters
device_mac (str) – The device mac. e.g.
ABCDEF1234567890
- info(*, device_mac: str, **kwargs) Optional[wyze_sdk.models.devices.plugs.Plug] ¶
Retrieves details of a plug.
- Parameters
device_mac (str) – The device mac. e.g.
ABCDEF1234567890
- Return type
Optional[Plug]
- list() Sequence[wyze_sdk.models.devices.plugs.Plug] ¶
Lists all plugs available to a Wyze account.
- Return type
Sequence[Plug]
- set_away_mode(*, device_mac: str, device_model: str, away_mode: bool = True, **kwargs) wyze_sdk.service.wyze_response.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: Optional[datetime.timedelta] = None, **kwargs) wyze_sdk.service.wyze_response.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: Optional[datetime.timedelta] = None, **kwargs) wyze_sdk.service.wyze_response.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: typing.Optional[str] = None, user_id: typing.Optional[str] = None, base_url: typing.Optional[str] = None, logger: logging.Logger = <Logger wyze_sdk.api.base (WARNING)>, **kwargs)¶
Bases:
wyze_sdk.api.base.BaseClient
A Client that services Wyze scales.
- add_weight_record(*, device_mac: str, mac: str, user_id: str, measure_ts: datetime.datetime, measure_type: int = 1, weight: float, **kwargs) wyze_sdk.service.wyze_response.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: Optional[str] = None, **kwargs) wyze_sdk.service.wyze_response.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) wyze_sdk.service.wyze_response.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(*, user_id: Optional[str] = None, **kwargs) wyze_sdk.models.devices.scales.UserGoalWeight ¶
Retrieves a user’s goal weight.
- Parameters
user_id (str) – The user id. e.g.
abcdef1234567890abcdef1234567890
- Return type
- get_records(*, user_id: Optional[str] = None, start_time: datetime.datetime, end_time: Optional[datetime.datetime] = datetime.datetime(2022, 4, 23, 12, 50, 48, 905359), **kwargs) Sequence[wyze_sdk.models.devices.scales.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) Optional[wyze_sdk.models.devices.scales.Scale] ¶
Retrieves details of a scale.
- Parameters
device_mac (str) – The device mac. e.g.
ABCDEF1234567890
- Return type
Optional[Scale]
- list(**kwargs) Sequence[wyze_sdk.models.devices.scales.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) wyze_sdk.service.wyze_response.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: typing.Optional[str] = None, user_id: typing.Optional[str] = None, base_url: typing.Optional[str] = None, logger: logging.Logger = <Logger wyze_sdk.api.base (WARNING)>, **kwargs)¶
Bases:
wyze_sdk.api.devices.sensors.SensorsClient
A Client that services Wyze Sense contact sensors.
- info(*, device_mac: str, **kwargs) Optional[wyze_sdk.models.devices.sensors.ContactSensor] ¶
Retrieves details of a contact sensor.
- Parameters
device_mac (str) – The device mac. e.g.
ABCDEF1234567890
- Return type
Optional[ContactSensor]
- list() Sequence[wyze_sdk.models.devices.sensors.ContactSensor] ¶
Lists all contact sensors available to a Wyze account.
- Return type
Sequence[ContactSensor]
Entry Sensors¶
- class wyze_sdk.api.devices.sensors.MotionSensorsClient(token: typing.Optional[str] = None, user_id: typing.Optional[str] = None, base_url: typing.Optional[str] = None, logger: logging.Logger = <Logger wyze_sdk.api.base (WARNING)>, **kwargs)¶
Bases:
wyze_sdk.api.devices.sensors.SensorsClient
A Client that services Wyze Sense motion sensors.
- info(*, device_mac: str, **kwargs) Optional[wyze_sdk.models.devices.sensors.MotionSensor] ¶
Retrieves details of a motion sensor.
- Parameters
device_mac (str) – The device mac. e.g.
ABCDEF1234567890
- Return type
Optional[MotionSensor]
- list() Sequence[wyze_sdk.models.devices.sensors.MotionSensor] ¶
Lists all motion sensors available to a Wyze account.
- Return type
Sequence[MotionSensor]
Thermostats¶
- class wyze_sdk.api.devices.thermostats.ThermostatsClient(token: typing.Optional[str] = None, user_id: typing.Optional[str] = None, base_url: typing.Optional[str] = None, logger: logging.Logger = <Logger wyze_sdk.api.base (WARNING)>, **kwargs)¶
Bases:
wyze_sdk.api.base.BaseClient
A Client that services Wyze thermostats.
- clear_hold(*, device_mac: str, device_model: str, **kwargs) wyze_sdk.service.wyze_response.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
- hold(*, device_mac: str, device_model: str, until: datetime.datetime, **kwargs) wyze_sdk.service.wyze_response.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) Optional[wyze_sdk.models.devices.thermostats.Thermostat] ¶
Retrieves details of a thermostat.
- Parameters
device_mac (str) – The device mac. e.g.
CO_EA1_ABCDEF1234567890
- Return type
Optional[Thermostat]
- list(**kwargs) Sequence[wyze_sdk.models.devices.thermostats.Thermostat] ¶
Lists all thermostats available to a Wyze account.
- Return type
Sequence[Thermostat]
- set_behavior(*, device_mac: str, device_model: str, behavior: int, **kwargs) wyze_sdk.service.wyze_response.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) wyze_sdk.service.wyze_response.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: wyze_sdk.models.devices.thermostats.ThermostatScenarioType, **kwargs) wyze_sdk.service.wyze_response.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: wyze_sdk.models.devices.thermostats.ThermostatFanMode, **kwargs) wyze_sdk.service.wyze_response.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) wyze_sdk.service.wyze_response.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: int, **kwargs) wyze_sdk.service.wyze_response.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: wyze_sdk.models.devices.thermostats.ThermostatSystemMode, fan_mode: wyze_sdk.models.devices.thermostats.ThermostatFanMode, **kwargs) wyze_sdk.service.wyze_response.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: wyze_sdk.models.devices.thermostats.ThermostatSystemMode, **kwargs) wyze_sdk.service.wyze_response.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) wyze_sdk.service.wyze_response.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: typing.Optional[str] = None, user_id: typing.Optional[str] = None, base_url: typing.Optional[str] = None, logger: logging.Logger = <Logger wyze_sdk.api.base (WARNING)>, **kwargs)¶
Bases:
wyze_sdk.api.base.BaseClient
A Client that services Wyze Robot Vacuums.
- clean(*, device_mac: str, device_model: str, **kwargs) wyze_sdk.service.wyze_response.WyzeResponse ¶
Starts cleaning.
- Parameters
device_mac (str) – The device mac. e.g.
JA_RO2_ABCDEF1234567890
device_model (str) – The device model. e.g.
JA_RO2
- Return type
- dock(*, device_mac: str, device_model: str, **kwargs) wyze_sdk.service.wyze_response.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
- Return type
- get_sweep_records(*, device_mac: str, limit: int = 20, since: datetime.datetime, **kwargs) Sequence[wyze_sdk.models.devices.vacuums.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) Optional[wyze_sdk.models.devices.vacuums.Vacuum] ¶
Retrieves details of a vacuum.
- Parameters
device_mac (str) – The device mac. e.g.
JA_RO2_ABCDEF1234567890
- Return type
Optional[Vacuum]
- list(**kwargs) Sequence[wyze_sdk.models.devices.vacuums.Vacuum] ¶
Lists all vacuums available to a Wyze account.
- Return type
Sequence[Vacuum]
- pause(*, device_mac: str, device_model: str, **kwargs) wyze_sdk.service.wyze_response.WyzeResponse ¶
Pauses cleaning.
- Parameters
device_mac (str) – The device mac. e.g.
JA_RO2_ABCDEF1234567890
device_model (str) – The device model. e.g.
JA_RO2
- Return type
- set_suction_level(*, device_mac: str, device_model: str, suction_level: wyze_sdk.models.devices.vacuums.VacuumSuctionLevel, **kwargs) wyze_sdk.service.wyze_response.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
- sweep_rooms(*, device_mac: str, room_ids: Union[int, Sequence[int]]) wyze_sdk.service.wyze_response.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: typing.Optional[str] = None, user_id: typing.Optional[str] = None, base_url: typing.Optional[str] = None, logger: logging.Logger = <Logger wyze_sdk.api.base (WARNING)>, **kwargs)¶
Bases:
wyze_sdk.api.base.BaseClient
A Client that manages Wyze events.
- list(**kwargs) Sequence[wyze_sdk.models.events.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: Union[wyze_sdk.models.events.Event, Sequence[wyze_sdk.models.events.Event]], **kwargs) wyze_sdk.service.wyze_response.WyzeResponse ¶
Marks events as read.
- mark_unread(*, events: Union[wyze_sdk.models.events.Event, Sequence[wyze_sdk.models.events.Event]], **kwargs) wyze_sdk.service.wyze_response.WyzeResponse ¶
Marks events as unread.