shenxn / ha-dyson

HomeAssitant custom integration for dyson
MIT License
306 stars 60 forks source link

Please add new model #167

Open littlehasty opened 1 year ago

littlehasty commented 1 year ago

Hello,

First of all, thank you for the working local integration. My TP09 is now FINALLY in HA. Would it be possible to update the database for the newer models too please? The one missing for me is Purifier Hot+Cool Formaldehyde™ (HP09, Device Type is 527K).

Thank you!

nscharich commented 1 year ago

@littlehasty were you able to get the HP09 to work?

I had an HP06 that broke, when I sent it in they gave me a HP09 to replace it. I've been having issues trying to add it. When trying to add it manually through the integrations in HA core using dyson_local, it will take ~20 seconds before it "fails to connect". I've logged out of the app and generated a new code 5 or so times.

I've been using get_devices.py to generate my credential

ha-dyson: v0.16.4-4
homeassistant: 2022.11.4
libdyson: 0.8.11
python3 get_devices.py
Please choose your account region
1: Mainland China
2: Rest of the World
Region [1/2]: 2
Region code: US
Email: <email>
Password: <password>
Verification code: <code-from-email>

Serial: <XXX-XX-XXXXXXXX>
Name: Bedroom
Device Type: 527K
Credential: <credential>

HA Logs after using recommended debugging settings found in readme

2022-12-01 00:10:28.659 DEBUG (zeroconf-ServiceBrowser-_dyson_mqtt._tcp-_360eye_mqtt._tcp-1197171) [custom_components.dyson_local.config_flow] Found device at <device-ip>
2022-12-01 00:10:28.742 DEBUG (Thread-6) [libdyson.dyson_device] Connected with result code 0
2022-12-01 00:10:28.743 INFO (MainThread) [libdyson.dyson_device] Connected to device <XXX-XX-XXXXXXXX>
2022-12-01 00:10:28.776 DEBUG (Thread-6) [libdyson.dyson_device] Disconnected with result code 7
2022-12-01 00:10:29.976 DEBUG (Thread-6) [libdyson.dyson_device] Connected with result code 0
2022-12-01 00:10:30.007 DEBUG (Thread-6) [libdyson.dyson_device] Disconnected with result code 7
2022-12-01 00:10:31.180 DEBUG (Thread-6) [libdyson.dyson_device] Connected with result code 0
2022-12-01 00:10:31.207 DEBUG (Thread-6) [libdyson.dyson_device] Disconnected with result code 7
2022-12-01 00:10:32.371 DEBUG (Thread-6) [libdyson.dyson_device] Connected with result code 0
2022-12-01 00:10:32.392 DEBUG (Thread-6) [libdyson.dyson_device] Disconnected with result code 7
2022-12-01 00:10:33.567 DEBUG (Thread-6) [libdyson.dyson_device] Connected with result code 0
2022-12-01 00:10:33.594 DEBUG (Thread-6) [libdyson.dyson_device] Disconnected with result code 7
2022-12-01 00:10:34.770 DEBUG (Thread-6) [libdyson.dyson_device] Connected with result code 0
2022-12-01 00:10:34.797 DEBUG (Thread-6) [libdyson.dyson_device] Disconnected with result code 7
2022-12-01 00:10:35.852 DEBUG (Thread-6) [libdyson.dyson_device] Connected with result code 0
2022-12-01 00:10:35.878 DEBUG (Thread-6) [libdyson.dyson_device] Disconnected with result code 7
2022-12-01 00:10:37.053 DEBUG (Thread-6) [libdyson.dyson_device] Connected with result code 0
2022-12-01 00:10:37.081 DEBUG (Thread-6) [libdyson.dyson_device] Disconnected with result code 7
2022-12-01 00:10:38.939 DEBUG (Thread-6) [libdyson.dyson_device] Connected with result code 0
2022-12-01 00:10:38.966 DEBUG (Thread-6) [libdyson.dyson_device] Disconnected with result code 7
2022-12-01 00:10:40.172 DEBUG (Thread-6) [libdyson.dyson_device] Connected with result code 0
2022-12-01 00:10:40.199 DEBUG (Thread-6) [libdyson.dyson_device] Disconnected with result code 7
2022-12-01 00:10:41.374 DEBUG (Thread-6) [libdyson.dyson_device] Connected with result code 0
2022-12-01 00:10:41.405 DEBUG (Thread-6) [libdyson.dyson_device] Disconnected with result code 7
2022-12-01 00:10:42.605 DEBUG (Thread-6) [libdyson.dyson_device] Connected with result code 0
2022-12-01 00:10:42.633 DEBUG (Thread-6) [libdyson.dyson_device] Disconnected with result code 7
2022-12-01 00:10:43.787 DEBUG (Thread-6) [libdyson.dyson_device] Connected with result code 0
2022-12-01 00:10:43.814 DEBUG (Thread-6) [libdyson.dyson_device] Disconnected with result code 7
2022-12-01 00:10:45.019 DEBUG (Thread-6) [libdyson.dyson_device] Connected with result code 0
2022-12-01 00:10:45.046 DEBUG (Thread-6) [libdyson.dyson_device] Disconnected with result code 7
2022-12-01 00:10:46.225 DEBUG (Thread-6) [libdyson.dyson_device] Connected with result code 0
2022-12-01 00:10:46.252 DEBUG (Thread-6) [libdyson.dyson_device] Disconnected with result code 7
2022-12-01 00:10:47.421 DEBUG (Thread-6) [libdyson.dyson_device] Connected with result code 0
2022-12-01 00:10:47.438 DEBUG (Thread-6) [libdyson.dyson_device] Disconnected with result code 7
2022-12-01 00:10:48.606 DEBUG (Thread-6) [libdyson.dyson_device] Connected with result code 0
2022-12-01 00:10:48.633 DEBUG (Thread-6) [libdyson.dyson_device] Disconnected with result code 7
2022-12-01 00:10:49.777 DEBUG (MainThread) [custom_components.dyson_local.config_flow] Failed to connect to device: 

Anyone looking at this, please let me know if you need more logs.

julet85 commented 1 year ago

I had the same error and turning on my Dyson purifier while adding the device in HA fixed it.

littlehasty commented 1 year ago

My HP09 still can't work currently. I think the rootcause of this issue is that libdyson doesn't support 527K for Purifier Hot+Cool Formaldehyde™. It just support for 527E.

Ulrar commented 1 year ago

Hi all,

Have a look at the PR above, it adds support for the Dyson Pure Hot+Cool Formaldehyde (527K). You'll have to patch libdyson (/config/.local/lib/python3.10/site-packages/libdyson/ on my system) and the integration itself (/config/custom_components/dyson_local/ on my system) but it then works well.

rendnas commented 1 year ago

Hi all,

Have a look at the PR above, it adds support for the Dyson Pure Hot+Cool Formaldehyde (527K). You'll have to patch libdyson (/config/.local/lib/python3.10/site-packages/libdyson/ on my system) and the integration itself (/config/custom_components/dyson_local/ on my system) but it then works well.

Hi Ulrar,

Thanks for the solution. I got it how to change the integration. But I have no idea how do "patch libdyson". Could you please briefly let me know what I have to to? Thank you so much.

Ulrar commented 1 year ago

Hi @rendnas, Libdyson gets installed through PiP by the integration, so it'll be in a different place. On my system like I said it's in /config/.local/lib/python3.10/site-packages/libdyson/ but I'm using the linuxserver docker container, it may be different on the official image and/or on HassOS, you may have to look for it a bit.

Then just apply the changes from https://github.com/shenxn/libdyson/pull/36 to that directory, like you presumably did for the integration. Both of these together should make the fan work ! It's been rock solid for mine. Let me know if this wasn't clear

rendnas commented 1 year ago

Hi @rendnas, Libdyson gets installed through PiP by the integration, so it'll be in a different place. On my system like I said it's in /config/.local/lib/python3.10/site-packages/libdyson/ but I'm using the linuxserver docker container, it may be different on the official image and/or on HassOS, you may have to look for it a bit.

Then just apply the changes from shenxn/libdyson#36 to that directory, like you presumably did for the integration. Both of these together should make the fan work ! It's been rock solid for mine. Let me know if this wasn't clear

Hey @Ulrar, Thank you so much. I'm so sorry, but I've been using HA for 2 years, but I've never had anything to do with PiP. What is it? I use HA on a ubuntu system docker container. Really sorry. ;-)

Ulrar commented 1 year ago

PiP is the python package manager, that's what installs dependencies for python stuff essentially. It doesn't really matter anyway, just do a find / -name 'libdyson' and let it run for a while, it should find it. If you're using a docker container too most likely it'll be in your config directory like for me, maybe start looking there

rendnas commented 1 year ago

Hi @Ulrar, Thank you again for your answer. I'm very sorry, I'm not that familiar with working with Terminal yet. I would be extremely grateful if you could help me out in the last mile. I have now found the location of the folder: "0f0a5bbb1/diff/usr/local/lib/python3.10/site-packages/libdyson". But when I open the folder "python3.10" via terminal, I cannot find a folder "site-packages", but only "dist-packages", which is empty. What am I doing wrong?

Ulrar commented 1 year ago

Hi @rendnas, how did you find that folder if it's not showing in your terminal ? Most likely it's a difference of paths between however you found it and where your terminal is opening, especially if you're running all of that in containers they may all have different roots.

TerrorSource commented 1 year ago

Workaround to add the 527K = https://github.com/shenxn/ha-dyson/pull/175#issuecomment-1413740753

dotvezz commented 1 year ago

Unfortunately this integration is no longer maintained, but I've created a new fork and am actively working on the new Formaldehyde models. Have a look at #185 for more information, and let me know if you have any questions.