A Java library to assist in connecting to Dyson fans via MQTT messaging protocols. This library is mostly asynchronous and can be used to post state changes to the fan, as well as query environmental data from Dyson fan sensors. Dyson4J is compiled with Java 17, therefore your project must be compiled with at least Java 17 to use.
Communication to a Dyson fan can only be accomplished over a local network as the Dyson REST API is not properly documented by Dyson and changes frequently.
The library is licensed under MIT License and available for use by anybody. Contributions are welcome so long as they abide by the Checkstyle configuration and contribution guidelines.
- Wiki: https://github.com/2008Choco/Dyson4J/wiki
- Issues: https://github.com/2008Choco/Dyson4J/issues
- Javadocs: https://choco.wtf/javadocs/dyson4j
This project uses Maven as a build system so that necessary dependencies are downloaded automatically. A Java 17 JDK must also be installed. While use of Maven is advised to depend on this library, you may compile and test the library yourself via simple Maven commands. Maven obviously must be installed in order to commence a build.
Firstly, clone the repository. In the root of the project, run the following command:
mvn clean package
The final artifact can be found under /target/Dyson4J-<version>.jar
.
If desired, Javadocs can also be generated by running the following command:
mvn javadoc:javadoc
Final Javadoc HTML files may be found under /target/site/apidocs/index.html
.
<repositories>
<repository>
<id>choco-repository</id>
<url>http://repo.choco.wtf/releases</url>
</repositroy>
</repositories>
<dependencies>
<dependency>
<groupId>wtf.choco</groupId>
<artifactId>Dyson4J</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>
repositories {
maven { url "http://repo.choco.wtf/releases"; allowInsecureProtocol = true } // Gradle requires "allowInsecureProtocol" for http URLs. This repo will be secured with SSL in the future
}
dependencies {
implementation "wtf.choco:Dyson4J:1.0.0"
}
There are libraries to communicate with Dyson's MQTT servers, though some are outdated or no longer functional. However, these were still crucial in the successful development and documentation of this library, therefore they are worth listing in case you or somebody you know may want to contribute to (and if necessary, fix) these libraries.
- Python:
- JavaScript: auchenberg/dyson-purelink
- Go: adrian-bl/dyslink
- Eclipse Paho for the awesome Java MQTT library.
- Google's GSON for the best Java JSON library there is.
- Jetbrains Annotations for really neat API annotations.
- JUnit 5 for an unmatched Java unit testing library.
- Various online articles and community-made documentation on numerous forums:
- https://community.home-assistant.io/t/dyson-pure-cool-link-local-mqtt-control/217263
- https://devopstar.com/2019/03/03/dyson-fan-control-over-mqtt-via-serverless
- https://community.openhab.org/t/integrate-dyson-pure-cool-link/40416/90
- https://www.blinkenlights.ch/ccms/posts/dyson-pure-cool-link/
- https://github.com/JanJaapKo/DysonPureLink/wiki/MQTT-topics-and-message-structure (the most helpful in understanding response data)
- ... and many more!