Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/auchenberg/dyson-purelink
- Owner: auchenberg
- Created: 2017-07-09T20:15:46.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-11T18:28:37.000Z (almost 2 years ago)
- Last Synced: 2024-04-14T12:15:34.722Z (7 months ago)
- Topics: dyson, iot, library, purelink
- Language: JavaScript
- Size: 85.9 KB
- Stars: 38
- Watchers: 4
- Forks: 10
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
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))```