Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unsupported device Dyson 360 Eye heurist #25

Closed
loscalinohacs opened this issue Mar 13, 2021 · 17 comments
Closed

Unsupported device Dyson 360 Eye heurist #25

loscalinohacs opened this issue Mar 13, 2021 · 17 comments

Comments

@loscalinohacs
Copy link

After successfully completing Dyson cloud setup, I try to register my two Dyson discovered devices using the configure button, write ip address in the host field and then it fails with "Unknown error occurred" message.
Log file contains the following exception:

...
File "/config/custom_components/dyson_local/config_flow.py", line 151, in _async_get_entry_data
device.connect(host)
AttributeError: 'NoneType' object has no attribute 'connect'

My two devices are:

Dyson 360 Eye robot vacuum
Dyson Pure Cool

Full stack trace is:

Logger: aiohttp.server
Source: custom_components/dyson_local/config_flow.py:151
First occurred: 9:03:26 AM (1 occurrences)
Last logged: 9:03:26 AM

Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/aiohttp/web_protocol.py", line 422, in _handle_request
resp = await self._request_handler(request)
File "/usr/local/lib/python3.8/site-packages/aiohttp/web_app.py", line 499, in _handle
resp = await handler(request)
File "/usr/local/lib/python3.8/site-packages/aiohttp/web_middlewares.py", line 119, in impl
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 56, in security_filter_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 172, in forwarded_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 18, in request_context_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 72, in ban_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 129, in auth_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 129, in handle
result = await result
File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 150, in post
return await super().post(request, flow_id)
File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 60, in wrapper
result = await method(view, request, *args, **kwargs)
File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 106, in post
result = await self._flow_mgr.async_configure(flow_id, data)
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 158, in async_configure
result = await self._async_handle_step(flow, cur_step["step_id"], user_input)
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 216, in _async_handle_step
result: Dict = await getattr(flow, method)(user_input)
File "/config/custom_components/dyson_local/config_flow.py", line 79, in async_step_host
data = await self._async_get_entry_data(
File "/config/custom_components/dyson_local/config_flow.py", line 151, in _async_get_entry_data
device.connect(host)
AttributeError: 'NoneType' object has no attribute 'connect'

Thanks.

@shenxn
Copy link
Owner

shenxn commented Mar 13, 2021

Can you try running the get_devices.py directly from https://github.com/shenxn/libdyson? See if it can successfully get all information needed for your devices.

@loscalinohacs
Copy link
Author

yes it works, I have executed a bash inside the container and then cloned the project, this is the result:

bash-5.0# python get_devices.py
Please choose your account region
1: Mainland China
2: Rest of the World
Region [1/2]: 2
Region code: IT
Email: *****@gmail.com
Password:
Verification code: 557193

Serial: D8R-EU-****934A
Name: Aspirapolvere
Device Type: 276
Credential: *******==

Serial: PT4-EU-K****A
Name: Studio
Device Type: 455
Credential: *****==

--
Today I will cleanup everything and try again the configuration process from scratch.
Thanks for your help.

@loscalinohacs
Copy link
Author

I get the same error also after reinstalling everything from scratch, a couple more tests I did that can help your analysis:

I tried adding the device using HA Integration ha-dyson-local and filled all the fields using get_devices.py output, after a while it says "Failed to connect" and nothing in the logs.
Then I tried to connect from HA container to dyson vacuum and it worked, telnet 192.168.0.12 1883 was successful.
Then I have installed mqtt explorer on my machine and successfully connected to 192.168.0.12 port 1883 using serial as username and Credential as password, I can see some topics like N223/initialconnection/status and N223/initialconnection/credentials

@shenxn
Copy link
Owner

shenxn commented Mar 14, 2021

I noticed that there is a device of type 276 in your device list. What is the actual model of that device?

@loscalinohacs
Copy link
Author

It is a Dyson RB02, aka Dyson 360 Eye heurist.

https://www.dyson.it/aspirapolvere/robot/dyson-360-heurist

Increased log to debug ant it says:

2021-03-14 09:31:48 INFO (MainThread) [libdyson.dyson_device] Connected to device D8R-EU-****A
2021-03-14 09:31:58 DEBUG (Thread-108) [libdyson.dyson_device] Disconnected with result code 0

@shenxn shenxn changed the title Error: "Unknown error occurred" message when configuring device Unsupported device Dyson 360 Eye heurist Mar 14, 2021
@shenxn
Copy link
Owner

shenxn commented Mar 14, 2021

Thanks. That device is actually not supported yet. And I couldn't find much info about the MQTT protocol of that device. This is the cause of the error log you see. It will be very helpful if you can help me figure that out. Can you try to connect to the device with MQTT explorer and send some commands through your Dyson mobile app and see if you can see some data under topics like */*/status and */*/command.

@loscalinohacs
Copy link
Author

Sure will do, will send you an initial trace and then you can ask me more details.

@loscalinohacs
Copy link
Author

I have sent you the first sample by email. Hope it helps.

@shenxn
Copy link
Owner

shenxn commented Mar 14, 2021

@loscalinohacs I've received that. At a first glance, it seems that the protocol is pretty much the same as Dyson 360 Eye (N223). I should be able to add support to this very soon.

@loscalinohacs
Copy link
Author

Great news! ok, feel free to ask me more details and tests if needed, thanks a lot.

@shenxn
Copy link
Owner

shenxn commented Mar 14, 2021

Can you also do some operations like set power mode, run a full clean, stop, resume, back to home. You don't need to finish the clean. You can stop it as long as your robot starts moving. It'll be helpful if you can post some screenshot of the mobile app as well. Thanks a lot.

@loscalinohacs
Copy link
Author

mqtt trace v2.0 and screenshots sent by mail, the protocol seems simple and I hope it did not change between models.

@shenxn
Copy link
Owner

shenxn commented Mar 15, 2021

@loscalinohacs I released version 0.8.0. It now has basic support for 360 Heurist.

@loscalinohacs
Copy link
Author

Updated to 0.8.0, configuration worked and 1 device successfully recognized, 3 additional entities recognized and working: battery_charging, battery_level and bin_full.
Well done!

@shenxn
Copy link
Owner

shenxn commented Mar 15, 2021

That's a good news. I may add zone configured cleaning later through custom services but that is going to be pretty tricky. There is one thing I would like to know though, is your 360 Heurist has the WiFi SSID and password info on a sticker used for setup just like any other Dyson devices? If so, can you send me a photo or just information on it? It is related to #17.

@loscalinohacs
Copy link
Author

there is a sticker with mac address but no wifi ssid/pass, it seems that this model uses the app to send wifi SSID and pass to the device.
The only interesting thing I have found on the sticker is an 8 digits code "nnnn-nnnn" that could be related with device pairing.

This video shows how robot is paired with local wifi using app:

https://www.youtube.com/watch?v=svDMkf3REss&ab_channel=Dyson

@shenxn
Copy link
Owner

shenxn commented Mar 15, 2021

@loscalinohacs Thanks for confirm. Looks like heurist uses Bluetooth instead of the old WiFi AP. Closing this issue. I'll ping you for testing if I figured out how to implement the zone based cleaning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants