Python API for Ayla IoT products
Project description
ayla-iot-unofficial
An unofficial python library for interacting with the Ayla IoT API. Intended to be generic for multi-device use.
Designed primarily to be a support package for Home Assistant integrations.
This library is heavily based off of sharkiq by @JeffResc.
Ayla References
This device is integrated by/with Ayla Networks and (generally) uses their documentation.
These can be used as starting references:
- https://developer.aylanetworks.com/apibrowser
- https://docs.aylanetworks.com/reference/getting_started
- https://connection.aylanetworks.com/s/article/2080270
Installation
From PyPi
pip install ayla-iot-unofficial
Build from source
pip install build
pip build
pip install ayla-iot-unofficial
Library Requirements
Requires typical http interaction and datatype packages like requests, aiohttp, ujson
User Requirements
Reqiures a username and password (typically a smart device's app login credentials) Requires an app_id and app_secret (granted by Ayla to the smart device's app for operation/integration)
The app_id and app_secret may need to be obtained from proxy traffic or other method.
Usage
Class Object
Instantiate a new class object through new_ayla_api() or Ayla() directly.
For devices that may be region specific, the new_ayla_api() function will create an Ayla() object based on the europe boolean.
Ayla Access_Token
Standard use should call sign_in() on the Ayla object after creation. This will perform the POST login request to obtain an access_token.
Some devices communicate with a different IoT domain but still expose the Ayla access_token. This access token can be passed into the Ayla object using _set_credentials() and the proper arguments.
Devices
By default, calling get_devices() will return a list of class specific device objects with updated properties for use.
See device.py for implemented device classes.
Typical Operation
python3 -m pip install ayla-iot-unofficial
import ayla_iot_unofficial
USERNAME = 'me@email.com'
PASSWORD = '$7r0nkP@s$w0rD'
ayla_api = new_ayla_api(USERNAME, PASSWORD, APP_ID, APP_SECRET)
ayla_api.sign_in()
devices = ayla_api.get_devices()
# Example Vacuum Devices
shark = devices[0]
shark.set_operating_mode(OperatingModes.START)
shark.return_to_base()
# Example Water Softener Devices
softener = devices[1]
softener.capacity_remaining_gallons
softener.set_vacation_mode()
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file ayla_iot_unofficial-1.4.3.tar.gz
.
File metadata
- Download URL: ayla_iot_unofficial-1.4.3.tar.gz
- Upload date:
- Size: 20.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 043cae5e4b629b0ce0ee9ff46963d1487ba0b5409931c3f9db4b5b0ed489d8e9 |
|
MD5 | f17c641b222eed0270efdbdcb73b9017 |
|
BLAKE2b-256 | 4800bedb8e6547c2232ad325163a3c92f2fd2086614ddc58b1b9656aa27e4701 |
File details
Details for the file ayla_iot_unofficial-1.4.3-py3-none-any.whl
.
File metadata
- Download URL: ayla_iot_unofficial-1.4.3-py3-none-any.whl
- Upload date:
- Size: 20.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 39d15c3a03b4c6650742ab244623c826e0e2f71aaa71ab933f2f99610ea936ca |
|
MD5 | 28ad2cff7cbef905d4e5c8098fd28efa |
|
BLAKE2b-256 | dcd24110e253d9f2a6b5673573e811296b362a21a3ca406fb69b8893a8c937b7 |