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

Support for TP07? #57

Closed
wranglatang opened this issue Jun 16, 2021 · 48 comments
Closed

Support for TP07? #57

wranglatang opened this issue Jun 16, 2021 · 48 comments
Labels
more info requested Further information is requested stale This issue had no updates for quite a while

Comments

@wranglatang
Copy link

I have recently just brought the TP07 (Dyson Purifier Cool Tower).

Any possibility of supporting this model?

Id be happy to test any test releases etc :)

@shenxn
Copy link
Owner

shenxn commented Jun 17, 2021

Can you provide the device WIFI SSID? You can hide the serial part.

@wranglatang
Copy link
Author

wranglatang commented Jun 17, 2021 via email

@wranglatang
Copy link
Author

Home assistant does find it on my network but when I try to configure I get an error.
E38FDC1F-EB56-40DC-963A-EDDDD627D716

A475B9CD-4809-45FC-8DF9-934B04B53B57

@shenxn
Copy link
Owner

shenxn commented Jun 19, 2021

How do you set up this device in the official mobile app? Using device SSID or bluetooth? Can you provide the error log when you see "Failed to connect"?

@shenxn shenxn added the more info requested Further information is requested label Jun 19, 2021
@wranglatang
Copy link
Author

I have looked in the log but nothing is being reported. Is there some additional logging i need to turn on?

@wranglatang
Copy link
Author

Any help on this issue? Would really like to get my fan working with HA

@shenxn
Copy link
Owner

shenxn commented Jun 30, 2021

Can you try run the script mentioned here https://github.com/shenxn/ha-dyson#setup-manually and check the model of your device? Thanks.

@wranglatang
Copy link
Author

When using that script mentioned, i get an error after typing in my email. Im in the UK so i am putting gb as my region and when i then type in my email i get this error 2, in ssl_wrap_socket context.load_verify_locations(ca_certs, ca_cert_dir, ca_cert_data) ssl.SSLError: [X509] PEM lib (_ssl.c:4232)

@shenxn
Copy link
Owner

shenxn commented Jun 30, 2021

