After struggling with the Dyson API breaking my setup multiple times, I decided to take matters into my own hands and migrate my Dyson Pure Cool Link to use local MQTT control. I wanted to share my journey and solution in case anyone else is facing similar issues.
The Challenge
For a while, I relied on the Dyson component in Home Assistant to control my fan. However, recent updates broke the integration, leaving me without control over my device. This wasn’t the first time I faced this issue, and I knew I needed a more reliable solution.
The Solution
After some research, I discovered that the Dyson Pure Cool Link supports local MQTT communication without needing the Dyson cloud. This was exactly what I needed! Here’s how I set it up:
-
Connecting to the Fan
- The fan uses a specific SSID and password, which are printed on a sticker inside the device. If your fan doesn’t have this sticker, you can use Wireshark to sniff the password.
-
MQTT Configuration
-
I connected to the fan on port 1883 using the SSID as the username and the hashed password from the sticker.
-
I used a Python script to convert the password to the required hash format:
python
‘’’ Transfers the password from the sticker to the needed hash. ‘’’
import base64
import hashlibAsk for the password
pwd = input(“Product WiFi Password (e.g.: adgjsfhk):”)
Transfer password to hash version
hash = hashlib.sha512()
hash.update(pwd.encode(‘utf-8’))
pwd_hash = base64.b64encode(hash.digest()).decode(‘utf-8’)Print out password hash
print(pwd_hash)
-
-
MQTT Commands
- The fan responds to several commands via MQTT. Here are the key commands:
- Power:
FANorOFF - Oscillation:
ONorOFF - Speed: Values from
0001to0010 - Night Mode:
ONorOFF
- Power:
- The fan responds to several commands via MQTT. Here are the key commands:
-
Integration with Node-RED
-
I used Node-RED to create a seamless integration. Here’s a snippet of the function node I created:
javascript
var now = new Date();
console.log(now.toUTCString());var oson = msg.osc
var speed = msg.speed
var night = msg.night
var power = msg.powermsg.payload = {
“msg”: “STATE-SET”,
“time”: now,
“data”: {
“oson”: oson,
“fnsp”: speed,
“nmod”: night,
“fmod”: power
}
}return msg;
-
-
Automation and Timer
- I set up a timer to turn off the fan after a certain period. This involved creating input booleans for power, oscillation, and night mode, as well as input numbers for speed and timer management.
Conclusion
This setup has been a game-changer for me. I no longer rely on Dyson’s cloud services, and I have full control over my fan through MQTT. It’s been running smoothly for months now, and I’ve had no issues with the integration.
I hope this guide helps anyone else looking to take control of their Dyson devices. If you have any questions or need further clarification, feel free to ask! Happy automating! ![]()