Dyson Link Action and Sensor

This is the Air quality sensor.
It can have 1 of 4 values I think, Good, Fair, Low and Very Low.
Its in the app. If you hit the air quality, and then scroll down on the 'Air quality explained; youll see all the values and explanations[quote=“CharlesBlonde, post:56, topic:10145”]
Dust (unknown metric, only an integer value)
[/quote]

This is related somehow to the above VOC sensor, but im not sure how. What are its possible values?
I could potentially find out exactly

Good Evening.

Ive spotted a mistake on the component site documentation. The country code has ‘UK’ in there, but it doesnt work - it should read ‘GB’

Hi @CharlesBlonde - thanks so much for your work on this plug in - I got it working but only once and can’t seem to repeat it :frowning:

When I first tried it, I had issues using the discovery method, so I ended up typing in the IP address and ID. I think this was the only time it worked, then I tried restarting HASS and it keeps on failing on both settings.

Below are the configuration.yaml entries:

With discovery:

dyson:
  username: XXX
  password: XXX
  language: GB

Without discovery:

dyson:
  username: XXX
  password: XXX
  language: GB
  devices:
    - device_id: PE9-UK-XXXXXXXX
      device_ip: 192.168.86.32

When I have discovery on, I get the following in my logs:

2017-07-20 13:11:54 WARNING (Thread-14) [libpurecoollink.dyson] Unable to find device PE9-UK-XXXXXXXX, try 0
2017-07-20 13:11:58 WARNING (MainThread) [homeassistant.setup] Setup of dyson is taking over 10 seconds.
2017-07-20 13:11:59 WARNING (Thread-14) [libpurecoollink.dyson] Unable to find device PE9-UK-XXXXXXXX, try 1
2017-07-20 13:12:04 WARNING (Thread-14) [libpurecoollink.dyson] Unable to find device PE9-UK-XXXXXXXX, try 2
2017-07-20 13:12:09 WARNING (Thread-14) [libpurecoollink.dyson] Unable to find device PE9-UK-XXXXXXXX, try 3
2017-07-20 13:12:14 WARNING (Thread-14) [libpurecoollink.dyson] Unable to find device PE9-UK-XXXXXXXX, try 4
2017-07-20 13:12:19 WARNING (Thread-14) [libpurecoollink.dyson] Unable to find device PE9-UK-XXXXXXXX, try 5
2017-07-20 13:12:24 WARNING (Thread-14) [libpurecoollink.dyson] Unable to find device PE9-UK-XXXXXXXX, try 6
2017-07-20 13:12:29 WARNING (Thread-14) [libpurecoollink.dyson] Unable to find device PE9-UK-XXXXXXXX, try 7
2017-07-20 13:12:34 WARNING (Thread-14) [libpurecoollink.dyson] Unable to find device PE9-UK-XXXXXXXX, try 8
2017-07-20 13:12:39 WARNING (Thread-14) [libpurecoollink.dyson] Unable to find device PE9-UK-XXXXXXXX, try 9
2017-07-20 13:12:39 ERROR (Thread-14) [libpurecoollink.dyson] Unable to connect to device PE9-UK-XXXXXXXX
2017-07-20 13:12:39 WARNING (Thread-14) [homeassistant.components.dyson] Unable to connect to device DysonDevice(PE9-UK-XXXXXXXX,True,Bedroom,21.03.08,True,False,455,None)

I even tried increasing the timeout to 10 seconds, but that made no difference.

When I have discovery switched off, I get the following:

Exception in thread Thread-22:
Traceback (most recent call last):
  File "/usr/local/Cellar/python3/3.5.2_3/Frameworks/Python.framework/Versions/3.5/lib/python3.5/threading.py", line 914, in _bootstrap_inner
    self.run()
  File "/usr/local/Cellar/python3/3.5.2_3/Frameworks/Python.framework/Versions/3.5/lib/python3.5/threading.py", line 862, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/ollie/.homeassistant/deps/paho/mqtt/client.py", line 2606, in _thread_main
    self.loop_forever(retry_first_connection=True)
  File "/Users/ollie/.homeassistant/deps/paho/mqtt/client.py", line 1470, in loop_forever
    rc = self.loop(timeout, max_packets)
  File "/Users/ollie/.homeassistant/deps/paho/mqtt/client.py", line 995, in loop
    rc = self.loop_read(max_packets)
  File "/Users/ollie/.homeassistant/deps/paho/mqtt/client.py", line 1273, in loop_read
    rc = self._packet_read()
  File "/Users/ollie/.homeassistant/deps/paho/mqtt/client.py", line 1838, in _packet_read
    rc = self._packet_handle()
  File "/Users/ollie/.homeassistant/deps/paho/mqtt/client.py", line 2285, in _packet_handle
    return self._handle_publish()
  File "/Users/ollie/.homeassistant/deps/paho/mqtt/client.py", line 2456, in _handle_publish
    self._handle_on_message(message)
  File "/Users/ollie/.homeassistant/deps/paho/mqtt/client.py", line 2603, in _handle_on_message
    self.on_message(self, self._userdata, message)
  File "/Users/ollie/.homeassistant/deps/libpurecoollink/dyson.py", line 267, in on_message
    device_msg = DysonEnvironmentalSensorState(payload)
  File "/Users/ollie/.homeassistant/deps/libpurecoollink/dyson.py", line 679, in __init__
    self._humidity = int(self.__get_field_value(data, 'hact'))
