Git Product home page Git Product logo

homebridge-hs-plug's Introduction

Homebridge HS Plug Platform Plugin

This is a module to provide HomeBridge compatibility with TP-Link HS100 / HS110 plugs. This was specifically built to address the breaking of functionality due to firmware version 1.1.0 on hardware version 4.1 plugs. These plugs appear to be only found with the UK and associated territories, so this module may not have a wide scope.

Tested with:

  • HS100 (UK)
  • HS110 (UK)

I welcome any changes and I freely admit this is a very hacky implementation and I cannot offer any guaranties for both suitability or capability and this is used at your own risk.

Requirements & Notes

This plugin required a custom fork of python-kasa, if you install the version currently found in the repository IT WILL NOT WORK.

You first have to install my fork of python-kasa, which is located here. I must offer a great debt of gratitude to Simon Wilkinson , without his work on the python-kasa library none of this would be possible. In fact, my fork of python-kasa simply includes further changes by Simon that has not been submitted to his own fork yet.

With this setup I am going to assume you are on Linux or similar, if you are running on a different os you will have to adapt this.

Installation

  1. Install HomeBridge.
  2. Download my fork of python-kasa.
  3. Become root (actual root do not run the following command with sudo, so run sudo su or similar or log in as root).
  4. Run the following command, make sure you keep the trailing slash on the path to the directory you cloned into as it makes sure pip3 uses that folder not a similarly named package from the repository.
    pip3 install python-kasa/ --system
  1. Once this is installed switch back to a normal user and check you can run the command ‘kasa’
  2. It is now best to test that you can run a discovery, there are a few parameters that maybe needed, it will depend on how your plugs are configured. If you have 4.1 plugs that are configured on the TP-Link app and you have a username and password setup you will need to use the flags --user and –password. If you do not have a username and password configured (i.e the plugs have stopped working and you have not reset them) you can omit these.
  3. Run the following command to test discovery.
    kasa --klap --user ‘myusername’ --password ‘mypassword’
  1. You should get a discovery result that shows all your plugs including any that are hardware 4.1 with firmware 1.1.0.
  2. Install this plugin using: npm install -g homebridge-hs-plug or through Homebridge UI.
  3. Update your Homebridge configuration file (config.json).

Configuration

Avaliable platform configuration options are as follows:

  • platform [required] this is always "HSPlug"
  • user [optional] this is the username of your kasa app login
  • password [optional] this is the password of your kasa app login
  • klaponly [optional] this is a boolean to indicate you only was to use this plugin for the new 4.1 hardware. This allows you to keep on using your exisitng plugin setup for unaffected hardware.

Thanks / Credits

A big thanks to @simonwilkinson for his changes to the python-kasa library and his help via email.

homebridge-hs-plug's People

Contributors

ghostseven avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

cliffordm

homebridge-hs-plug's Issues

Configuration Typo

Describe The Bug:

In the project description, the following configuration option was provided

name [optional] this is the username of your kasa app login

Instead, it should be:

user [optional] this is the username of your kasa app login

Energy monitoring

Having been stuck with a UK HS110, and not being able to add it to HomeKit for sometime, your plugin has been very welcome. Many thanks! I have been using for a week or so and it works well!

I was wondering whether energy monitoring in the Eve app was possible, like it is implemented in this plugin? https://github.com/plasticrake/homebridge-tplink-smarthome

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.