WIFI Dyson Pure Cool Link Full Setup

Hello, i would like to share my full configuration for the Dyson Pure cool Link Fans.

You will need 1 input_number and 2 automations to create the fan speed slider + 1 input_boolean, 2 scripts and 2 automations to creat the ‘oscillate button’.

###speed###

  dyson_fan_speed:
    icon: mdi:fan
    name: Speed
    initial: 1
    min: 1
    max: 10
    step: 1

 - alias: "Dyson Fan Speed From Input Boolean"
   initial_state: on
   trigger:
     - platform: state
       entity_id: input_number.dyson_fan_speed
   condition:
     condition: and
     conditions:
       - condition: template
         value_template: '{{ (trigger.to_state.state | int) != (states.fan.salon.attributes.speed|int) }}'
   action:
     - service: fan.set_speed
       entity_id: fan.salon
       data_template:
         speed: '{{states.input_number.dyson_fan_speed.state|int}}'

 - alias: "Dyson Fan Speed From Component"
   initial_state: on
   trigger:
     - platform: template
       value_template: '{% if (states.fan.salon.attributes.speed|int) != (states.input_number.dyson_fan_speed.state|int) %}true{%endif%}'
   action:
     - service: input_number.set_value
       entity_id:  input_number.dyson_fan_speed
       data_template:
         value: '{{states.fan.salon.attributes.speed|int}}'

###oscillate###

  fan:
    name: Fan
    initial: off

'1516402506314':
  alias: Fan oscillate on
  sequence:
  - data:
      entity_id: fan.salon
      oscillating: 'true'
    service: fan.oscillate
    
'1516402701204':
  alias: Fan oscillate off
  sequence:
  - data:
      entity_id: fan.salon
      oscillating: 'false'
    service: fan.oscillate

 - alias: 'Oscillate On'
   initial_state: on
   trigger:
     - platform: state
       entity_id: input_boolean.fan
       to: 'on'
   action:
     - service: script.turn_on
       entity_id: script.1516402506314
     
 - alias: 'Oscillate Off'
   initial_state: on
   trigger:
     - platform: state
       entity_id: input_boolean.fan
       to: 'off'
   action:
     - service: script.turn_on
       entity_id: script.1516402701204

The result should look like this:

Note the slider on the power fan line is from the custom_ui_state_card for light. It would be perfect to have the fan speed slider in this position and save one line, will look better.

I would to give a big thank Jer78, he’s the one behind the code.

1 Like

hi! thanks for sharing. I am not really skilled with HA (yet) were this code should go? should i split it into parts (automation/groups/script)?

right now the only thing i have in configuration is this:

dyson:
username: ***
password: ***
language: IT
devices:
- device_id: ***
device_ip: ***

i can only turn it on and off…

thanks again!

Hello jero537, hope you will understand with this:

SPEED

input number:

dyson_fan_speed:
  icon: mdi:fan
  name: Speed
  initial: 1
  min: 1
  max: 10
  step: 1

automation:

- alias: "[Dyson] mis a jour par Input Number"
  initial_state: on
  trigger:
    - platform: state
      entity_id: input_number.dyson_fan_speed
  condition:
    condition: and
    conditions:
      - condition: template
        value_template: '{{ (trigger.to_state.state | int) != (states.fan.salon.attributes.speed|int) }}'
  action:
    - service: fan.set_speed
      entity_id: fan.salon
      data_template:
        speed: '{{states.input_number.dyson_fan_speed.state|int}}'

- alias: "[Dyson] met a jour Input Number"
  initial_state: on
  trigger:
    - platform: template
      value_template: '{% if (states.fan.salon.attributes.speed|int) != (states.input_number.dyson_fan_speed.state|int) %}true{%endif%}'
  action:
    - service: input_number.set_value
      entity_id:  input_number.dyson_fan_speed
      data_template:
        value: '{{states.fan.salon.attributes.speed|int}}'

OSCILLATE

input_boolean:

fan:
  name: Fan
  initial: off

script:

'1516402506314':
  alias: '[Dyson] rotation on'
  sequence:
  - data:
      entity_id: fan.salon
      oscillating: 'true'
    service: fan.oscillate

'1516402701204':
  alias: '[Dyson] rotation off'
  sequence:
  - data:
      entity_id: fan.salon
      oscillating: 'false'
    service: fan.oscillate

automation:

- alias: '[Dyson] Rotation On'
  initial_state: on
  trigger:
    - platform: state
      entity_id: input_boolean.fan
      to: 'on'
  action:
    - service: script.turn_on
      entity_id: script.1516402506314
     
- alias: '[Dyson] Rotation Off'
  initial_state: on
  trigger:
    - platform: state
      entity_id: input_boolean.fan
      to: 'off'
  action:
    - service: script.turn_on
      entity_id: script.1516402701204

