DrSpaldo
(Doctor Spalding)
February 13, 2020, 9:02am
21
Hi @mgim ,
This is what I have ended up with: (all toggle buttons)
This is the code in lovelace I used:
- type: glance
title: Dyson Fan Control
entities:
- entity: switch.fanpower
tap_action:
action: toggle
- entity: switch.fan_auto
tap_action:
action: toggle
- entity: switch.fan_night
icon: mdi:weather-night
tap_action:
action: toggle
- entity: switch.oscillation
tap_action:
action: toggle
I made a switch for each mode and then refer to the switch in lovelace.
switch:
- platform: template
switches:
# DYSON FAN SWITCHES
fanpower:
friendly_name: "Fan Power"
value_template: "{{ ( is_state('fan.living_room', 'on') or is_state_attr('fan.living_room', 'auto_mode', true) )}}"
turn_on:
service: fan.turn_on
data:
entity_id: fan.living_room
turn_off:
service: fan.turn_off
data:
entity_id: fan.living_room
icon_template: >
{% if is_state('fan.living_room', 'on') or is_state_attr('fan.living_room', 'auto_mode', true) %}
mdi:fan
{% else %}
mdi:minus-circle-outline
{% endif %}
oscillation:
friendly_name: Oscillation
value_template: "{{ ( is_state('fan.living_room', 'on') or is_state_attr('fan.living_room', 'auto_mode', true) ) and is_state_attr('fan.living_room', 'oscillating', true) }}"
turn_on:
service: fan.oscillate
data:
entity_id: fan.living_room
oscillating: true
turn_off:
service: fan.oscillate
data:
entity_id: fan.living_room
oscillating: false
icon_template: >
{% if is_state('fan.living_room', 'on') or is_state_attr('fan.living_room', 'auto_mode', true) and is_state_attr('fan.living_room', 'oscillating', true) %}
mdi:cached
{% else %}
mdi:minus-circle-outline
{% endif %}
fan_night:
friendly_name: "Night Mode"
value_template: "{{ ( is_state('fan.living_room', 'on') or is_state_attr('fan.living_room', 'auto_mode', true) ) and is_state_attr('fan.living_room', 'night_mode', true) }}"
turn_on:
service: dyson.set_night_mode
data:
entity_id: fan.living_room
night_mode: true
turn_off:
service: dyson.set_night_mode
data:
entity_id: fan.living_room
night_mode: false
icon_template: >
{% if is_state('fan.living_room', 'on') and is_state_attr('fan.living_room', 'night_mode', true) %}
mdi:weather-night
{% else %}
mdi:minus-circle-outline
{% endif %}
fan_auto:
friendly_name: "Auto Mode"
value_template: "{{ is_state_attr('fan.living_room', 'auto_mode', true) }}"
turn_on:
service: dyson.set_auto_mode
data:
entity_id: fan.living_room
auto_mode: true
turn_off:
service: dyson.set_auto_mode
data:
entity_id: fan.living_room
auto_mode: false
icon_template: >
{% if is_state_attr('fan.living_room', 'auto_mode', true) %}
mdi:brightness-auto
{% else %}
mdi:minus-circle-outline
{% endif %}
3 Likes
mgim
February 14, 2020, 9:51pm
22
Perfect! That is sooo useful! Here is my UI now.
If Dyson is off:
If Dyson is on:
1 Like
DrSpaldo
(Doctor Spalding)
February 14, 2020, 11:33pm
23
Oh nice, that looks good! Are you able to post yours as well? I might use some of it
mgim
February 15, 2020, 12:10am
24
Sure!
For the card:
cards:
- entity: switch.dyson_fan_power
hold_action:
action: more-info
icon: 'mdi:fan'
name: Dyson
show_icon: true
show_name: true
tap_action:
action: toggle
type: entity-button
- card:
cards:
- entities:
- entity: input_number.dyson_fan_speed
name: Fan speed
type: entities
- entities:
- entity: switch.dyson_auto_mode
icon: 'mdi:brightness-auto'
name: Auto
tap_action:
action: toggle
- entity: switch.dyson_night_mode
icon: 'mdi:weather-night'
name: Night
tap_action:
action: toggle
- entity: switch.dyson_oscillation
name: Oscillate
tap_action:
action: toggle
type: glance
- control:
hvac: true
decimals: 0
entity: climate.dyson
hide:
state: true
label:
temperature: Bedroom
name: false
sensors:
- entity: sensor.paris_02e_arrondissement_temperature
name: Paris
- entity: sensor.meross_1_daily_cost
name: Today
step_size: 1
type: 'custom:simple-thermostat'
type: 'custom:vertical-stack-in-card'
conditions:
- entity: switch.dyson_fan_power
state: 'on'
type: conditional
type: 'custom:vertical-stack-in-card'
input number for fan speed
# inputnumber to control dyson fan speed on UI
dyson_fan_speed:
name: Dyson fan speed
min: 1
max: 10
step: 1
icon: mdi:fan
and the related automations:
- id: '1581251639556'
alias: Dyson fan speed controller
description: ''
trigger:
- entity_id: input_number.dyson_fan_speed
platform: state
condition: []
action:
- data_template:
speed: '{{states(''input_number.dyson_fan_speed'')|int}}'
entity_id: fan.dyson
service: fan.set_speed
- id: '1581284638564'
alias: Update Dyson UI controllers
description: ''
trigger:
- entity_id: fan.dyson
platform: state
to: 'on'
condition: []
action:
- data_template:
value: '{{state_attr(''fan.dyson'', ''speed'')}}'
entity_id: input_number.dyson_fan_speed
service: input_number.set_value
There is maybe a way to improve the fan speed controller automation but it works for now.
2 Likes
DrSpaldo
(Doctor Spalding)
February 15, 2020, 1:01am
25
Great, thanks @mgim . I was thinking of implementing the speed controller, making it an conditional entry and only displayed when the fan is not in auto mode. I will have a go at that
1 Like
DrSpaldo
(Doctor Spalding)
February 16, 2020, 6:16am
26
@mgim What do the id numbers do in the automationās?
mgim
February 16, 2020, 10:40am
27
Nothing. They are automatically generated when using the configuration ui for automation
DrSpaldo
(Doctor Spalding)
February 16, 2020, 12:54pm
28
Ah ok, thanks @mgim
So after looking at yours, now I have modified mine so that it shows the speed slider when it is turned on normal mode:
Then the slider goes away when it is turned on auto mode:
New HA user here so please bear with me. I have managed to get the dyson fan integrated and can control via the lovelace card.
When I toggle AUTO it turns the switch off. How can I control AUTO/NIGHT via the lovelace card?
Do i have to create a switch to toggle the boolean auto_mode
or night_mode
?
switch:
- platform: template
switches:
template_service_dyson_set_auto_mode_1:
friendly_name: Bedroom Room Fan Auto Mode
value_template: "{{ is_state_attr('fan.living_room', 'auto_mode', true) }}"
turn_on:
service: dyson.set_auto_mode
data:
entity_id: fan.bedroom
auto_mode: true
turn_off:
service: dyson.set_auto_mode
data:
entity_id: fan.bedroom
auto_mode: false
and created a lovelace card with
- entity: fan.bedroom
hold_action:
action: more-info
icon_height: 50px
show_icon: true
show_name: true
show_state: true
tap_action:
action: call-service
service: fan.set_auto_mode
service_data:
entity_id: fan.dyson_fan
auto_mode: true
type: button
When I toggle the button I get the error
Failed to call service/fan_set_auto_mode. Service not found
giangi007
(gianluca)
November 21, 2020, 6:06pm
31
Hello DrSpaldo, could you show your code?
Thanks
DrSpaldo
(Doctor Spalding)
November 29, 2020, 5:53am
32
@giangi007
Sorry for the delay, I am not getting post notifications. Which part were you after?
giangi007
(gianluca)
November 30, 2020, 6:57am
33
Ho DrSpaldo Iām interesting for lovelace card part. Thanks
DrSpaldo
(Doctor Spalding)
November 30, 2020, 11:43am
34
- type: custom:vertical-stack-in-card
cards:
- type: conditional
conditions:
- entity: fan.master_bedroom
state: 'on'
card:
entities:
- entity: input_number.dyson_fan_speed
name: Dyson Fan Speed
type: entities
- type: glance
entities:
- entity: switch.fanpower
tap_action:
action: toggle
- entity: switch.fan_auto
tap_action:
action: toggle
- entity: switch.fan_night
icon: mdi:weather-night
tap_action:
action: toggle
- entity: switch.oscillation
tap_action:
action: toggle
Hello,
I cannot make the Fan Speed Controller (slider) to change the actual speed on the fan.
It only shows the current fan speed, which is nice but not enough for me
I have set everything else up and that works like a charm.
Iāve tried this but that has no effect.
alias: DYSON - Fan speed controller
description: ''
trigger:
- entity_id: input_number.dyson_fan_speed
platform: state
condition: []
action:
- data_template:
speed: '{{states(''input_number.dyson_fan_speed'')|int}}'
entity_id: fan.kokken
service: fan.set_speed
mode: single
Iāve also tried this, as it seems like the Dyson.set_speed required the dyson_speed attribute. But still no luck.
action:
- service: dyson.set_speed
data:
dyson_speed: '{{states(''input_number.dyson_fan_speed'')|int}}'
entity_id: fan.kokken
Performing a call-service from developer tools with dyson.set_speed and dyson_speed: 5 DOES workā¦ Just canāt make it work in the automation. Any ideas?
DrSpaldo
(Doctor Spalding)
December 1, 2020, 10:07am
36
Do you have the input number set in your configuration.yaml?
input_number:
dyson_fan_speed:
name: Dyson fan speed
min: 1
max: 10
step: 1
icon: mdi:fan
You also need the automations that @mgim posted above.
Yes, Iāve done that. And it is able to show the current fan speed and updates if I change the speed in the Dyson Link app. So the input_number slider works.
The automation that should perform the action does not work for me:
From @mgim .
- id: '1581251639556'
alias: Dyson fan speed controller
description: ''
trigger:
- entity_id: input_number.dyson_fan_speed
platform: state
condition: []
action:
- data_template:
speed: '{{states(''input_number.dyson_fan_speed'')|int}}'
entity_id: fan.dyson
service: fan.set_speed
(Yes I have corrected the entity id to my own)
grace0728
(ChrisP)
January 25, 2021, 3:45am
40
Did you solve this problem?
Add two more space in front of āentity_id: fan.dyson
ā then this automation will work correctly.
I did manage to find a solution by using Node-RED but I wasnāt really satisfied with that. Havenāt really looked at it since but just tried to add a few more spacesā¦ Of course that worked
Thanks for helping me out Chris.
drguild
February 6, 2021, 9:33am
42
I am completly new to Home Assistant but I would love to use a dyson card as above.
I know about the edit ui button and the cards list and entities being the valies thats about it.
So I would need to llearn how to do something like @DrSpaldo and @mgim
But no idea what I am meant to be doing with any configs apart from the dashboard editor.