Dreo Fan Integration?

Happy to hear that! Leave me a star on GitHub or something. :slight_smile:

1 Like

Absolutely well deserved, done :slight_smile:

Doing great work here @JeffSteinbok thank you for creating this. Just installed and it’s working perfectly.

Hello Jeff,
Great work, I have been waiting for this integration, so glad you made it.
I have a question, is there a way to control oscillation angle, I have DR-HTF004S fan and it has 4 preset angles, 30,60, 90, 120 degrees. Right now turning on and off oscillation sets it to default of 120, I normally keep mine at 30 or 60 degrees.

Again thanks for your wonder work.

This is amazing and works so well! Thank you so much for all your effort! I starred the repo on github. :star2:

Appreciate the comment; I’ve been really swamped lately and haven’t quite kept up with this thread. If you do have a request, can you please add it to the GitHub issues list?

Thanks

If anyone is interested… I was struggling with getting the indentation in the yaml @drashish87 posted above, so based on an expanded version of option #1 I hacked together a functional screen based on mushroom cards that works on my tiny iPhone SE:

YAML:

type: vertical-stack
cards:
  - type: custom:mushroom-fan-card
    entity: fan.dreomax
    icon_animation: true
    layout: vertical
    show_percentage_control: true
    show_oscillate_control: true
    fill_container: false
  - type: entities
    entities:
      - entity: sensor.dreomax_temperature
        name: Current Temp
    header:
      type: graph
      entity: sensor.dreomax_temperature
      detail: 2
    state_color: true
    show_header_toggle: false
  - square: true
    type: grid
    cards:
      - type: custom:mushroom-template-card
        primary: Natural
        icon: mdi:leaf
        entity: fan.dreomax
        icon_color: "{{ 'green' if state_attr('fan.dreomax', 'preset_mode') == 'natural'
          else 'gray' }}"
        layout: vertical
        tap_action:
          action: call-service
          service: fan.set_preset_mode
          target:
            entity_id: fan.dreomax
          data:
            preset_mode: natural
        secondary: ""
        badge_color: ""
        fill_container: false
      - type: custom:mushroom-template-card
        primary: Sleep
        icon: mdi:moon-waning-crescent
        icon_color: "{{ 'purple' if state_attr('fan.dreomax', 'preset_mode') == 'sleep'
          else 'gray' }}"
        layout: vertical
        tap_action:
          action: call-service
          service: fan.set_preset_mode
          target:
            entity_id: fan.dreomax
          data:
            preset_mode: sleep
      - type: custom:mushroom-template-card
        primary: Normal
        icon: mdi:wind-power-outline
        icon_color: "{{ 'cyan' if state_attr('fan.dreomax', 'preset_mode') == 'normal'
          else 'gray' }}"
        layout: vertical
        tap_action:
          action: call-service
          service: fan.set_preset_mode
          target:
            entity_id: fan.dreomax
          data:
            preset_mode: normal
      - type: custom:mushroom-template-card
        primary: Auto
        icon: mdi:autorenew
        icon_color: "{{ 'blue' if state_attr('fan.dreomax', 'preset_mode') == 'auto'
          else 'gray' }}"
        entity: fan.dreomax
        layout: vertical
        tap_action:
          action: call-service
          service: fan.set_preset_mode
          target:
            entity_id: fan.dreomax
          data:
            preset_mode: auto
    columns: 4
  - type: custom:mushroom-template-card
    primary: Beep
    icon: "{{ 'mdi:bell-off' if is_state('switch.dreomax_panel_sound', 'off') else
      'mdi:bell' }}"
    icon_color: "{{ 'red' if is_state('switch.dreomax_panel_sound', 'off') else 'gray' }}"
    entity: switch.dreomax_panel_sound
    layout: vertical
    tap_action:
      action: toggle
    fill_container: true

Hi,

has anyone checked what chipset the dreo fans use for WiFi connection? I don’t have one yet but I’m hopeful that the dreo fans might have a microcontroller that can be flashed with ESPHome (like ESP32 or similar).

Thanks.

So, I might have gone a bit more carried away!!

I love this integration, but yet kept going back to the app as I miss the timer feature at night!

After spending few hours! Viola managed to get that incorporated!!

Works great you can choose between 1 - 10 hours ( Can be customised to any number of hours/mins)

Here are the two options, one with slider and other with buttons :slight_smile:
With option to enable/disable timer

In Action - with Conditional cards to select Timer

In Action - Conditional Card to enable Timer

2 Likes

If you create this entity in HA instead, you aren’t limited to the 10 hour timer and can set automations to turn on and off based on the entity in HA. An input_number should do the job just fine. Or set them to trigger automatically based on the temp of the room (I made and average temp sensor using four temp sensors in the room) and never be too hot or too cold.

