Skip to main content

pyW215

pyW215 is a python3 library for interfacing with the d-link W215 Smart Plug.

The library is largely inspired by the javascript implementation by @bikerp dsp-w215-hnap.

Installing

Install using the PyPI index

pip install pyW215

Usage

#!python3
from pyW215.pyW215 import SmartPlug, ON, OFF

sp = SmartPlug('192.168.1.110', '******')
# Where ****** is the "code pin" printed on the setup card

# Get values if available otherwise return N/A
print(sp.current_consumption)
print(sp.temperature)
print(sp.total_consumption)

# Turn switch on and off
sp.state = ON
sp.state = OFF

Note: You need to know the IP and password of your device. The password is written on the side.

Contributions

I personally no longer use my W215 but contributions are always welcome. If you do submit a PR please ping @LinuxChristian. If I don’t respond within a few days just ping me again.

Working firmware versions

  • v2.02

  • v2.03

  • v2.22

Note: If you experience problems with the switch upgrade to the latest supported firmware through the D-Link app. If the problem persists feel free to open an issue about the problem.

Partial support

  • v1.24 and v1.25 (State changing and current consumption working, but no support for reading temperature)

  • D-Link W110 smart switch D-Link W110 smart switch (only state viewing and changing is supported)

If you have it working on other firmware or hardware versions please let me know.

Need support for W115 or W245?

Checkout this library, https://github.com/jonassjoh/dspW245

Need support for W218

DSP-W218 uses a completly different protocol compare to earlier versions. There is no roadmap to add support for W218 but PR’s are always welcome.

Release files for pyW215 0.8.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 pyW215 0.8.0
File Size Uploaded
pyw215-0.8.0.tar.gz 6.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyW215 0.8.0
File Interpreter ABI Platform
pyw215-0.8.0-py3-none-any.whl Python 3 none any Details

Total release size: 12.3 kB

Release files / pyw215-0.8.0.tar.gz

Download URL pyw215-0.8.0.tar.gz
Size 6.0 kB
Tags Source
SHA-256 checksum
How to use checksums
0104465e9b9db8744ca3311940c34b5f97f91ad25add3ff9ac7206a86bd650fe
BLAKE2b-256 checksum
How to use checksums
1e5c68ef84f413be0ce45cf80c33d8d548964f56690719e81cfa35909a9df436
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.2

Release files / pyw215-0.8.0-py3-none-any.whl

Download URL pyw215-0.8.0-py3-none-any.whl
Size 6.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2d904f1f0717acf2cdfb6b82634e9171fdc844f3068d2941c926535cb816b950
BLAKE2b-256 checksum
How to use checksums
c3cd0904828d88f0f0795a8e6b3f639b7656e0d71241e647435204c256dab242
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.2

Release history Release notifications | RSS feed

This release

0.8.0 This release

2 release files

0.7.0

2 release files

0.5.2

1 release file

0.5.1

1 release file

0.5

1 release file

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