JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q49362F
  • License MIT

Virtual Smart Hub for TP-Link Kasa Smart Home

Package Exports

  • kasa-smart-hub

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (kasa-smart-hub) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Build Status Test Coverage Dependabot Status Dependencies NPM Downloads Semantic-Release Gardener

kasa-smart-hub

Virtual Smart Hub for TP-Link Kasa Smart Home

Designed to be run on a LAN server, e.g. on a Raspberry Pi.

How to

Install as global npm packages. Then create configuration file and start with

kasa-smart-hub /path/to/config.json

Config

Configuration can be in multiple formats. Most likely you want to use config.js or config.json.

logFile

Where events logs are stored

Object that contains "linked" switches that are always executed together.

timer

Used to automatically switch off devices

__default

Default fallback timer. Can be set to zero to disable.

Config Example

const path = require('path');

module.exports = {
  logFile: path.join(__dirname, 'kasa-logs.txt'),
  links: {
    'kitchen-lights': [
      // when either of these is switched on / off the other one will also switch on / off
      'Kitchen Counter Lights',
      'Kitchen Ceiling Light'
    ]
  },
  timer: {
    __default: 8 * 60 * 60, // switch off everything after eight hours
    'Bathroom Fan': 60 * 60 // switch off after one hour
  }
};

Acknowledgements

This project relies on tplink-smarthome-api. Documentation for that project can be found here.