Integrate Dyson Pure Cool Link

Hey stevew81,

would you share how you managed to get it working?
I configured everything as described above, read the password via wireshark, but my mqtt connection still won’t work properly…

First, can you use an application like mqTTBox to receive the messages when configured using the data you captured from wireshark and the subscribe topic “438/YOUR-SERIAL-NUMBER-HERE/status/current”?
To trigger a message, just use you app to control the fan.

Once you have it working, its a case of getting your openhab MQTT working and copying the correct/most appropriate config files. I found the MQTT part fairly tricky, wouldn’t work for a while, then removed all MQTT addons and re-installed and it suddenly worked.

Hi
There is no mqtt.cfg file generated from the prepare.py script. Do I really need that?
I also had to hard copy the string values for the different parameters into prepare.py, before running it. If not, the values caused errors within prepare.py.
Currently my situation is that

  • MQTT Broker is offline - communication error
  • Generic MQTT Thing is uninitialized - disabled

Message in events.log:
… ‘mqtt:broker:dysonApBroker’ changed from OFFLINE to OFFLINE (COMMUNICATION_ERROR): Benutzername oder Kennwort falsch

2019-07-04 19:44:30.003 [ome.event.ItemCommandEvent] - Item ‘Dyson475_Request’ received command {“msg”:“REQUEST-CURRENT-STATE”, “time”:“2019-07-04T17:44:30.001Z”}

My dysonapbroker.things:
Bridge mqtt:broker:dysonApBroker [ host=“192.168.111.111”, secure=false, username=“NN4-CH-KJA0102C”, password=“secret”, qos=1]
{
Thing topic dysonAp {
Channels:
Type string : status “Status” [ stateTopic=“475/NN4-CH-KJA0102C/status/current” ]
Type string : command “Command” [ commandTopic=“475/NN4-CH-KJA0102C/command” ]
}
}

Hi again
Sorry! Had a typo within the password paramter. It’s working now and I am happy! :grinning:
Thanks
Markus

Hi,
it is possible thet the script work with a new dyson pure cool?
it dont have a batch with the wifi password. The batch inside shows only a mac-adresse and a pictured phone with two arrows and a code like 1234:5678

Hallo Michael,

mit openhab2.4, neuem mqtt-binding und der android app scheint (zumindest bei mir) die ansteuerung der lüftergeschwindigkeit nicht zu funktionieren. über browser geht es normal. ich habe ein wenig in die logs geschaut, dabei ist mir aufgefallen, dass über die app die Fnsp-Variable mit einer nachkommastelle (.0) formatiert ist. Der Befehl wird gesendet, fällt aber gleich auf den alten Wert zurück.

Log
[vent.ItemStateChangedEvent] - Dyson475_Fnsp changed from 4 to 3.0

[vent.ItemStateChangedEvent] - Dyson475_Fnsp changed from 3.0 to 4

Weißt du wie die Formatierung anzupassen ist, damit die Werte von der App auch als Integer übergeben werden?

Hallo Michael,

ich habe nun alle Dateien in die entsprechenden Ordner kopiert, den JSON Transform installiert, bekomme allerdings ständig die Fehlermeldung “‘mqtt:broker:dysonApBroker’ changed from OFFLINE to OFFLINE (COMMUNICATION_ERROR): CONNECT failed as CONNACK contained an Error Code: SERVER_UNAVAILABLE.”.

Die Daten scheinen zu stimmen, da, wenn ich ein anderes Passwort eingebe, die Fehlermeldung “BAD_USERNAME_PASSWORD” erscheint.

Ich habe mir testweise einen MQTT Client auf meinem Mac installiert und es von da aus probiert, bekomme allerdings dieselbe Fehlermeldung.

Dyson Modell: Hot+Cool Link (ID: 455)

Gruß,
Max

Hallo Olek,
erstmal sorry für die späte Antwort. Leider habe ich da keinen Ansatz im Moment. Ich nutze die App auch gar nicht.
Hast du inzwischen eine Lösung gefunden?

English
Sorry for the late answer. At the moment I have also no clue where to start. Also I don’t use the app.
Have you found a solution in the meantime?

Hallo Max,

ich würde aus dem Bauch heraus eher auf ein generelles Netzwerk- bzw. Lüfterproblem tippen. Funktioniert es denn über die Dyson App?
Hast du den Lüfter mal aus- und wieder eingesteckt?
Gruß Michael

English
To act on instinct I think it’s a network- or fan problem. Is it working via Dyson App?
Have you tried to plug it out and in again?

Let me continue in English…

Hi Michael,

I am able to connect to my Dyson via MQTTBox (for Mac) and the Dyson App.
The fan works as it should.

Hi,
sorry for the late answer.
It depends on how the new model communicates with the app. The current implementation of my ‘script’ depends on a non-encrypted MQTT communication basis.
I think the new one (model 2018?) is more user friendly if you are using the official app, but it’s harder to get username and password.
Maybe @stevew81 has some more information as he has also a 2018 model.

To summarize:

  • MAC -> Fan WORKING
  • App -> Fan WORKING
  • openHAB -> FAN NOT WORKING