EDIT: Nice work though! (Didn’t want you thinking I was crapping on your work)

Its based on a helper & automation, I have intentionally limited to 10 hours as I dont see this being used more than in one go. But it can be increased to any number of hours!

Not sure why, I am still at it for hours, trying to build a card as close as to the stock app.

Progress so far…

Off State with temp

On State with temp, oscillating , speed buttons and timer

On State with temp, oscillating , speed buttons and timer + Modes

2 Likes

After on and off being at this for 14 hours and extensive coding :crazy_face:, pretty happy with the final product.

N before anyone asks, Yes there is a dark mode too, automatic switching at night time :smiley:

Last thing which is left, if OP can advise how to get the speed in increments of 1 to 12 rather than percentage that would be the final piece to the puzzle!

FanCard

1 Like

Ok. This is using some custom card? How did you get the icons to be smaller? I am familiar with HTML/CSS/JS, but have yet to find a way to inject my own code style into the HA UI. Awesome work! Feel like posting your YAML or whatever you created the card in?

I’d almost bet money that they used GitHub - custom-cards/button-card: ❇️ Lovelace button-card for home assistant

I need to explore more I guess… custom-cards look pretty awesome! Glad I posted. Thank you for the link! I don’t play with HA as often as I like and with all the new features it gets overwhelming with the time I spend. Another bookmark and weekend project I think?! :stuck_out_tongue:

1 Like

Give me that money :smiley:

I have made this card using picture-elements

2 Likes

Here you go.

It’s a bit of a complex setup.

CARDS
You need to create 4 conditional cards for each fan
1. Light mode Fan Off
2. Light mode Fan On

3.& 4. - N vice versa for Dark mode.

IMAGES:
You need to take 4 screenshots for the fan pic from your Dreo app.
Similar to above, screenshot to be taken when fan is in Off mode in light and dark mode and Fan is On in light and dark mode.

IMAGES SAVE PATH IN HA
Images (.jpg/.png to save under /www in root folder)
I created images folder under www.
So my path was /local/images/smartfanoff.jpg

Light mode Fan in Off State

type: conditional
conditions:
  - condition: state
    entity: fan.smart_fan
    state: 'off'
  - condition: and
    conditions:
      - condition: state
        entity: sun.sun
        state: above_horizon
card:
  type: custom:stack-in-card
  cards:
    - type: picture-elements
      image: /local/images/smartfanoff.jpg
      elements:
        - type: state-label
          entity: sensor.smart_fan_temperature
          style:
            top: 7%
            left: 85%
            font-weight: semibold
            font-size: 190%
            color: '#000000'
            font-family: Helvetica
            tap_action:
              action: none
        - type: state-label
          entity: fan.smart_fan
          style:
            top: 95%
            left: 50%
            font-weight: semibold
            font-size: 170%
            color: '#000000'
            font-family: Helvetica
          tap_action:
            action: call-service
            service: fan.turn_on
            target:
              entity_id: fan.smart_fan
        - type: icon
          entity: fan.smart_fan
          icon: phu:power-panel-logo
          style:
            top: 7%
            left: 51%
            font-weight: semibold
            font-size: 170%
            color: '#000000'
            font-family: Helvetica
          tap_action:
            action: call-service
            service: fan.turn_on
            target:
              entity_id: fan.smart_fan

Light Mode Fan in On State

type: conditional
conditions:
  - condition: state
    entity: fan.smart_fan
    state: 'on'
  - condition: and
    conditions:
      - condition: state
        entity: sun.sun
        state: above_horizon
