https://github.com/stringbean/drayton-wiser-client
API client for Drayton Wiser heating systems
https://github.com/stringbean/drayton-wiser-client
drayton-wiser heating-control
Last synced: about 1 year ago
JSON representation
API client for Drayton Wiser heating systems
- Host: GitHub
- URL: https://github.com/stringbean/drayton-wiser-client
- Owner: stringbean
- License: apache-2.0
- Created: 2020-08-17T08:35:21.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2022-01-17T19:44:31.000Z (about 4 years ago)
- Last Synced: 2025-02-18T12:45:00.465Z (about 1 year ago)
- Topics: drayton-wiser, heating-control
- Language: TypeScript
- Homepage:
- Size: 793 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# drayton-wiser-client
[](https://travis-ci.com/github/stringbean/drayton-wiser-client)
[](https://www.npmjs.com/package/@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()`.