I got you wrong, I thought the other connection (MAC to Fan) does not work either. Is it the only “thing” connected via MQTT in your openHAB instance? Do you run openHAB on a raspberry, as docker container or …? The data used in MQTTBox was completely the same as in the openHAB configuration?

Well, the connection from MQTTBox is pretty “unstable”.
It doesn’t connect on first try. It usually takes some time, before it successfully establishes a connection. I have tried to analyze the process with Wireshark, but I just can’t see, why it takes so long.

To answer your questions:

  • The Dyson is (as of now) the only “Thing” connected via MQTT
  • I am running OpenHAB on a raspberry Pi 4
  • It isn’t exactly the same, as some options are not present in either OpenHAB or MQTTBox. But every option that is available is the same.

Hi,
If you have an app on your Mac working you have done the hard bit.
I found after the upgrade to 2.5 the uid/connection ID string was a lot longer on openHAB than my Mac app. I changed it to something short, but still unique, and it works now.
The Mqtt broker does seem a little reluctant to connect in 2.5 compared to 2.4.

I got it to work by setting a from MQTTBox generated Client ID.

I don’t know why, but the Length is the same.

Anyway. Thanks very much!

Hi, any plan to update this for the new models? Just received a new fan but have no idea how to go about adding it.

Thanks

Unfortunately there is no way to determine the password for the new models as the password is not based on the wifi setup code like the old models.
You need to intercept the MQTT password between the app and the unit with something like wireshark.

I am lucky that I got my Dyson Pure Cool on the hottest day of the year. My Dyson is also a new model that doesn’t have the sticker with the mqtt topic on it.

I used wireshark and the following technic to get the mqtt connection between the Dyson and the app.

Thanks to this answer and this post I connected my iPhone with my Mac and created a virtual network adapter that wireshark can listen to.

  1. Connect your iOS device to your Mac via USB.
  2. Get the UDID for the connected device from iTunes or organiser.
  3. Open terminal in your Mac
  4. type the following commands in the terminal
  5. $ ifconfig -l // First get the current list of interfaces.
  6. $ rvictl -s <udid> // Then run the tool with the UDID of the device. This adds a new virtual network interface rvi0.
  7. $ ifconfig -l // Get the list of interfaces again, and you can see the new virtual network interface, rvi0, added by the previous command.
  8. Now you can open wireshark and select rvi0 network adapter.
  9. Filter for MQTT
  10. When you open the Dyson App on your connected iPhone you should see MQTT packages
  11. MQTT topic is a make up of {dyson_product_code}/{dyson_serial_number}/*
  12. The client id, username and password are send in the “Connect Command” on app startup
  13. Now you can follow the normal guide

Update 1.0:
The python script shortens the username and the password in the .things file so I fixed it manually. Unfortunally I din’t get it to work because I am getting some weird exeptions when openhab tries to connect to the dyson broker. In the MQTT Mac app I am using the connection works fine.

    [o.transport.mqtt.MqttBrokerConnection] - Failed subscribing to topic homeassistant/#
java.util.concurrent.CompletionException: com.hivemq.client.mqtt.mqtt3.exceptions.Mqtt3SubAckException: SUBACK contains only Error Codes

Update 1.1:
I got it to work with a quick and dirty workaround. I assigned the dyson MQTT channels in openhab to my mosquitto broker and linked the two topics over node-red to the actual dyson broker.

1 Like

Hi All, This is my first post on the OpenHab forum. I’m a beginner but was successful in getting a Dyson 455 set up. I have a 2nd one and am not sure what to do. Do I need a separate things file for the broker? I know I can rename the items but how do I deal with assigning those items to the right broker/channel? Thanks in advance!

Hi,

I have a brandnew Dyson Pure Hot + Cool Cryptomic
Now I wanted it to connect to my OpenHAB 2 (running latest version of OpenHab2 and Raspi 3B+).
I run the prepare.py and entered the requested data.
For SSID I entered the SSID of my WLAN at home - was that correct?
For password I added the password of my WLAN at home - was that correct?
The files I copied to my rasspi in the matching directories of OpenHab2.

On the sticker of the Dyson I can only find a Number in follwing format:

1234:5678

And below is just the Mac address.

MQTT (David Graeff) is installed, JSONPath Transformation is installed as well.

I read somewhere that I also need a mqtt.cfg file - where do I get it from please?

Something goes wrong. If I look into tail it always comes up with following message:

mqtt:broker:dysonApBroker’ changed from OFFLINE (COMMUNICATION_ERROR): CONNECT failed as CONNACK contained an Error Code: CLIENT_IDENTIFIER_NOT_VALID. to OFFLINE

And I also get this message:

Item ‘Dyson455_Request’ received command {“msg”:“REQUEST-CURRENT-STATE”, “time”:“2020-10-18T19:05:30.009Z”}

2020-10-18 21:05:30.033 [nt.ItemStatePredictedEvent] - Dyson455_Request predicted to become NULL

What I am missing please?

BTW:
I read somewhere that one can get P and V values.
My Dyson Pure Hot + Cool Cryptomic has two P-values one for 2.5mikron and the other one for 10mikron particles - can I read both particle sizes?