diff --git a/lovelace/danielle.yaml b/lovelace/dyson.yaml
index 751025f..68fb9d8 100644
--- a/lovelace/dyson.yaml
+++ b/lovelace/dyson.yaml
@@ -256,15 +256,13 @@ cards:
- type: state-icon
state_color: false
icon: mdi:sleep
- title_template: 'Night mode {% if state_attr("fan.master_bedroom", "night_mode") %}(click to disable){% else %}(click to enable){% endif %}'
+ title_template: 'Night mode {% if states("switch.master_bedroom_night_mode") == "on" %}(click to disable){% else %}(click to enable){% endif %}'
entity: fan.master_bedroom
tap_action:
action: call-service
- service: dyson.set_night_mode
+ service: switch.toggle
service_data:
- entity_id: fan.master_bedroom
- night_mode_template: >-
- {% if state_attr("fan.master_bedroom", "night_mode") %}false{% else %}true{% endif %}
+ entity_id: switch.master_bedroom_night_mode
style:
right: 0
bottom: 0
@@ -272,20 +270,18 @@ cards:
transform: translate(0%,0%)
font-size: 16px
line-height: 16px
- --paper-item-icon-color_template: '{% if state_attr("fan.master_bedroom", "night_mode") %}green{% else %}rgb(68, 115, 158){% endif %}'
+ --paper-item-icon-color_template: '{% if states("switch.master_bedroom_night_mode") == "on" %}green{% else %}rgb(68, 115, 158){% endif %}'
- type: state-icon
state_color: false
icon: mdi:alpha-a-circle
- title_template: 'Auto mode {% if state_attr("fan.master_bedroom", "auto_mode") %}(click to disable){% else %}(click to enable){% endif %}'
+ title_template: 'Auto mode {% if states("switch.master_bedroom_auto_mode") == "on" %}(click to disable){% else %}(click to enable){% endif %}'
entity: fan.master_bedroom
tap_action:
action: call-service
- service: dyson.set_auto_mode
+ service: switch.toggle
service_data:
- entity_id: fan.master_bedroom
- auto_mode_template: >-
- {% if state_attr("fan.master_bedroom", "auto_mode") %}false{% else %}true{% endif %}
+ entity_id: switch.master_bedroom_auto_mode
style:
right: 61px
bottom: 0
@@ -293,7 +289,7 @@ cards:
transform: translate(0%,0%)
font-size: 16px
line-height: 16px
- --paper-item-icon-color_template: '{% if state_attr("fan.master_bedroom", "auto_mode") %}green{% else %}rgb(68, 115, 158){% endif %}'
+ --paper-item-icon-color_template: '{% if states("switch.master_bedroom_auto_mode") == "on" %}green{% else %}rgb(68, 115, 158){% endif %}'
- type: state-icon
state_color: false
@@ -370,19 +366,20 @@ cards:
transform: translate(0%,0%)
- type: state-label
- entity: sensor.dyson_particulate_matter_2_5
+ entity: air_quality.master_bedroom
+ attribute: particulate_matter_2_5
suffix: ' PM2.5'
style:
background-color_template: >-
- {% if states("sensor.dyson_particulate_matter_2_5")|float > 250 %}
+ {% if state_attr("air_quality.master_bedroom", "particulate_matter_2_5")|float > 250 %}
#B71C1C
- {% elif states("sensor.dyson_particulate_matter_2_5")|float > 150 %}
+ {% elif state_attr("air_quality.master_bedroom", "particulate_matter_2_5")|float > 150 %}
#9C27B0
- {% elif states("sensor.dyson_particulate_matter_2_5")|float > 70 %}
+ {% elif state_attr("air_quality.master_bedroom", "particulate_matter_2_5")|float > 70 %}
#E53935
- {% elif states("sensor.dyson_particulate_matter_2_5")|float > 53 %}
+ {% elif state_attr("air_quality.master_bedroom", "particulate_matter_2_5")|float > 53 %}
#FB8C00
- {% elif states("sensor.dyson_particulate_matter_2_5")|float > 35 %}
+ {% elif state_attr("air_quality.master_bedroom", "particulate_matter_2_5")|float > 35 %}
#FFC107
{% else %}
#4CAF50
@@ -400,19 +397,20 @@ cards:
transform: translate(0%,0%)
- type: state-label
- entity: sensor.dyson_particulate_matter_10
+ entity: air_quality.master_bedroom
+ attribute: particulate_matter_10
suffix: ' PM10'
style:
background-color_template: >-
- {% if states("sensor.dyson_particulate_matter_10")|float > 420 %}
+ {% if state_attr("air_quality.master_bedroom", "particulate_matter_10")|float > 420 %}
#B71C1C
- {% elif states("sensor.dyson_particulate_matter_10")|float > 350 %}
+ {% elif state_attr("air_quality.master_bedroom", "particulate_matter_10")|float > 350 %}
#9C27B0
- {% elif states("sensor.dyson_particulate_matter_10")|float > 100 %}
+ {% elif state_attr("air_quality.master_bedroom", "particulate_matter_10")|float > 100 %}
#E53935
- {% elif states("sensor.dyson_particulate_matter_10")|float > 75 %}
+ {% elif state_attr("air_quality.master_bedroom", "particulate_matter_10")|float > 75 %}
#FB8C00
- {% elif states("sensor.dyson_particulate_matter_10")|float > 50 %}
+ {% elif state_attr("air_quality.master_bedroom", "particulate_matter_10")|float > 50 %}
#FFC107
{% else %}
#4CAF50
@@ -430,14 +428,16 @@ cards:
transform: translate(0%,0%)
- type: state-label
- entity: sensor.dyson_nitrogen_dioxide
+ entity: air_quality.master_bedroom
+ attribute: nitrogen_dioxide
+ suffix: ' NO2'
style:
background-color_template: >-
- {% if states("sensor.dyson_nitrogen_dioxide")|float > 8 %}
+ {% if state_attr("air_quality.master_bedroom", "nitrogen_dioxide")|float > 8 %}
#E53935
- {% elif states("sensor.dyson_nitrogen_dioxide")|float > 6 %}
+ {% elif state_attr("air_quality.master_bedroom", "nitrogen_dioxide")|float > 6 %}
#FB8C00
- {% elif states("sensor.dyson_nitrogen_dioxide")|float > 3 %}
+ {% elif state_attr("air_quality.master_bedroom", "nitrogen_dioxide")|float > 3 %}
#FFC107
{% else %}
#4CAF50
@@ -455,14 +455,16 @@ cards:
transform: translate(0%,0%)
- type: state-label
- entity: sensor.dyson_volatile_organic_compounds
+ entity: air_quality.master_bedroom
+ attribute: volatile_organic_compounds
+ suffix: ' VOC'
style:
background-color_template: >-
- {% if states("sensor.dyson_volatile_organic_compounds")|float > 8 %}
+ {% if state_attr("air_quality.master_bedroom", "volatile_organic_compounds")|float > 8 %}
#E53935
- {% elif states("sensor.dyson_volatile_organic_compounds")|float > 6 %}
+ {% elif state_attr("air_quality.master_bedroom", "volatile_organic_compounds")|float > 6 %}
#FB8C00
- {% elif states("sensor.dyson_volatile_organic_compounds")|float > 3 %}
+ {% elif state_attr("air_quality.master_bedroom", "volatile_organic_compounds")|float > 3 %}
#FFC107
{% else %}
#4CAF50
@@ -524,7 +526,7 @@ cards:
# Filters
- type: custom:circle-sensor-card
- entity: sensor.dyson_carbon_filter
+ entity: sensor.master_bedroom_carbon_filter_life
name: Carbon Filter
fill: rgba(0, 0, 0, 0.7)
style:
Working on updating the blog post, but in the interim this diff might make it easier for you to see what lines need to be updated.