Giter Club home page Giter Club logo

telldus-api's Introduction

telldus-api

Node.js interface for Telldus Live API and Telldus Local API. Since their APIs are similar, I added support for both. All API methods are promise based. Both LiveApi and LocalApi inherit from the same class Api which has the same methods. However not all methods are implemented or make sense on LocalApi.

Install

npm install telldus-api

Live usage

  • You will need a Telldus Live account with configured devices and and OAuth tokens.
  • Log in to your Live account, go to http://api.telldus.com/ and Generate a private token for my user only.
const { LiveApi } = require('telldus-api');

const api = new LiveApi({
  key: '...', // publicKey
  secret: '...', // privateKey
  tokenKey: '...', // token
  tokenSecret: '...', // tokenSecret
});

const devices = await api.listDevices();
console.log(devices);

Local usage

TellStick ZNet Lite can be controlled via a similar API directly via HTTP. For more info, see this link.

  • Find the IP address of your TellStick device
  • Install telldus-local-auth: npm i -g telldus-local-auth
  • Run in a terminal telldus-local-auth <IP OF YOUR DEVICE> appname and follow instructions. appname can be set to whatever you want.
  • Note the returned token.
const { LocalApi } = require('telldus-api');

const api = new LocalApi({
  host: '...', // Host name or IP address of your device
  accessToken: '...', // The access token you got from telldus-local-auth
});

const devices = await api.listDevices();
console.log(devices);

The accessToken will be auto refreshed as long as there are API calls.

API

See class Api in index.js

Links

telldus-api's People

Contributors

mifi avatar dependabot[bot] avatar carlioth 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.