Socket
Book a DemoInstallSign in
Socket

ayla-iot-unofficial

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ayla-iot-unofficial

Python API for Ayla IoT products

1.5.0
pipPyPI
Maintainers
1

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.

PyPi

Ayla References

This device is integrated by/with Ayla Networks and (generally) uses their documentation.

These can be used as starting references:

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 either a username and password (typically a smart device's app login credentials) or a token (retrieved from device manufacturer's login flow) 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()

Login via token

Some devices like the De'Longhi DDSX Dehumidifier are accessed by logging into the manufacturer's app which then generates an SSO token for logging into Ayla Networks.

SSO_TOKEN = 'st2...'

ayla_api = new_ayla_api_sso(SSO_TOKEN, APP_ID, APP_SECRET)
ayla_api.sign_in()

License

MIT

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.