Skip to main content

A simple python API client to control Sengled smart devices

Project description

Sengled Python Client

A simple Python client to control Sengled [light] accessories.

There are other accessories but this was only tested with these two devices:

  • A19 element color plus (E11-N1EA)
  • A19 element classic (E11-G13)




import sengled

api = sengled.api(
    # The username/password that you used to create your mobile account in the Sengled Home app.

    # Optional path to persist the session across multiple process
    # starts and reduce the number of logins.

    # Prints details of the api request/responses when True, defaults to false.

# Alternatively, set `SENGLED_*` environment variables that match
# the api arguments.
api = sengled.api_from_env()

# List all devices

devices = api.get_device_details()

# Only colored lamps

colored = api.filter_colored_lamps()

# Only lamps that support color temperature

temperature = api.filter_color_temperature_lamps()

# The API can be used to modify a list of devices or single devices


api.set_brightness(devices, 100)

api.set_color(colored, [255, 0, 0])

api.set_color_temperature(temperature, 100)


api.set_on_off(devices, True)

# You can search for single lamps

api.find_by_id("B0CE18140000EB41") #=> SengledLampDevice

api.find_by_name("Office Bulb 1")  #=> SengledLampDevice

# And finally you can operate directly on `SengledLampDevice`s
bulb = api.find_by_name("Office Bulb 1")

# Or chain the actions
api.find_by_name("Office Bulb 2") \
   .on() \
   .set_brightness(50) \
   .set_color([0, 0, 255])

Note that all API calls will raise based on status_code via request's raise_for_status() method. Action methods will also raise a RuntimeError if the success field is returned with a value of False.

How this came about?

This was reverse engineered from multiple different repositories found on GitHub as well as and some guessing. See also:

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for sengled-client, version 0.0.1
Filename, size File type Python version Upload date Hashes
Filename, size sengled_client-0.0.1-py3-none-any.whl (6.6 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size sengled-client-0.0.1.tar.gz (5.3 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page