Git Product home page Git Product logo

salus-it600's Introduction

Client for Salus iT600

A JavaScript package to communicate with Salus internet connected thermostats.

Installation

npm install salus-it600

Usage

Salus authentication requires a username and password. This is exchanged for a short-lived security token. There is no way to refesh the tokens, so unfortunately we need to keep the username and password in memory.

All request methods are promise-based.

const Salus = require("salus-it600");
const salus = new Salus({ username: "[email protected]", password: "secret" });

salus.devices().then(console.log);

Limitations

This library is provided "as-is" with limited testing. Currently only thermostats connected to under-floor heating, using Celsius (i.e. not Fahrenheit) have been tested.

Salus iT600 is also marketed by John Guest, in the UK, as JG Aura.

Methods

devices

List all thermostats associated with the account.

await salus.devices();

Return

[{
    id: 'a0b1',
    name: 'Given Room Name',
    current: 18,
    target: 21,
    mode: 'AUTO_HIGH',
    heating: true
}, ... ]

setTarget

Set the target temperature for a thermostat. Requires the id of the thermostat to modify, from devices.

await salus.setTarget({ id: "a0b1", temperature: 18 });

The return value from the API is always 0, even if the command is unsuccessful.

setMode

Sets the operating mode for the thermostat. Requires the id of the thermostat to modify, from devices.

await salus.setMode({ id: "a0b1", mode: "PARTY" });

The return value from the API is always 0, even if the command is unsuccessful.

Modes

Thermostats can be set to the following modes:

  • AUTO_HIGH
  • AUTO_MEDIUM
  • AUTO_LOW
  • HIGH
  • MEDIUM
  • LOW
  • PARTY
  • AWAY
  • FROST

Thermostats will be in one of the above modes, or return one of these additional modes:

  • OFFLINE
  • ON
  • UNDEFINED

salus-it600's People

Contributors

edlea avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

ashden

salus-it600's Issues

Error running test

I run the following script:

const Salus = require("salus-it600"); const salus = new Salus({ username: "[email protected]", password: "mypassword" }); salus.devices().then(console.log);

and get the following response:

C:\Users\erik\OneDrive\Documents\Development\node.js\Salus>node index.js
C:\Users\erik\OneDrive\Documents\Development\node.js\Salus\node_modules\bent\src\nodejs.js:133
        return reject(new StatusError(res))
                      ^

StatusError: Internal Server Error
    at ClientRequest.<anonymous> (C:\Users\erik\OneDrive\Documents\Development\node.js\Salus\node_modules\bent\src\nodejs.js:133:23)
    at Object.onceWrapper (node:events:642:26)
    at ClientRequest.emit (node:events:527:28)
    at HTTPParser.parserOnIncomingClient [as onIncoming] (node:_http_client:631:27)
    at HTTPParser.parserOnHeadersComplete (node:_http_common:128:17)
    at TLSSocket.socketOnData (node:_http_client:494:22)
    at TLSSocket.emit (node:events:527:28)
    at addChunk (node:internal/streams/readable:315:12)
    at readableAddChunk (node:internal/streams/readable:289:9)
    at TLSSocket.Readable.push (node:internal/streams/readable:228:10) {
  statusCode: 500,
  json: [AsyncFunction (anonymous)],
  text: [Function (anonymous)],
  arrayBuffer: [Function (anonymous)],
  headers: {
    server: 'Apache-Coyote/1.1',
    'content-type': 'application/xml;charset=UTF-8',
    'transfer-encoding': 'chunked',
    'content-encoding': 'gzip',
    vary: 'Accept-Encoding',
    date: 'Mon, 04 Jul 2022 05:01:13 GMT',
    connection: 'close',
    'strict-transport-security': 'max-age=31536000; includeSubDomains; preload',
    'cache-control': 'private, max-age=0, no-cache, no-store'
  }
}

What am I doing wrong?
Regards Erik

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.