open-index/open-npm huggingface dataset:
npm package: @string-bean/drayton-wiser-client
Description: Client for Drayton Wiser heating systems
Author: Michael Stringer
Latest version: 0.6.0

# drayton-wiser-client

[![Travis](https://img.shields.io/travis/com/stringbean/drayton-wiser-client)](https://travis-ci.com/github/stringbean/drayton-wiser-client)
[![npm version](https://img.shields.io/npm/v/@string-bean/drayton-wiser-client)](https://www.npmjs.com/package/@string-bean/drayton-wiser-client)
![node support](https://img.shields.io/node/v-lts/@string-bean/drayton-wiser-client)

This is heavily based on the [wiserheatingapi](https://github.com/asantaga/wiserheatingapi) Python package and
the work by [Julian Knight](https://it.knightnet.org.uk/kb/nr-qa/drayton-wiser-heating-control/).

## Running the example app

1. Obtain the secret key for your system:
   1. Press the setup button on your HeatHub.
   2. Connect your phone or PC to the temporary setup Wi-Fi hotspot called `WiserHeatXXX`.
   3. Fetch the secret using a REST client (or just open in a browser) from: http://192.168.8.1/secret/
   4. Press the setup button on your HeatHub to exit setup mode.
2. List the status of your rooms using the demo app:
   ```shell script
    npm run demo -- -s $SECRET_KEY list
   ```

## Using the client

To create a client pass in the secret and address of the HeatHub, then start calling operations:

```typescript
import WiserClient from 'WiserClient';

const client = WiserClient.clientWithDiscovery('secret');
const statuses = await client.roomStatuses();

statuses.forEach((room) => {
  if (room.valid) {
    console.log(`${room.name}: ${room.temperature}ºc`);
  } else {
    console.log(`${room.name}: (invalid)`);
  }
});
```

Examples of each operation can be found in the example app.

## Supported Operations

- System status: `client.systemStatus()`.
- List room statuses: `client.roomStatuses()`.
- Single room status: `client.roomStatus(roomId)`.
- Manually set room target: `client.overrideRoomSetPoint(roomId, setPoint)`.
- Turn off a room: `client.disableRoom(roomId)`.
- Cancel room overrides: `client.cancelRoomOverride(roomId)`.
- Enable away mode: `client.enableAwayMode()`.
- Disable away mode: `client.disableAwayMode()`.
- Boost all rooms: `client.boostAllRooms()`.
- Cancel all room overrides: `client.cancelAllOverrides()`.
- Fetch the status of everything: `client.fullStatus()`.
npm package: @string-bean/homebridge-drayton-wiser
Description: Homebridge plugin for Drayton Wiser heating systems
Author: Michael Stringer
Latest version: 0.5.0

<p align="center">
  <img src="https://raw.githubusercontent.com/stringbean/homebridge-drayton-wiser/master/branding/Homebridge_x_Wiser.svg?sanitise=true" width="500px" />
</p>

# homebridge-drayton-wiser

[![verified-by-homebridge](https://badgen.net/badge/homebridge/verified/purple)](https://github.com/homebridge/homebridge/wiki/Verified-Plugins)
[![Travis](https://img.shields.io/travis/com/stringbean/homebridge-drayton-wiser)](https://travis-ci.com/github/stringbean/homebridge-drayton-wiser)
[![npm (scoped)](https://img.shields.io/npm/v/@string-bean/homebridge-drayton-wiser)](https://www.npmjs.com/package/@string-bean/homebridge-drayton-wiser)
![node support](https://img.shields.io/node/v-lts/@string-bean/homebridge-drayton-wiser)
[![Known Vulnerabilities](https://snyk.io/test/github/stringbean/homebridge-drayton-wiser/badge.svg)](https://snyk.io/test/github/stringbean/homebridge-drayton-wiser)

This [Homebridge](https://homebridge.io) plugin adds support for [Drayton Wiser](https://wiser.draytoncontrols.co.uk/)
heating control systems.

## Installation

Before starting, you will need to obtain the system secret from your Wiser HeatHub:

1. Press the 'setup' button on your HeatHub.
   - The setup light should start blinking.
2. Connect to the temporary WiFi network that the HeatHub creates (it should be called `WiserHeatXXX`).
3. Open the setup URL in a browser or REST client: http://192.168.8.1/secret/
4. Copy the long key that is shown.
5. Press the 'setup' button again.
   - The setup light should return to normal.

### Homebridge Config UI X

Search for 'wiser' on the plugins page and install 'Homebridge Drayton Wiser'. Then add your system secret and address
to the plugin settings.

### Manual Installation

Install the plugin:

```sh
sudo npm install -g --unsafe-perm
```

Then add your system config to `config.json`:

```json
{
  "platforms": [
    {
      "platform": "drayton-wiser",
      "secret": "<secret-key>"
    }
]
```

### Config Options

| Name              | Description                                                                   | Required | Default     |
| ----------------- | ----------------------------------------------------------------------------- | :------: | ----------- |
| `secret`          | Secret key for the HeatHub from device setup mode                             |    ✔     |             |
| `namePrefix`      | Hostname prefix used in HeatHub detection                                     |          | `WiserHeat` |
| `overrideAddress` | Disables auto-detection of HeatHub address                                    |          | `false`     |
| `address`         | IP address or hostname of the HeatHub (only used if `overrideAddress` is set) |          |             |