Automating My Dyson Fan for Temperature Control: A Home Assistant Journey

Recently, I’ve been on a mission to optimize my home’s comfort using Home Assistant. One of the most exciting projects I’ve undertaken is automating my Dyson Hot+Cool fan to adjust based on temperature changes. Here’s my journey and the solutions I found!

The Setup

I wanted my fan to turn on when it gets too hot and off when it cools down. Initially, I used a weather sensor, but I’ve since switched to a room sensor for more accurate readings. Here’s my current automation setup:

yaml

Dyson fan on when it is too hot

  • id: auto_dyson_fan_on
    alias: Dyson Fan on above 16C
    trigger:
    platform: numeric_state
    entity_id: sensor.room_temperature
    above: 16
    action:
    • service: switch.turn_on
      entity_id: switch.dyson_fan
    • service: notify.ios_ng_iphone
      data:
      message: ‘IT IS HOT!!! {{ sensor.room_temperature }}%’

Dyson fan off when it is too cold

  • id: auto_dyson_fan_off
    alias: Dyson Fan off below 16C
    trigger:
    platform: numeric_state
    entity_id: sensor.room_temperature
    below: 16
    action:
    • service: switch.turn_off
      entity_id: switch.dyson_fan
    • service: notify.ios_ng_iphone
      data:
      message: ‘IT IS COLD!!! {{ sensor.room_temperature }}%’

The Challenge

While the fan turns on and off as expected, I wanted it to adjust its strength based on how hot or cold it is. This is where things got tricky. I needed a way to increment or decrement the fan’s speed automatically without manual intervention.

The Solution

After some research, I found that using Broadlink with Home Assistant allows me to simulate button presses on the Dyson remote. Here’s how I implemented it:

  1. Current Strength Tracking: I created a variable to track the current fan strength.
  2. Target Strength Calculation: Based on the temperature, I determine the target strength.
  3. Button Press Simulation: Using Broadlink, I send commands to increase or decrease the fan’s strength to reach the target.

Here’s a simplified version of the code I used:

yaml

Adjust fan strength based on temperature

  • id: auto_dyson_fan_adjust
    alias: Dyson Fan Strength Adjustment
    trigger:
    platform: numeric_state
    entity_id: sensor.room_temperature
    condition:
    condition: numeric_state
    entity_id: sensor.current_fan_strength
    below: target_fan_strength
    action:
    • service: broadlink.send
      data:
      command: fan_increase
    • service: input_number.set_value
      data:
      entity_id: input_number.current_fan_strength
      value: ‘{{ states(’‘input_number.current_fan_strength’‘) + 1 }}’

The Outcome

This setup has been a game-changer for my home comfort. The fan now not only turns on and off but also adjusts its speed based on the room’s temperature, providing the perfect balance. It’s been running smoothly for weeks, and I couldn’t be happier with the result!

If anyone has questions or suggestions on how to improve this further, I’d love to hear them. Happy automating! :thermometer::dash: