Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/auchenberg/dyson-purelink

Control Dyson PureLink fan/purifier devices from JavaScript
https://github.com/auchenberg/dyson-purelink

dyson iot library purelink

Last synced: 5 days ago
JSON representation

Control Dyson PureLink fan/purifier devices from JavaScript

Awesome Lists containing this project

README

        

# dyson-purelink

Control Dyson PureLink fan/purifier devices from JavaScript. Discovers local devices on your WIFI via Bonjour/mDNS, logs into the Dyson Cloud to grab the device credentials and connects to the devices via MQTT.

Tested with the follow devices:
- Dyson Pure Cool Link Air Purifier & Fan Tower (1st Gen. filter)

## Install
```
npm install dyson-purelink
```

## Use

```javascript
var DysonPureLink = require('dyson-purelink')

var pureLink = new DysonPureLink("", "", "");

pureLink.getDevices().then(async devices => {

if(!Array.isArray(devices) || devices.length === 0) {
console.log('No devices found')
return
}
// Get status
console.log('getTemperature', await devices[0].getTemperature());
console.log('getAirQuality', await devices[0].getAirQuality());
console.log('getRelativeHumidity', await devices[0].getRelativeHumidity());
console.log('getFanStatus', await devices[0].getFanStatus());
console.log('getFanSpeed', await devices[0].getFanSpeed());
console.log('getRotationStatus', await devices[0].getRotationStatus());
console.log('getAutoOnStatus', await devices[0].getAutoOnStatus());

// Actions
await devices[0].turnOn();
console.log('setRotation', await devices[0].setRotation(true));
console.log('setFanSpeed', await devices[0].setFanSpeed(100));

await pureLink.disconnect();
}).catch(err => console.error(err))

```