Dyson Link Action and Sensor

The Dyson Link (for their Link enabled fans/purifiers and 360 robot) operates on MQTT with the device using Bonjour to broadcast itself.

Would be great to be able to use the Dyson Fan/Purifiers as a sensor (temperature etc) and an action (turning on/off the fan as an action)

Example of client - https://github.com/shadowwa/Dyson-MQTT2RRD
More detailed info - http://aakira.hatenablog.com/entry/2016/08/12/012654

Would be cool to control the 360 also :slight_smile:

Hi,

I’m working on a component in order to support Dyson Pure Cool Link fans but before submitting a pull request, I would like to have feedback from testers.

At this time, it supports basic features:

  • Turn on/off
  • Set fan Speed
  • Enable auto and night mode
  • Enable oscillation

If you have one of this devices and want to test this component, you’ll have to do some manual setup:

Create a dyson.py file in the components/fan directory of Home Assistant (/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/fan on Raspberry pi) with the content of the following files: dyson.py

Add the following content in your configuration.yaml file:

fan:
  - platform: dyson
    username: <dyson-account-user-email>
    password: <dyson-account-password>
    language: <language>

For the language, I don’t know what are the valid values. For me, in France, it is FR and if I set a different value, it will not work. I suppose something like DE, ES, EN, or US should work. I’m interested to know which values are working for which country.

In the logger part of the configuration file, you can also set this component in debug in order to have more information (it’s not very verbose):

logger:
  default: warn
  logs:
    [... other configuration ...]    
    homeassistant.components.fan.dyson: debug

Restart Home Assistant and if everything is fine, the fans linked to you Dyson account should appear in Home Assistant. Note that the first boot can be quite long because it has to download/install dependencies.

If you are able to do it working (or not :/), I would like to have feedback on what is working and what is not. What are the valid language value for you. And of course if you have any idea in order to improve this component.
Nevertheless, my goal in a first step is to be able to have a stable and reliable component in order to submit a PR before adding new features.

Thanks for you help!

Hi Charles,

I have a Dyson Pure Cool and will test your component soon.

Kind Regards,
Rokain

Nice! Great job.
I will certainly give it a go and report back.
I’m from the Netherlands, so languagecode will probably be NL

Hi Rokain and SebasT,

Your help will be more than welcome ! :slight_smile:

I’m using this component since 2-3 weeks and it seems to work fine but having feedback before submitting a PR can be very useful !

Charles

Managed to get it to work…
Man you did a great job :sunglasses:

Only thing i noticed this far is the time it takes to get started, because apparently it takes a couple (3 or 4) of retries to connect to the pure link.
ERROR (Thread-1) [libpurecoollink.dyson] Unable to find device XXXXX, try 0
ERROR (Thread-1) [libpurecoollink.dyson] Unable to find device XXXXX, try 1
ERROR (Thread-1) [libpurecoollink.dyson] Unable to find device XXXXX, try 2

The languagecode i used was the one i expected: NL for the Netherlands

Hi SebasT,

Good to hear it is working with NL language code !

For the errors in the logs, I had them sometimes too but I don’t know how to bypass them. What is happening:
I’m sending a Multicast DNS query on the network to discover local Dyson devices but sometimes the devices are not responding. So I implement a timeout/retry mechanism ( 15 x 5 seconds). I tried different values but to my experience, if the devices didn’t respond in 5 seconds, it will not respond at all.
Maybe I should replace the log level from ERROR to WARNING because it is not a blocking error and it only happens when the component starts and asynchronous for Home Assistant (I guess, I have to check).

If Rokain is able to successfully test the component too, I’ll try to start working on the pull request.

Charles

Charles,

Ah that explains it. Like you said a WARNING would make more sense.
Also would be great if you could add temp and humidity readings in the future. For now i’m hoping you’ll get a PR sorted soon :innocent:

Thanks again for your hard work!

Sebastiaan

Hi Charles,

It works great! I am from The Netherlands as well so I also use the NL code.

Thanks for the great component!

Rokain

Ever since I upgraded to 0.44 it seems to take a lot longer to find the dyson (10 tries or more). Sometimes it doesn’t find it at all.
Could this be related??

I’ve just installed the component for the first time and I’m already using 0.44, I cannot find my device so I’m interested to see if 0.44 has broken something or if I have some other problem.

Hi,

Release 0.44 should have no impact with this component but I’ll take a look. I’m using an old Home Assistant release because I have another custom component and upgrading is more complex.

And yes, I plan to add sensors for humidity, temp, filter life, etc …
But I think I’ll have to refactor configuration.xml so is has to be done before submitting a PR.

@michael.muir can you tell me which language code you are using ?

I just tested with current development branch (future 0.45) and I have no regression.

@SebasT I did a small update to publish retry and timeout parameters. Can you take the last version dyson.py (erase/replace) and add the following in configuration.yaml:

fan:
  - platform: dyson
    username: <dyson-account-user-email>
    password: <dyson-account-password>
    language: <language>
    timeout: <timeout>
    retry: <retry>

And change timeout/retry parameters to find the best values for you. Maybe increase timeout to a higher value (10/15) or decrease this value to force retrying. To my experience, increasing the timeout never gave me good results and I prefer to force retrying.
One strange behavior: At the beginning, I had this issues really often but now it’s always working at the first attempt and in less than 2 seconds. I can’t explain why.

@michael.muir Can you also get the latest version: dyson.py and set the component log level to debug (I explained how in my first post). I added some debug messages and I would like to know where it is blocking for you.
I’m interesting by this kind of messages:

Connected to Dyson account
or
Not connected to Dyson account. Unable to add devices

And messages like:

2017-05-08 20:10:20 INFO (Thread-3) [homeassistant.components.fan.dyson] Trying to connect to device DysonDevice(XX-XX-XX,True,Salon,21.03.08,True,False,475,None) with timeout=5 and retry=1
2017-05-08 20:10:20 INFO (Thread-3) [homeassistant.components.fan.dyson] Connected to device DysonDevice(XX-XX-XX,True,Salon,21.03.08,True,False,475,NetworkDevice(XX-XX-XX,Y.Y.Y.Y,1883))

XX-XX-XX is the device serial id and I don’t care about it (don’t know if it is secret)
Y.Y.Y.Y is the IP address. Don’t need this info

Interesting values are:

  • 21.03.08: Device software version.
  • 475: Device type. I know 475 is for the tower version and 469 the desk version

@Rokain and @SebasT if you can also provide me these information, it will be great.

Thanks for your help!

Hello!

Im hopping on this bandwagon - firstly… thank you for your efforts so far

Secondly, im hoping to contribute to this since my wife works at Dyson and brings home a lot of test products
Current devices:
Dyson 360 robo vacuum
various Purelink devices

… and other non IoT devices that wouldnt work so we’ll disregard those

Version of HASS, 0.44.1

So, Ive grabbed the latest dyson.py and set the logger to default warning, and dyson.py to debug
my yaml looks like this:

fan:

  • platform: dyson
    username:
    password:
    language: GB
    timeout: 10
    retry: 10

side note:
(Language: EN) - this did NOT work

SUCCESS!

So in my Home Assistant, I now have a Fan that I can switch on and off - I havent played with it yet, since im at work and doing all this remotely, however I can tell you that the update time between HA and the dyson app (remotely across the internet) is about 1 second, great work

Debug info you might want??

2017-05-09 10:43:31 INFO (Thread-1) [homeassistant.components.fan.dyson] Creating new Dyson platform
2017-05-09 10:43:31 INFO (Thread-1) [homeassistant.components.fan.dyson] Connected to Dyson account
2017-05-09 10:43:31 INFO (Thread-1) [homeassistant.components.fan.dyson] Trying to connect to device DysonDevice(PE8-UK-HHA0158A,True,Pürity,21.03.08,True,False,455,None) with timeout=10 and retry=10
2017-05-09 10:43:31 INFO (Thread-1) [homeassistant.components.fan.dyson] Connected to device DysonDevice(PE8-UK-HHA0158A,True,Pürity,21.03.08,True,False,455,NetworkDevice(PE8-UK-HHA0158A,192.168.1.127,1883))
2017-05-09 10:43:31 INFO (Thread-1) [homeassistant.components.fan.dyson] Creating device Pürity
2017-05-09 10:43:32 DEBUG (Thread-13) [homeassistant.components.fan.dyson] Message received for device Pürity : DysonState(OFF,OFF,OFF,AUTO,OFF,3972,0003,ON)

The device this relates to is the only one on this account, it is this:

Hope this helps!

Let me know if you want me to test any other functionality, or indeed any other devices I may be able to get a hold of. The 360 robot is sat here just waiting :slight_smile:

Thanks
Paul

@CharlesBlonde I reviewed my setup this evening and found the previous issue I reported was probably my fault, I have installed the latest version anyway and after reading the comments by @elPaulio I decided to try AU (for Australia) as the language type since he indicated EN didn’t work and I now have a functional Dyson fan within my HASS environment.

Great work, when we purchased the fan I was optimistic someone would develop a component eventually and you haven’t disappointed. Let me know if you need any additional features tested.

(NN8-AU-HJA0364A,True,Madi’s Room,21.03.08,True,False,475,None)

Thank you very much for all of your feedback! I’m now quite confident to submit a working component.

I just started a refactoring in order to be able to manage sensors too. My goal is not to provide all the sensors in the first version (temp, humidity, dust, etc …) but to be able to add new features without future regression in configuration.yaml.

Just to give you an overview of the first sensor: filter life

I think I should be able to submit the component this week-end. I’ll let you know when it will be done and how to install it if you want but it will be more complex (many files to create).

Thanks to your feedback I’ll be able to provide documentation with working language code (known working codes: FR, GB, AU, NL).

@elPaulio It seems your are using a heating version of the device (device type: 455). At this time I don’t know how to manage heating and I’ll need your help (not now because I’m focusing on submitting a first working version).
Besides, I think I’ll have to implement a new graphic component to manage heating and to better manage auto & night mode (I’m using speed but it’s wrong) instead of the default fan graphic component.

I’m quite sure 360 robot vacuum should work more or less like fans but I don’t have this device and it’s quite expensive so it will not be my priority right now :slight_smile:
But it can be an interesting challenge!
One question: is the 360 robot on the same Dyson account ? Because I’m not sure if the component will work with an unknown device. Do you have errors in the logs ?

@CharlesBlonde thanks again for your hard work, I look forward to seeing this component develop. I intend to buy one of the devices with Heating capability so I’ll also be able to assist with testing that when the time comes.

@CharlesBlonde
Correct, this particular device is a hot/cool purifier. We also have a full size tower purifier

As for the 360, no, that is on a different account. My wife has a test account she uses for work, but I can get the credentials no worries. Im not 100% sure what other devices are on that account, but i can tell you it includes the full tower purifier, and the 360 robot at the very least.
My account, only has the one hot/cool purifier, which is the one I was using for this test
No errors in my log because of the separate accounts - if you want, i could attach her account and get the device list - just let me know when and if you want some debug information

As for installing files/components, im sure between us we’ll get it done. Ive been running HA for almost a year now so your documentation doesnt have to be perfect due to my experience. Unfortunately, I have no coding experience :frowning:

Again, great work mate - much appreciated

1 Like

Here’s my debug information you requested:

XX-XX-XXXX,True,Cooley,21.03.08,True,False,475,NetworkDevice