Lightwave Smart Python Library
A Python library for controlling Lightwave (https://lightwaverf.com) Smart Series (second generation) devices as well as Connect Series (first generation) devices connected to a Link Plus hub. Control and monitor lights (dimmers), power outlets (sockets), smart switches (wirefrees), PIRs, thermostats, TRVs, magnetic switches, relays, energy monitors and other device types.
Supported devices include:
- Link Plus hub (required)
- Light Switches / Dimmers
- Power Outlets
- Smart Switches
- TRVs and Thermostats
- Relays and LED Drivers
- And more...
Updates
Important: The LWLink2Public class has been removed as of version 1.0.0.
Installation
pip install lightwave_smart
Requires Python 3.11 or newer.
Quick Start
import asyncio
from lightwave_smart import lightwave_smart
async def main():
# Create and authenticate
link = lightwave_smart.LWLink2()
link.auth.set_auth_method(auth_method="password", username="your_email@example.com", password="your_password")
await link.async_activate()
# Get devices and feature sets
await link.async_get_hierarchy()
# List feature sets
for featureset in link.featuresets.values():
device = featureset.device
print(f"{featureset.name} (ID: {featureset.featureset_id}), Device Product Code: {device.product_code}")
# Control a light
featureset_id = "your-feature-set-id"
await link.async_turn_on_by_featureset_id(featureset_id)
await link.async_set_brightness_by_featureset_id(featureset_id, 75)
await link.async_deactivate()
asyncio.run(main())
Key Concepts
- Devices: Physical devices (light switches, thermostats, etc.)
- Feature Sets: Logical groupings within a device (e.g. a 2-circuit switch has 2 feature sets)
Device Control
Basic Control
# Lights/Switches
await link.async_turn_on_by_featureset_id(featureset_id)
await link.async_turn_off_by_featureset_id(featureset_id)
await link.async_set_brightness_by_featureset_id(featureset_id, 50)
# Thermostats (degrees; 22.5 is sent as 225)
await link.async_set_temperature_by_featureset_id(featureset_id, 22.5)
# Covers/Blinds
await link.async_cover_open_by_featureset_id(featureset_id)
await link.async_cover_close_by_featureset_id(featureset_id)
await link.async_cover_stop_by_featureset_id(featureset_id)
Feature Set Type Detection
featureset = link.featuresets['featureset-id']
print(f"Is light: {featureset.is_light()}")
print(f"Is climate: {featureset.is_climate()}")
print(f"Is switch: {featureset.is_switch()}")
print(f"Is hub: {featureset.is_hub()}")
print(f"Is gen2: {featureset.is_gen2()}")
is_light(), is_climate(), is_switch(), is_cover(), is_energy(), and is_trv() are feature set methods. is_hub() and is_gen2() exist on the feature set and on the device. The feature set forwards those two calls to its device.
Event Callbacks
def feature_changed(**kwargs):
# example output for a switch. feature_id is the feature id, not the feature set id:
# {'feature': 'switch', 'feature_id': 'structure-thing-link+1', 'prev_value': 0, 'new_value': 1}
print(f"Feature changed: {kwargs}")
# Register callback
await link.async_register_feature_callback(featureset_id, feature_changed)
API Reference
Core Methods
async_activate()- Connect to Lightwave serversasync_deactivate()- Disconnect and stop background workasync_get_hierarchy()- Load devices and feature sets. The first feature-state, firmware, and device-status reads run in the background
async_get_hierarchy returns when the structure is loaded. Feature states known at that time are then updated from websocket events. The first state read may still be in progress.
Device Control
async_turn_on_by_featureset_id(id)- Turn the switch feature onasync_turn_off_by_featureset_id(id)- Turn the switch feature offasync_set_brightness_by_featureset_id(id, level)- Writelevelto thedimLevelfeatureasync_set_temperature_by_featureset_id(id, temp)- Set temperature in degrees. The value is sent as tenths of a degreeasync_cover_open_by_featureset_id(id)- Open a coverasync_cover_close_by_featureset_id(id)- Close a coverasync_cover_stop_by_featureset_id(id)- Stop a cover
Feature Set Information
is_light(),is_climate(),is_switch(),is_cover(),is_energy(),is_trv()- Feature set type checksis_gen2(),is_hub()- On the feature set and on the device
Examples
example_readme.py- Async script that lists feature sets and their typesexample_async.py- Async script that stays running to receive callbacks
Contributing
Contributions welcome! Fork, create a feature branch, commit changes, and submit a PR.
License
MIT License - see LICENSE file.
Thanks
Credit to Bryan Blunt for the original version: https://github.com/bigbadblunt/lightwave2
Metadata
Release files for lightwave-smart 2.0.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| lightwave_smart-2.0.9.tar.gz | 36.1 kB | With provenance | Details for lightwave_smart-2.0.9.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| lightwave_smart-2.0.9-py3-none-any.whl | Python 3 | none | any | Details for lightwave_smart-2.0.9-py3-none-any.whl |
Total release size: 65.8 kB
Release files / lightwave_smart-2.0.9.tar.gz
| Download URL | lightwave_smart-2.0.9.tar.gz |
|---|---|
| Size | 36.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5c4d129464a5a62c38cf7c79b3f5731d13bd0968fad0d82d6fa1b2860ddbbd2e
|
|
BLAKE2b-256 checksum How to use checksums |
28fad2dcbbfe28f11fb6ed2e238ab7ca23685c7c388ae05f7532275f8c5105a6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.
Transparency logRelease files / lightwave_smart-2.0.9-py3-none-any.whl
| Download URL | lightwave_smart-2.0.9-py3-none-any.whl |
|---|---|
| Size | 29.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
703e9eed785084f9c4cc1e47ecd857fa798849d08839b0118b015ccfb2085522
|
|
BLAKE2b-256 checksum How to use checksums |
9f83987df3ac53acf7a2efcf8ee6a5a8133b633f8505d9c49ea240f292d596b0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.
Transparency logSecurity for lightwave-smart 2.0.9
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for lightwave_smart-2.0.9.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.
Transparency logA 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.