There seems to be some problem with cloud login now since Dyson changes its log API again. Can you try enable debug log (https://github.com/shenxn/ha-dyson#debug-log) and setup again in HA to see if you can get some useful log?

@wranglatang
Copy link
Author

Will do that now!

@wranglatang
Copy link
Author

wranglatang commented Jun 30, 2021

Okay, Removed the Dyson cloud restarted and then tried to recreate the cloud component and got the below

2021-06-30 15:05:06 ERROR (MainThread) [aiohttp.server] 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 60, in security_filter_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 202, in forwarded_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 24, in request_context_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 78, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 144, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 135, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 155, in post
    return await super().post(request, flow_id)
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 63, in wrapper
    result = await method(view, request, *args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 109, in post
    result = await self._flow_mgr.async_configure(flow_id, data)
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 202, 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 260, in _async_handle_step
    result: FlowResult = await getattr(flow, method)(user_input)
  File "/config/custom_components/dyson_cloud/config_flow.py", line 71, in async_step_email
    self._verify = await self.hass.async_add_executor_job(
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.8/site-packages/libdyson/cloud/account.py", line 127, in login_email_otp
    response = self.request(
  File "/usr/local/lib/python3.8/site-packages/libdyson/cloud/account.py", line 119, in request
    raise DysonInvalidAuth
libdyson.exceptions.DysonInvalidAuth

@shenxn
Copy link
Owner

shenxn commented Jun 30, 2021

Sorry I was not clear. You should only setup dyson local. If you remove your dyson cloud entry, currently it is impossible to add it back because of the API change. Do you have any backup or so that can go back? Otherwise you need to waif for the login procedure to be fixed.

@wranglatang
Copy link
Author

Ah! damn, no I dont. Is this something that you are working on? is is this something on dysons end?

@shenxn
Copy link
Owner

shenxn commented Jun 30, 2021

Dyson changes it's login API so I need to figure out the new APIs and change the login procedure. It will not take a long time.

@wranglatang
Copy link
Author

okay, let me know when you want me to try again.

@Echotrouble
Copy link

Echotrouble commented Jul 7, 2021

Hello,

I got a TP07 and managed to add it, just by signing in into the dyson cloud with the 'cloud code'; then it discovered the Dyson locally, hit configure; typed a name for the fan. It threw an error; hit configure again; took the default name and it was successful. screenshot
Thank you for the work on this great local mqtt integration you've made. A side question, looking at the entities, I believe it is not possible to set the actual fan speed, oscillation, and read the overall air quality; is that correct? ( I installed HA 2 days ago, so I don't know yet if that's the case based on the entities I see)

edit; nevermind, the oscillating, speeds etc all seems to be part of the 'fan' entity; very nice!

@wranglatang
Copy link
Author

wranglatang commented Jul 7, 2021

@Echotrouble - Im going to give it ago again. What is the "Cloud Code"? and where did you find it?

And what region are you in?

@Echotrouble
Copy link

I added both repositories through HACS:
https://github.com/shenxn/ha-dyson
https://github.com/shenxn/ha-dyson-cloud

Installed them both. Configured the ha-dyson-cloud, after that the dyson was discovered locally, I added the local dyson and configured it. Removed the cloud integration again.

@wranglatang
Copy link
Author

What region are you in? I cant log in from the UK.

@wranglatang
Copy link
Author

Any progress on this one @shenxn?

@shenxn
Copy link
Owner

shenxn commented Jul 25, 2021

@wranglatang Try #59 as a workaround.

@wranglatang
Copy link
Author

wranglatang commented Jul 25, 2021

I have managed to add in the cloud integration. But cant connect to my TP07 when try to add the local integration. I also tried running getdevices.py but i still get an SSL error returned.

I also turned on debugging in HA and i see this in the log:
2021-07-25 10:00:15 DEBUG (zeroconf-ServiceBrowser-_dyson_mqtt._tcp-_360eye_mqtt._tcp-642) [custom_components.dyson_local.config_flow] Found device at 10.168.40.30 2021-07-25 10:00:25 DEBUG (MainThread) [custom_components.dyson_local.config_flow] Failed to connect to device:

@shenxn
Copy link
Owner

shenxn commented Jul 30, 2021

That means TP07 integration is still not working. Can you try install MQTT Explorer and connect to your device? The username is the serial and password is the credential. You can get them use the method mentioned here. Then open your Dyson mobile app, send some commands to your device, and see what you can get from the MQTT explorer.

@wranglatang
Copy link
Author

Are you referring to the Setup Manually section? I get an error when trying to run getdevices.py.

@wranglatang
Copy link
Author

Traceback (most recent call last):
  File "/Users/philipwrangles/Downloads/libdyson-main/venv/lib/python3.8/site-packages/urllib3/util/ssl_.py", line 402, in ssl_wrap_socket
    context.load_verify_locations(ca_certs, ca_cert_dir, ca_cert_data)
ssl.SSLError: [X509] PEM lib (_ssl.c:4232)

@shenxn
Copy link
Owner

shenxn commented Jul 30, 2021

Traceback (most recent call last):
  File "/Users/philipwrangles/Downloads/libdyson-main/venv/lib/python3.8/site-packages/urllib3/util/ssl_.py", line 402, in ssl_wrap_socket
    context.load_verify_locations(ca_certs, ca_cert_dir, ca_cert_data)
ssl.SSLError: [X509] PEM lib (_ssl.c:4232)

Let me check.

@shenxn
Copy link
Owner

shenxn commented Jul 30, 2021

@wranglatang Can you try dev branch? https://github.com/shenxn/libdyson/tree/dev

@wranglatang
Copy link
Author

That worked! I have my credentials I have connected via MQTT explorer and im sending it commands from my phone however i dont see anything in MQTT Explorer...

@shenxn
Copy link
Owner

shenxn commented Jul 30, 2021

Make sure your phone and your device are under the same WiFi network. If still not working, try kill your app and start it again.

@wranglatang
Copy link
Author

Yep, Both are on the same network. I have closed and opened the app again but still nothing showing up.

Im also looking at wireshark and i dont see any packets going too or from the fan!!? But i have seen packets before, very odd.

@wranglatang
Copy link
Author

Okay, i can see packets in wireshark looks like the MQTT Broker on the fan is accepting the connection. however even when i send commands from the app, i dont see any packets to or from the fan in wireshark or any messages in MQTT Explorer

@shenxn
Copy link
Owner

shenxn commented Jul 30, 2021

That means your mobile app does not use MQTT to communicate with your device. There are several possibilities:

  • Your mobile app cannot find your device on the local network so it uses cloud control instead
  • Your model has a different communication protocol (other than mqtt)
    Can you first try reboot your device? Dyson local discovery is sometimes unstable.

@wranglatang
Copy link
Author

I have rebooted my device a few time but still the same result. Have you got an example MQTT Topic and payload that i could send via MQTT Explorer to see if it actually responds to it?

May just a turn on message for the fan?

@shenxn
Copy link
Owner

shenxn commented Jul 30, 2021

What is the device type you get from get_devices.py? You'll need this in the command topic. Send the following payload to <device_type>/<serial>/command. If things goes right, you should receive status update from your device.

{
  "msg": "REQUEST-CURRENT-STATE",
  "time": "2021-07-30T14:55:00Z"
}

@wranglatang
Copy link
Author

The type is 438E. I sent that message, but i didnt get anything back in MQTT.

But i do see two messages in Wireshark. One is the publish message going TO the fan, and the other is an Acknowledgement message coming back.

@AJolly
Copy link

AJolly commented Jul 31, 2021

Btw I've had it working with my TP07 for quite a while.
Only downside is i think its averaging out the temp readings rather than giving me real time info.

I'm using the local integration, not cloud. It does drop sometimes and then I have to reboot the dyson.
If I can share any logs or anything thatd help let me know, I don't quite remember what I needed to do to get it up and going.

@wranglatang
Copy link
Author

So did your TP07 come with a WiFi username and password sticker that you then used with the local integration?

mine doesn’t have that.

@shenxn
Copy link
Owner

shenxn commented Jul 31, 2021

I've just merged a PR related to 438E device (shenxn/libdyson#12). Which means this should work for at least some of the 438E devices. @wranglatang You are receiving ACK message from your device means the MQTT broker on your device is working, but your device seems not responding to it. There might be some problem with your device. Try upgrade firmware or do a factory reset to see if it works.

@wranglatang
Copy link
Author

Thanks @shenxn, I’ll give it a go later when I get to my computer.

@wranglatang
Copy link
Author

Will this update appear in HACS?

@shenxn
Copy link
Owner

shenxn commented Jul 31, 2021

That PR adds a new sensor data to libdyson, but the current very should already support the model. Only the sensor is missing.

@wranglatang
Copy link
Author

Okay, I have been doing some testing. It doesn't look like it is possible to do anything locally to my TP07 device, i have tried blocking all outgoing traffic from the fan to the cloud to force my phone to try and connect locally but that dosnt seem to work at all.

@AJolly
Copy link

AJolly commented Aug 14, 2021

So did your TP07 come with a WiFi username and password sticker that you then used with the local integration?

mine doesn’t have that.

No, theres no local wifi info.

@wranglatang
Copy link
Author

@AJolly did you manage to get your TP07 connected?

@wranglatang
Copy link
Author

@AJolly - sorry to bug, how did you manage to connect up your TP07? Did you just use the local component and manual connection?

@Kakise Kakise added the stale This issue had no updates for quite a while label Dec 16, 2021
@Kakise Kakise closed this as completed Dec 16, 2021
@wranglatang
Copy link
Author

This has been closed by the TP07 still does not integrate.

@Kakise
Copy link
Collaborator

Kakise commented Dec 17, 2021

I don't own a TP07 so unless someone is willing to make a pull request, it won't be fixed :S

@dylancopeland
Copy link

dylancopeland commented Apr 7, 2022

@shenxn @Kakise I'm willing to help out on this. I just received a TP07 and am eager to get it connected to HomeAssistant. I've started poking around with the device and found something peculiar; Dyson uses the same product type (438E) for the TP07 (Dyson Purifier Cool) as they do the TP09 (Dyson Purifier Cool Formaldehyde). I imagine these two devices will need two be segmented out, or at least have the formaldehyde sensor be toggled.

In any case, I was able to query the TP07 via the /v2/provisioningservice/manifest endpoint. I tried adding it manually using the serial, local credentials, and using Pure Cool Formaldehyde as the device type in HA-Dyson to no avail. When I try to add the device, I either receive the following alert: Aborted or the following error: Failed to connect. I don't think there's an issue inside the environment as I have a TP01 working flawlessly with this integration.

If you all need any more info regarding the TP07 feel free to ping me. In the meantime, I'll continue to tinker on this in my spare time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
more info requested Further information is requested stale This issue had no updates for quite a while
Projects
None yet
Development

No branches or pull requests

6 participants