card:
  type: custom:stack-in-card
  cards:
    - type: picture-elements
      image: /local/images/smartfanon.jpg
      elements:
        - type: state-label
          entity: sensor.smart_fan_temperature
          style:
            top: 7%
            left: 85%
            font-weight: semibold
            font-size: 190%
            color: '#000000'
            font-family: Helvetica
        - type: state-label
          entity: fan.smart_fan
          attribute: percentage
          suffix: '%'
          style:
            top: 95%
            left: 61%
            font-weight: semibold
            font-size: 170%
            color: '#000000'
            font-family: Helvetica
        - type: state-label
          entity: fan.smart_fan
          attribute: preset_mode
          style:
            top: 95%
            left: 41%
            font-weight: semibold
            font-size: 170%
            color: '#000000'
            font-family: Helvetica
          tap_action:
            action: call-service
            service: automation.toggle
            target:
              entity_id: automation.fan_mode
        - type: icon
          icon: mdi:plus
          entity: fan.smart_fan
          style:
            top: 85%
            left: 10%
            color: '#000000'
          tap_action:
            action: call-service
            service: fan.increase_speed
            target:
              entity_id: fan.smart_fan
        - type: icon
          icon: mdi:minus
          entity: fan.smart_fan
          style:
            top: 85%
            left: 90%
            color: '#000000'
          tap_action:
            action: call-service
            service: fan.decrease_speed
            target:
              entity_id: fan.smart_fan
        - type: icon
          entity: fan.smart_fan
          icon: phu:power-panel-logo
          style:
            top: 7%
            left: 51%
            font-weight: semibold
            font-size: 170%
            color: '#00BFFF'
            font-family: Helvetica
          tap_action:
            action: call-service
            service: fan.turn_off
            target:
              entity_id: fan.smart_fan
        - type: icon
          icon: mdi:timer-check-outline
          entity: fan.smart_fan
          style:
            top: 35%
            left: 10%
            color: '#000000'
          tap_action:
            action: call-service
            service: automation.toggle
            target:
              entity_id: automation.smart_fan_turn_off_timer
        - type: icon
          icon: mdi:arrow-oscillating
          style:
            top: 35%
            left: 90%
            color: '#000000'
          tap_action:
            action: call-service
            service: fan.oscillate
            target:
              entity_id: fan.smart_fan
            data:
              oscillating: true
        - type: icon
          icon: mdi:arrow-oscillating-off
          style:
            top: 45%
            left: 90%
            color: '#000000'
          tap_action:
            action: call-service
            service: fan.oscillate
            target:
              entity_id: fan.smart_fan
            data:
              oscillating: false
    - type: conditional
      conditions:
        - condition: state
          entity: fan.smart_fan
          state: 'on'
        - condition: and
          conditions:
            - condition: state
              entity: automation.fan_mode
              state: 'on'
      card:
        type: horizontal-stack
        cards:
          - type: custom:mushroom-template-card
            primary: Natural
            secondary: ''
            icon: mdi:leaf
            icon_color: >-
              {% if states['fan.smart_fan'].attributes.preset_mode == 'natural'
              %}
                  amber
                {% else %}
                  grey
                {% endif %}
            layout: vertical
            tap_action:
              action: call-service
              service: fan.set_preset_mode
              target:
                entity_id: fan.smart_fan
              data:
                preset_mode: natural
            entity: fan.smart_fan
          - type: custom:mushroom-template-card
            primary: Sleep
            secondary: ''
            icon: mdi:moon-waning-crescent
            icon_color: |-
              {% if states['fan.smart_fan'].attributes.preset_mode == 'sleep' %}
                  purple
                {% else %}
                  grey
                {% endif %}
            layout: vertical
            tap_action:
              action: call-service
              service: fan.set_preset_mode
              target:
                entity_id: fan.smart_fan
              data:
                preset_mode: sleep
            entity: fan.smart_fan
          - type: custom:mushroom-template-card
            primary: Normal
            secondary: ''
            icon: mdi:wind-power-outline
            icon_color: >-
              {% if states['fan.smart_fan'].attributes.preset_mode == 'normal'
              %}
                  blue
                {% else %}
                  grey
                {% endif %}
            layout: vertical
            tap_action:
              action: call-service
              service: fan.set_preset_mode
              target:
                entity_id: fan.smart_fan
              data:
                preset_mode: normal
            entity: fan.smart_fan
          - type: custom:mushroom-template-card
            primary: Auto
            secondary: ''
            icon: mdi:autorenew
            icon_color: |-
              {% if states['fan.smart_fan'].attributes.preset_mode == 'auto' %}
                  cyan
                {% else %}
                  grey
                {% endif %}
            layout: vertical
            tap_action:
              action: call-service
              service: fan.set_preset_mode
              target:
                entity_id: fan.smart_fan
              data:
                preset_mode: auto
            entity: fan.smart_fan
    - type: conditional
      conditions:
        - condition: state
          entity: fan.smart_fan
          state: 'on'
        - condition: and
          conditions:
            - condition: state
              entity: automation.smart_fan_turn_off_timer
              state: 'on'
      card:
        type: custom:mushroom-number-card
        entity: input_number.fan_off_timer
        display_mode: slider
        name: Turn Off After
        hold_action:
          action: call-service
          service: automation.toggle
          target:
            entity_id: automation.smart_fan_turn_off_timer
        icon: mdi:clock:timer

For the Dark mode the code is same except
1.Change the condition to below_horizon, so that this card is only displayed in dark mode
2.Change the color to white so that you can see the Text/Icons in Dark mode.

2 Likes

Forgot picture entities let you do that. I used to have an interactive floor plan before i moved using them

Dear Dreo fan owners, is this integration offline or do the Dreo fans require an internet connection to be controlled? I hope not (and if, I’d have to search for a different fan that can be integrated). Thanks!

1 Like

It is cloud dependent but very fast in response.