YES!

now it’s all about the custom card! thanks a lot

How do I get the custom panel above? I set up the Dyson account and I can control most things, but it would nice to have it all together like you have above. Thanks!

1 Like

@Romquenin how did you do the custom state card? Can you elaborate please. Thanks

Would it be possible to indicate what code goes in what file for us the mare mortals? :stuck_out_tongue: thanks!

I can’t figure out how to get this card looking as nice as yours. I’ve tried integrating the code and setting it up as a package yaml but have had not luck. Do you have a step by step to get it working? Where exactly to put the code etc… Thanks

Hi,

Someone could please explain how to create the card once the code is deployed?

Thank you

Hi!,
i’m new in HA, i’ve got HA v1.108.5; i’ve use the implementation

dyson:
username: ***
password: ***
language: IT
devices:
- device_id: ***
device_ip: ***

Now i can see the devices and turn on_off, temperature, umidity and air quality.
How can implemate your card and where i must copy and past your code? thank you very much.

i tried pasting the content on different files, but i guess i’m also too noobie to get a nice result as the one who created the subject :confused:
obviously i’m not the only one missing something :confused:

I also own a dyson hot and cool and did not find how to make it hot :confused:
first device where i have troubles :confused:

Of course i managed to turn it on/off or to start oscillation but the card is too basic and i can’t put the mode to hot …

I really hope someone could give more advice or improve the documentation

I don’t think it works anymore. From here:

Hi everyone here is my new lovelace style for the dysonfan:

I use different type of custom-card to achieve this:

  • custom:button card
  • custom:decluttering-card
  • custom:slider-entity-row
  • custom:vertical-stack-in-card

Here the code i use:

- decluttering-card

  button_dyson_fan:
    card: 
      type: 'custom:button-card'  
      color: auto
      size: 50%
      icon: '[[icon]]'
      entity: '[[entity]]'
      show_last_changed: true
      aspect_ratio: 1/1
      show_state: true
      name: '[[name]]'
      show_label: true
      tap_action:
        action: toggle
        haptic: light
      hold_action:
        action: more-info
        haptic: success
      double_tap_action:         
        action: call-service
        service: browser_mod.popup
        service_data:
          title: DYSON PURE COOL LINK
          card:   
            type: entities      
            show_header_toggle: false
            style: |
              ha-card {             
                box-shadow: 
                  {% if is_state('sun.sun', 'above_horizon') %}
                    inset -4px -4px 8px 0 rgba(255,255,255,.5), inset 4px 4px 8px 0 rgba(0,0,0,.03);
                  {% elif is_state('sun.sun', 'below_horizon') %}                      
                    inset -4px -4px 10px 0 rgba(50, 50, 50,.5), inset 4px 4px 12px 0 rgba(0,0,0,.3); 
                  {% endif %}     
              }                     
            entities:
              - type: custom:vertical-stack-in-card
                cards:  
                  - type: glance
                    show_name: false
                    entities:
                      - sensor.dyson_pure_cool_linktm_aqi
                      - sensor.dyson_pure_cool_linktm_dust
                      - sensor.dyson_pure_cool_linktm_filter_life            

                  - type: entities
                    show_header_toggle: false
                    entities:
                      - type: custom:hui-horizontal-stack-card
                        cards:
                          - type: custom:button-card
                            style: |
                              ha-card {
                                --paper-card-background-color: 'rgba(11, 11, 11, 0.00)';
                                background: none;
                                box-shadow: none;                               

                              }                            
                            entity: fan.dyson_pure_cool_linktm
                            show_name: false
                            size: 40px
                            color: rgb(66, 134, 244)
                            color_off: rgb(75, 75, 77)                       
                            icon: mdi:fan
                          - type: custom:button-card
                            style: |
                              ha-card {
                                --paper-card-background-color: 'rgba(11, 11, 11, 0.00)';
                                background: none;
                                box-shadow: none;                               

                              }                               
                            entity: input_boolean.fan
                            show_name: false
                            size: 40px
                            color: rgb(66, 134, 244)
                            color_off: rgb(75, 75, 77)                  
                            icon: mdi:rotate-3d-variant              
                      - type: custom:slider-entity-row
                        entity: input_number.dyson_fan_speed
                        full_row: true
                        toggle: true                         
                        hide_state: true

          deviceID:
            - this

      style: |
        ha-card {
          box-shadow: 
            {% if is_state('sun.sun', 'above_horizon') and is_state('[[entity]]', 'on') %}
              inset -4px -4px 8px 0 rgba(255,255,255,.5), inset 4px 4px 8px 0 rgba(0,0,0,.03);
            {% elif is_state('sun.sun', 'above_horizon') and is_state('[[entity]]', 'off') %}                      
              -5px -5px 8px 0 rgba(255,255,255,.5),5px 5px 8px 0 rgba(0,0,0,.03);
            {% elif is_state('sun.sun', 'below_horizon') and is_state('[[entity]]', 'on') %}                      
              inset -4px -4px 10px 0 rgba(50, 50, 50,.5), inset 4px 4px 12px 0 rgba(0,0,0,.3); 
            {% elif is_state('sun.sun', 'below_horizon') and is_state('[[entity]]', 'off') %}   
              -5px -5px 8px 0 rgba(50, 50, 50,.5),5px 5px 8px 0 rgba(0,0,0,.15);
            {% endif %}     
        } 
      styles:
        card:
          - background-color: var(--primary-background-color)      
          - padding-left: 10px

          - border-radius: 20px
        name:
          - justify-self: start
          - padding: 0px 10px          
          - font-weight: bold
          - font-size: 13px
        label:
          - font-size: 11px
          - font-family: Helvetica
          - padding: 0px 10px
          - justify-self: start
        state:
          - font-size: 11px
          - font-family: Helvetica
          - padding: 1px 10px
          - justify-self: start
          - text-transform: capitalize
          - font-weight: bold
        grid:
          - grid-template-areas: '"i" "n" "s" "l"'
          - grid-template-columns: 1fr
          - grid-template-rows: 1fr min-content min-content
        img_cell:
          - justify-content: start
          - align-items: start
      state:
        - value: 'on'
          spin: true
          styles:
            card:
              - box-shadow: 0px 0px 3px 2px var 
            icon:
              - spin: true
              - color: 'lime'          
            state:
              - color: lime
          id: on-icon
        - value: 'off'
          styles:
            card:
              - box-shadow: 0px 0px 3px 2px var
              # - opacity: 0.3
            state:
              - color: 'red'
          id: off-icon
        - value: unavailable
          styles:
            card:
              - opacity: 0.2
              - color: grey
              - '--paper-item-icon-color': grey
            label:
              - color: 'rgba(0, 0, 0, 0.0)'

- lovelace

          - type: custom:decluttering-card
            template: button_dyson_fan
            variables:
              - name: Ventilo
              - entity: fan.dyson_pure_cool_linktm 
              - icon: mdi:fan #or something else

Hope it will help you configure your cards.

omg… there’s simply no hope for me :)) I don’t know how you (and others here) manage to come up with these things. I’m about four months in with HA and still wrestling around with what I assume are the basics of templating, variables, and scripts. Besides the Dyson fan part of it, the rest of your setup looks pretty damn nice too.

Thank you for posting all the code though. It’s the only way I can ever really figure things out - attempting to decipher and understand why the code is the way it is.

I am have setup the code as it is. But its not working as it should.
If i change fan speed on the fan, then it is captured in HA. If i change the speed in HA, by the slider, it doesnt changed, rather change back to where it was before i started to change.
It means “Dyson Fan Speed From Component” automation is working for sure. But not “Dyson Fan Speed From Input Boolean”.
Any idea why this might happen?

following is my code

- alias: Dyson Fan Speed From Component
  initial_state: true
  trigger:
  - platform: template
    value_template: '{% if (states.fan.living_room.attributes.dyson_speed|int) !=
      (states.input_number.dyson_fan_speed.state|int) %}true{%endif%}'
  action:
  - service: input_number.set_value
    entity_id: input_number.dyson_fan_speed
    data_template:
      value: '{{states.fan.living_room.attributes.dyson_speed|int}}'
  id: 8b88c646ae3743448bd6ddcd6e54d406
- id: '1592326523644'
  alias: Dyson Fan Speed From Input Boolean
  description: ''
  trigger:
  - entity_id: input_number.dyson_fan_speed
    platform: state
  condition:
  - condition: and
    conditions:
    - condition: template
      value_template: '{{ (trigger.to_state.state | int) != (states.fan.living_room.attributes.dyson_speed
        | int) }}'
  action:
  - data:
      dyson_speed: '{{states.input_number.dyson_fan_speed.state|int}}'
    entity_id: fan.living_room
    service: fan.set_speed

update: i found out that trigger is working but only action part is not working.
if i try setting the speed as a number it works:
image
but as soon as i use the variable, it doesnt work. code and error is attached bellow.


image

I think you should be calling the service

set.fan_speed

instead of

dyson.set_speed

I think you mean fan.set_spped.
Fan.set_speed service only allow me set between low, medium and high. To Set speed with number i have to use dyson.set_spped

if i use automation GUI, then i cant get this working. But if i just write this, then it works!

do you how can i control the direction of the fan? I tried the following, but didnt work
image

update: correct way to do this:
image