Skip to main content

Lightwave Smart Python Library

PyPI version Python 3.7+ License: MIT

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:

Updates

Important: The LWLink2Public class has been removed as of version 1.0.0.

Installation

pip install lightwave_smart

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
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)

Device Type Detection

device = link.featuresets['featureset-id'].device
print(f"Is light: {device.is_light()}")
print(f"Is climate: {device.is_climate()}")
print(f"Is switch: {device.is_switch()}")

Event Callbacks

def feature_changed(**kwargs):
    # example output for a switch:
    # {'feature': 'switch', 'feature_id': 'your-feature-set-id', '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 servers
  • async_get_hierarchy() - Get all devices and feature sets, reads and updates all features states in the background

After calling async_get_hierarchy all feature known at that time will have their states updated as they change based on events received from the websocket.

Device Control

  • async_turn_on_by_featureset_id(id) - Turn device on
  • async_turn_off_by_featureset_id(id) - Turn device off
  • async_set_brightness_by_featureset_id(id, level) - Set brightness (0-100)
  • async_set_temperature_by_featureset_id(id, temp) - Set temperature

Device Information

  • is_light(), is_climate(), is_switch(), is_cover(), is_energy() - Device type checks
  • is_gen2(), is_hub(), is_trv() - Specific device checks

Examples

  • example_readme.py - Basic synchronous usage
  • example_async.py - Advanced async usage with 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.3

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

Source distribution (sdist)

Source distribution for lightwave-smart 2.0.3
File Size Uploaded Provenance Actions
lightwave_smart-2.0.3.tar.gz 21.3 kB With provenance Details for lightwave_smart-2.0.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for lightwave-smart 2.0.3
File Interpreter ABI Platform Actions
lightwave_smart-2.0.3-py3-none-any.whl Python 3 none any Details for lightwave_smart-2.0.3-py3-none-any.whl

Total release size: 43.3 kB

Release files / lightwave_smart-2.0.3.tar.gz

Download URL lightwave_smart-2.0.3.tar.gz
Size 21.3 kB
Tags Source
SHA-256 checksum
How to use checksums
f9e6e2de0513df8a8e85672eef5e1e7426993c1d5d878139615bd698f4b1dfac
BLAKE2b-256 checksum
How to use checksums
bf32104aaa75c6a70e76443401baa79922067fedd759f92b9539af1232eee0e5
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 2, 2026.

Transparency log

Release files / lightwave_smart-2.0.3-py3-none-any.whl

Download URL lightwave_smart-2.0.3-py3-none-any.whl
Size 22.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9bef3681328ec819a1d0278bc2b52f28740071710affb8c42d5638e9046dcec7
BLAKE2b-256 checksum
How to use checksums
d90c40d4ccb2f0cbbff997f18b5fef93f8bb43c8fab7bdbbb003834efbf8a281
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 2, 2026.

Transparency log

Security for lightwave-smart 2.0.3

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.

Select from 2 files

Attestation for lightwave_smart-2.0.3.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 2, 2026.

Transparency log

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.

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