Hello, i wanted to include my Dyson Fan into HASSIO. Initially i thought about opening it up, and connecting an arduino to it… but i’m too chicken to try it out… fear of breaking and lack of knowledge…
So, i tried to include it into HASSIO using my Harmony Bridge. It took some time to figure it all out, but im very happy with the function right now.
It basically gives you 2 Sliders (1 for Speed, 1 for Timer) & 2 Switches (1 for Power, 1 for Oscilliate)
I tried to copy the functionality and logic of the original remote with several automations.
For example: You can turn on the Fan by just pressing oscillate button. Or by just pressing Fan Up button. This is all represented now and for now i have not found a breaking issue
Functions:
Turn on Fan via Slider or Switch (Fan automatically goes to the desired Level)
Turn On / Off Ocillation (Power On is toggled as well from Off state)
Adjust Speed
Turn Off via Slider or Button (The Fan will always go down to 1 first, and then turn off)
Timer is not using the built in Dyson Timer, but actually a more flexible Timer builtin Hassio
I’d like to add a countdown timer as well so you can see how much time is left… But so far every attempt has failed. Any ideas welcome
However, it requires you to ditch the remote, as this is IR based, and cannot report outside states into HASSIO.
This is how it looks right now:
As I am still very much new to HASSIO, have no coding experience and am constantly wondering why something works or doesnt work… i’d be very happy for some good advice on how to streamline all of these below:
So this is what you need to do to copy it:
configuration.yaml
#Dyson LivingRoom
# Define input_slider
input_slider:
livingroom_fanspeed:
name: Speed
initial: 0
min: 0
max: 10
step: 1
icon: mdi:fan
# Define input_slider
livingroom_fantime:
name: Timer
initial: 0
min: 0
max: 120
step: 5
icon: mdi:timer
#Switches
input_boolean:
livingroomfanpower:
name: PowerToggle
initial: off
icon: mdi:power
livingroomfanoscillate:
name: Oscillate
initial: off
icon: mdi:code-tags
automations.yaml
# Dyson LR FanSpeedUP Slider
- action:
- data_template:
command: FanSpeedUp
delay_secs: '0.25'
device: '37767707'
entity_id: remote.living_room
num_repeats: '{{ trigger.to_state.state | int - trigger.from_state.state | int
}}'
service: remote.send_command
alias: FanSpeedUpDL
condition:
condition: and
conditions:
- condition: template
value_template: '{{ trigger.from_state.state | int < trigger.to_state.state
| int }}'
- condition: template
value_template: '{{ 0 < trigger.from_state.state | int }}'
id: '1505854845181'
trigger:
- entity_id: input_slider.livingroom_fanspeed
platform: state
# Dyson LR FanSpeedDOWN Slider
- action:
- data_template:
command: FanSpeedDown
delay_secs: '0.25'
device: '37767707'
entity_id: remote.living_room
num_repeats: '{{ trigger.from_state.state | int - trigger.to_state.state | int
}}'
service: remote.send_command
alias: FanSpeedDownDL
condition:
condition: and
conditions:
- condition: template
value_template: '{{ trigger.from_state.state | int > trigger.to_state.state
| int }}'
- condition: template
value_template: '{{ 0 < trigger.to_state.state | int }}'
id: '1505854845193'
trigger:
- entity_id: input_slider.livingroom_fanspeed
platform: state
# Dyson LR Oscillate
- action:
- data_template:
command: Oscillate
delay_secs: '0.25'
device: '37767707'
entity_id: remote.living_room
service: remote.send_command
alias: OscillateDL
id: '1505854845197'
trigger:
- entity_id: input_boolean.livingroomfanoscillate
platform: state
#Dyson LR Speed up to sliderstate from 0
- action:
- data_template:
command: FanSpeedUp
delay_secs: '0.25'
device: '37767707'
entity_id: remote.living_room
num_repeats: '{{ trigger.to_state.state | int - trigger.from_state.state | int
- 1 }}'
service: remote.send_command
alias: Turn on from zero
condition:
condition: and
conditions:
- condition: template
value_template: '{{ trigger.from_state.state | int < 1 }}'
- condition: template
value_template: '{{ trigger.to_state.state | int > 1 }}'
id: '1505854845189'
trigger:
- entity_id: input_slider.livingroom_fanspeed
platform: state
#Dyson LR Turn on to 1 from 0
- action:
- data_template:
command: PowerToggle
delay_secs: '0.25'
device: '37767707'
entity_id: remote.living_room
service: remote.send_command
alias: Turn on to one
condition:
condition: and
conditions:
- condition: template
value_template: '{{ trigger.from_state.state | int < 1 }}'
- condition: template
value_template: '{{ trigger.to_state.state | int < 2 }}'
id: '1505854845198'
trigger:
- entity_id: input_slider.livingroom_fanspeed
platform: state
#Dyson LR Turn Down Speed to 1 and then turn off
- action:
- data_template:
command: FanSpeedDown
delay_secs: '0.25'
device: '37767707'
entity_id: remote.living_room
num_repeats: '{{ trigger.from_state.state | int - trigger.to_state.state | int
}}'
service: remote.send_command
- data_template:
command: PowerToggle
delay_secs: '0.25'
device: '37767707'
entity_id: remote.living_room
service: remote.send_command
alias: Turn off when zero
condition:
condition: template
value_template: '{{ trigger.to_state.state | int < 1 }}'
id: '1505854845190'
trigger:
- entity_id: input_slider.livingroom_fanspeed
platform: state
#Dyson LR Turn On Power if Oscillate is turned on
- action:
- service: input_boolean.turn_on
data:
entity_id: input_boolean.livingroomfanpower
alias: OscillatePower
id: '1505854845101'
trigger:
platform: state
entity_id: input_boolean.livingroomfanoscillate
to: 'on'
#Dyson LR Turn Off Oscillate if Power is turned off
- action:
- service: input_boolean.turn_off
data:
entity_id: input_boolean.livingroomfanoscillate
alias: OscillatePower
id: '1505854845101'
trigger:
platform: state
entity_id: input_boolean.livingroomfanpower
to: 'off'
#Dyson LR Turn Slider to 0 if PowerButton is Off
- action:
- service: input_slider.select_value
data_template:
entity_id: input_slider.livingroom_fanspeed
value: '0'
alias: PowerOff
id: '1505854845102'
trigger:
platform: state
entity_id: input_boolean.livingroomfanpower
to: 'off'
#Dyson LR Turn Off Power if Slider is turned to 0
- action:
- service: input_boolean.turn_off
data:
entity_id: input_boolean.livingroomfanpower
alias: PowerOff
id: '1505854845108'
trigger:
platform: state
entity_id: input_slider.livingroom_fanspeed
to: '0.0'
#Dyson LR Turn Slider to 1 if Power is on
- action:
- service: input_slider.select_value
data_template:
entity_id: input_slider.livingroom_fanspeed
value: '1'
alias: PowerOn
condition:
condition: template
value_template: '{{ states.input_slider.livingroom_fanspeed.state | int < 1 }}'
id: '1505854845107'
trigger:
platform: state
entity_id: input_boolean.livingroomfanpower
to: 'on'
#Dyson LR Turn on Power if Slider > 1
- action:
- service: input_boolean.turn_on
data:
entity_id: input_boolean.livingroomfanpower
alias: PowerOn
id: '1505854845109'
trigger:
platform: state
entity_id: input_slider.livingroom_fanspeed
condition:
condition: template
value_template: '{{ trigger.to_state.state | int > 0 }}'
#Dyson LR Timer LR Dyson
- action:
- delay: '00:{{ states.input_slider.livingroom_fantime.state | int }}:00'
- service: input_boolean.turn_off
data:
entity_id: input_boolean.livingroomfanpower
alias: PowerOff Timer
id: '1505854845158'
trigger:
platform: state
entity_id: input_slider.livingroom_fantime
condition:
condition: template
value_template: '{{ trigger.to_state.state | int > 0 }}'
groups.yaml
#LivingRoomFan
card_dysonlr:
name: Dyson Wohnzimmer
entities:
- input_boolean.livingroomfanoscillate
- input_boolean.livingroomfanpower
- input_slider.livingroom_fanspeed
- input_slider.livingroom_fantime