ValueError: invalid literal for int() with base 10: 'OFF'

2017-07-20 14:06:29 WARNING (MainThread) [homeassistant.setup] Setup of dyson is taking over 10 seconds.

Do you have any suggestions as to what I can do? I am using Home Assistant v0.49.0

Many thanks!

Is your device available in the dyson app?

Mine sometimes falls off the wireless for no apparent reason - yet every other wireless device remains, so its got to be the dyson
if you cant see it in the app, HA wont work either. Just pull the power on the fan, and plug it back in and retry

Hi @elPaulio, yes I can contrl the fan from the app as well as from my Echo Dot.

I have just tried turning the fan off and on again from the mains - but that hasn’t done anyting.

Hi @The_Brickster

It seems the discovery is not working for you :confused: I don’t know why but you are not the first one.

So you were right and your configuration seems fine. But for an unknown reason, your humidity sensor is returning ‘OFF’ and not a numeric value. A fix has been done in the underlying library.
Can you edit the file <HOME-ASSISTANT>/components/dyson.py

and update the line

REQUIREMENTS = ['libpurecoollink==0.2.0']

With

REQUIREMENTS = ['libpurecoollink==0.3.0']

And restart Home assistant ?

I hope it will work with this fix.

@elPaulio You are right, I made a mistake in the documentation about language codes. I’ll update it. Thanks !

Thanks @CharlesBlonde

Apologies, but I am very new to HASS - I am unable to find that path.

The only version of dyson.py I can find is /Users/ollie/.homeassistant/deps/libpurecoollink/dyson.py

However there doesn’t seem to be any mention of the REQUIREMENTS statement in that script, is there somewhere else I should be looking?

Thanks!

Sorry!!! Ignore me - after I submitted the post I found the file - typical :wink:

Thank you so much, that change seems to have done the trick!

Loving Home Assistant and loving the community too.

Cheers!

Ok, good to know it is working !

Are you able to open an issue on Github? https://github.com/home-assistant/home-assistant/issues
If you don’t have any Github account, I’ll do it later.

Besides, can you tell me if the option Continuous monitoring is on or off ?
I should explain why the humidity value is OFF

Sure - issue submitted on Github: https://github.com/home-assistant/home-assistant/issues/8569

I have checked the fan settings and continuous monitoring is set to off.

Can you test to turn continuous monitoring on and see if the humidity sensor is returning values ? You are in GB so I think it should be something like 50-60 %.

And thanks for the issue on Github.

I have now lost my newbie status, so have more posting privileges :stuck_out_tongue:

I responded to you on the github issue, but for completeness I thought I would copy it here:

I turned on continuous monitoring, and after a short while the dashboard reflected that the humidity detected is 49% (the same as reported in my app).

Also, to check that it was a viable workaround, I left continuous monitoring switched on, and reverted the setting back to:

REQUIREMENTS = ['libpurecoollink==0.2.0']

I was able to start HASS without any issues.

However, for my purposes, I will switch it back to 0.3.0 so I don’t need to leave continuous monitoring switched on.

Hi @CharlesBlonde,

So I decided to make the move over to hass.io as opposed to running HASS on my Mac Mini.

I have managed to get most of the config working in hass.io, however the Dyson plugin no longer seems to work.

I have tried using the discovery method as well as the static method (providing the fan’s ip etc…).

I get the following in the logs:

ERROR (MainThread) [homeassistant.setup] Error during setup of component dyson
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/homeassistant/setup.py", line 194, in _async_setup_component
    component.setup, hass, processed_config)
  File "/usr/lib/python3.6/asyncio/futures.py", line 331, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.6/asyncio/tasks.py", line 244, in _wakeup
    future.result()
  File "/usr/lib/python3.6/asyncio/futures.py", line 244, in result
    raise self._exception
  File "/usr/lib/python3.6/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/lib/python3.6/site-packages/homeassistant/components/dyson.py", line 89, in setup
    connected = device.connect(None, None, timeout, retry)
  File "/usr/lib/python3.6/site-packages/libpurecoollink/dyson.py", line 332, in connect
    self._network_device.port)
  File "/usr/lib/python3.6/site-packages/paho/mqtt/client.py", line 760, in connect
    return self.reconnect()
  File "/usr/lib/python3.6/site-packages/paho/mqtt/client.py", line 887, in reconnect
    sock = socket.create_connection((self._host, self._port), source_address=(self._bind_address, 0))
  File "/usr/lib/python3.6/socket.py", line 722, in create_connection
    raise err
  File "/usr/lib/python3.6/socket.py", line 713, in create_connection
    sock.connect(sa)
OSError: [Errno 113] Host is unreachable

Do you have any ideas?

Thanks!

Hi @The_Brickster,

I haven’t test hass.io yet so I can’t confirm it is working. I’m quite busy but I have a lot to improvements to do.

For your error, it seems to be a network issue : HA is not able to connect to the IP and/or not able to find it on the network. Maybe it can be because of a DHCP new lease. Can you confirm the IP address is still the same ?

I’m planning to test hass.io but I’ll need more time in order to confirm everything is working fine with it or if something has to be be adapted.

Hi @CharlesBlonde,

Apologies for the delay in getting back, I was away over the weekend.

I have checked the IP address and it is still the same, it has been reserved at the router.

It has been a bit temperamental, sometimes it does work, sometimes it doesn’t - which makes me think it is more my network than anything else. Currently it is working, so will just keep an eye on it.

Thanks!

Hi,

I switched to hass.io for my own (non development) installation and I can confirm it’s working without any issue, at least for me, for the Dyson component.

Nevertheless, during my tests, I discovered a non expected behavior (I have to confirm but tests are quite hard to do): When the monitoring is in standby and the device is off (or in auto mode but the air quality is good enough so the device is off) for a while, it seems the network became unavailable. It explains the [Errno 113] Host is unreachable error I was able to reproduce. When I had this error, even the Android mobile app was unable to connect to the device. Only the remote control was able to wake up the device and after a few minutes I was able to connect using Home Assistant or the mobile app.
I need to do more tests but if it is confirmed, it means the standby monitoring must be disable in order to add it to Home Assistant. More feedback are welcome in order to confirm or not this behavior.

I think I also discovered another limitation who shouldn’t be an issue for most users but it seems the number of simultaneous connections to the devices are limited: I think the limit is 4 or 5 concurrent connections. I think it’s enough for most users.

Yesterday, a new Home Assistant version was released (0.51.0 and 0.51.1) and some improvement has been done:

  • If there is a network error, the exception is catch and only one error message should be written in the log, without the stack trace. If you have many devices, the others should work (not the case before this release because all the Dyson component setup failed).
  • If standby monitoring is disable, sensors should be better manage: no errors and no strange values (like -270 °C)
  • Robot cleaner Dyson 360 Eye support has been added. Feedback are welcome

Hi CharlesBlonde,

I use the configuration below to add 360 eye, but I got the error.
Here is my configuration

dyson:
username: <>
password: <*****>
language: CN
devices:

  • device_id: jj9-cn-jc1a
    device_ip: 10.0.2.87

And the error is
2017-09-27 21:48:08 WARNING (SyncWorker_13) [homeassistant.components.dyson] Unable to find device jj9-cn-jc****1a in Dyson account

Do you have any ideas?

Hi CharlesBlonde, I updated yesterday HA to the version 0.55.0, and I noticed that my Dyson Pure Fan stopped working… I now get this:

2017-10-11 23:45:17 ERROR (Thread-7) [libpurecoollink.dyson_pure_cool_link] Unable to connect to device XYZ-CA-ABC1231B
2017-10-11 23:45:17 WARNING (Thread-7) [homeassistant.components.dyson] Unable to connect to device DysonPureHotCoolLink(serial=XYZ-CA-ABC1231B,active=True,name=Chambre d'enfant,version=21.03.08,auto_update=True,new_version_available=False,product_type=455,network_device=None)

Any idea what could be wrong ?!

EDITED SOLVED: I added the Device ID and IP to the dyson: component instead of relying on the discovery feature.

Thanks !

Hi, any chance of releasing your latest updates to home assistant? I would like to add the heat/cool functions and I notice that you have updated libpurecoollink to version 0.4.2 that supports it but home assistant is stuck on a much earlier version.

Thanks!

+1 for the update :slight_smile: