JeffSteinbok / hass-dreo

Dreo Smart Device Integration for Home Assistant
MIT License
119 stars 34 forks source link

Add support for DR-HPF004S / PolyFan 704S #82

Closed cts1085 closed 1 month ago

cts1085 commented 5 months ago

I just purchased the DR-HPF004S from Amazon.

Attached is the debug log. config_entry-dreo-b66c0d7153309aeecb121f1e75bec6d4 (1).json

Here are the answers to your questions: Model - DR-HPF004S Number of speeds the fan supports (not including "off") - 9 Does the fan support oscillating? - Yes both horizontal and vertical What preset modes are supported? Standard, Turbo, Custom, Auto, Natural Is temperature supported? Yes Thank you!

cts1085 commented 5 months ago

Here is the redacted log file... home-assistant_2024-04-16T17-57-49.050Z.log

woodcraftsman commented 5 months ago

Same for me, just got the fan today and would love it to work in HACS. CTS1085 has the specs right.

woodcraftsman commented 3 months ago

Same for me, just got the fan today and would love it to work in HACS. CTS1085 has the specs right.

I was able to get mine working. As the PolyFan 704S (DR-HPF004s) is identical to the DR-HAF004s, I just edited the models.py file and right below the DR-HAF004S line, added the following lines of code:

"DR-HPF004S": DreoDeviceDetails(
    preset_modes=[FAN_MODE_NORMAL, FAN_MODE_NATURAL, FAN_MODE_SLEEP, FAN_MODE_AUTO, FAN_MODE_TURBO],
    range = {SPEED_RANGE: (1, 9)}
)

And my Home assistant now detects this fan, and appears to work. Easy Peasy. Note make sure the ")" on the DR-HAF004s line has a "," after it, or this will not work.

stelgado commented 2 months ago

Same for me, just got the fan today and would love it to work in HACS. CTS1085 has the specs right.

I was able to get mine working. As the PolyFan 704S (DR-HPF004s) is identical to the DR-HAF004s, I just edited the models.py file and right below the DR-HAF004S line, added the following lines of code:

"DR-HPF004S": DreoDeviceDetails(
    preset_modes=[FAN_MODE_NORMAL, FAN_MODE_NATURAL, FAN_MODE_SLEEP, FAN_MODE_AUTO, FAN_MODE_TURBO],
    range = {SPEED_RANGE: (1, 9)}
)

And my Home assistant now detects this fan, and appears to work. Easy Peasy. Note make sure the ")" on the DR-HAF004s line has a "," after it, or this will not work.

Worked like a charm, thank you!

DaegorDude commented 2 months ago

While this did work (and I am otherwise happy with that), my issue with this is that unless I still go through the Dreo app, I can't set the vertical angle to less than zero and hence can't point the fan downwards through HA.

jb1228 commented 2 months ago

While this did work (and I am otherwise happy with that), my issue with this is that unless I still go through the Dreo app, I can't set the vertical angle to less than zero and hence can't point the fan downwards through HA.

You can manually edit the "number.py" file to set the min/max angles accordingly. Then restart Home Assistant.

Here are the relevant lines for the PolyFan 704S:

    DreoNumberEntityDescription(
        key="Horizontal Angle",
        translation_key="horizontal_angle",
        attr_name="horizontal_angle",
        icon="mdi:angle-acute",
        min_value=-75,
        max_value=75,
    ),
    DreoNumberEntityDescription(
        key="Vertical Angle",
        translation_key="vertical_angle",
        attr_name="vertical_angle",
        icon="mdi:angle-acute",
        min_value=-30,
        max_value=90
    ),
    ...

Looks like there is currently no way to set these ranges per fan; so if you have multiple fans, I would suggest just using the highest numbers.

JeffSteinbok commented 1 month ago

In 0.7.1