Skip to main content

Sleep360

This project allows to control the Holi SleepCompanion from a Linux computer.

The SleepCompanion is nice LED bulb that offers a lot of features to improve your sleep and your waking up. It is manufactured by Holi, a French company. A product description can be found by following these links:

This Sleep360 project is written in Python and can be used:

  • as a library by creating a sleep360.Bulb() object
  • as a command line utility (coming soon)

Requirements

  • D-BUS
  • bluez >= 5.46 (dependency on the GATT D-BUS API)

Installation

From PyPI

pip install [--user] sleep360

From the sources

cd python-sleep360
pip install [--user] .

Command line usage

pip install installs a sleep360 binary. Running it gives a prompt like this one:

Sleep360 shell (version x.y.z).
Type help or ? to list commands.

[sleep360] connect Bulb
Connecting to the Bulb...
[sleep360] set_color 0xff0000 0x00 0x00
[sleep360] disconnect
Disconnecting from the Bulb...
[sleep360] exit

Library usage

bulb = Bulb(name="Bulb")
bulb.connect()

# Play with bulb commands
[...]

bulb.disconnect()

Examples are available in the tests directory.

Supported features

The SleepCompanion bulb offers a lot of features. Among them, the following ones are currently supported by Sleep360:

  • Setting colors (RGB + warm and cold value)
  • Powering off the light
  • Getting the temperatures measured by the bulb

Reverse-engineering

This project has been developed by carefully studying the Bluetooth LE messages. The file BLE-protocol.md describes my understanding of these messages.

Metadata

Release files for sleep360 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sleep360 0.2.0
File Size Uploaded Provenance Actions
sleep360-0.2.0.tar.gz 9.9 kB Without provenance Details for sleep360-0.2.0.tar.gz

Release files / sleep360-0.2.0.tar.gz

Download URL sleep360-0.2.0.tar.gz
Size 9.9 kB
Tags Source
SHA-256 checksum
How to use checksums
77a65f84d1db531898cd7d504653fc96950c84d134161d18daf0a2598761821b
BLAKE2b-256 checksum
How to use checksums
4c635bb76532d0048be47d635ef16062f365a32f069e142779bac070b032cbd4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.3

Security for sleep360 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page