Coder Social home page Coder Social logo

pyw215's Introduction

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.

pyw215's People

Contributors

linuxchristian avatar clach04 avatar hcoohb avatar danielhiversen avatar williamrandol avatar dasbasti avatar scottmckenzie avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.