Dyson switch - Turned on, auto mode & speed selection

Hello, found an other script to update HA GUI when the fan speed is changed in the Dyson app. This one not only works at the power on value but keeps both values in sync.

alias: >-
  [Integration] - Fan Speed: Update HA GUI from Dyson Fan
  Speed Changes
description: ''
trigger:
  - platform: template
    value_template: >-
      {% if (states.fan.dyson_pure_hot_cool.attributes.speed|int) !=
      (states.input_number.dyson_pure_hot_cool_integration_fan_speed.state|int)
      %}true{%endif%}
condition: []
action:
  - service: input_number.set_value
    data:
      value: '{{states.fan.dyson_pure_hot_cool.attributes.speed|int}}'
    entity_id: input_number.dyson_pure_hot_cool_integration_fan_speed
mode: single
initial_state: 'on'

So this has been bugging me for weeks and Iā€™ll mess with it than give up.

I have a working Lovelace card for my Dyson Fan. I have a set input in my config but i cannot get the card to update if i change the fan speed through the Dyson App or the remote control. I swear I use to have it working before but months ago. I am trying the above automation but it does not seem to work.

The only difference I have here is my fan is called ā€˜fan.dyson_officeā€™ and my input_number is 'input_number.dyson_fan_speed

trigger:
  - platform: template
    value_template: >-
      {% if (states.fan.dyson_office.attributes.speed|int) !=
      (states.input_number.dyson_fan_speed.state|int) %}true{%endif%}
condition: []
action:
  - service: input_number.set_value
    data:
      value: '{{states.fan.dyson_pure_hot_cool.attributes.speed|int}}'
    entity_id: input_number.dyson_fan_speed
mode: single
initial_state: 'on'

I just tested it again and still works correctly (update speed in Dyson app triggers an update in HA)

My automation is following:

alias: '[Climate] - Ventilation Master Bedroom: Fan Speed from Dyson App to HA GUI'
description: 'v0.01 - 2021-06-07: Automation Created'
trigger:
  - platform: state
    entity_id: fan.master_bedroom_dyson_pure_cool
    attribute: percentage
    for: '00:00:02'
condition:
  - condition: template
    value_template: >-
      {% if
      (states.fan.master_bedroom_dyson_pure_cool.attributes.percentage|int) !=
      (states.input_number.fan_master_bedroom_dyson_speed_percentage.state|int)
      %} true {%endif%}
action:
  - service: input_number.set_value
    target:
      entity_id: input_number.fan_master_bedroom_dyson_speed_percentage
    data:
      value: '{{states.fan.master_bedroom_dyson_pure_cool.attributes.percentage|int}}'
mode: single

The Dyson integration has given problems and was removed from the standard HA core. Did you migrate to the community based (HACS) integration?

Iā€™ll give this a try!

I have added the HACS Dyson Cloud & Dyson Local. It is working for one of my fans but not the other. Need to dive into that as well.

Same here, both fans have other ways of interacting (services).

This works for me with the UI updating!!! THANK YOU SO MUCH

1 Like

Hi,

I really like your Fan Button Card. May I ask where you put this ā€œinput number for fan speedā€? do I put it in configuration.yml?

Thank you! Yes thatā€™s correct!