Dyson Big+Quiet BP04

Hi,

Very new to homeassistant, a complete noob. I installed the dyson HACS plugin and was able to connect to the Dyson Big + Quiet BP04. I wanted to create something like @fahr created with AQI and all.

The entities it detected automatically are

Dyson Purifier Big+Quiet
fan.dyson_purifier_big_quiet

Dyson Purifier Big+Quiet Carbon Dioxide
sensor.dyson_purifier_big_quiet_carbon_dioxide

Dyson Purifier Big+Quiet Carbon Filter Life
sensor.dyson_purifier_big_quiet_carbon_filter_life

Dyson Purifier Big+Quiet Continuous Monitoring
switch.dyson_purifier_big_quiet_continuous_monitoring

Dyson Purifier Big+Quiet HCHO
sensor.dyson_purifier_big_quiet_hcho

Dyson Purifier Big+Quiet HEPA Filter Life
sensor.dyson_purifier_big_quiet_hepa_filter_life

Dyson Purifier Big+Quiet Humidity
sensor.dyson_purifier_big_quiet_humidity

Dyson Purifier Big+Quiet Night Mode
switch.dyson_purifier_big_quiet_night_mode

Dyson Purifier Big+Quiet Nitrogen Dioxide Index
sensor.dyson_purifier_big_quiet_nitrogen_dioxide_index

Dyson Purifier Big+Quiet PM 10
sensor.dyson_purifier_big_quiet_pm_10

Dyson Purifier Big+Quiet PM 2.5
sensor.dyson_purifier_big_quiet_pm_2_5

Dyson Purifier Big+Quiet Temperature
sensor.dyson_purifier_big_quiet_temperature

Dyson Purifier Big+Quiet Volatile Organic Compounds Index
sensor.dyson_purifier_big_quiet_volatile_organic_compounds_index

It says on Aaron’s blog (Integrating the Dyson TP04 Air Purifier in Home Assistant - Automate The Things) to add this to configuration.yaml. How do I go about doing that? What variables in this would I need to change? Also need help with the custom card on the blog site.

Apologies if it’s too much hassle.

- platform: template
  sensors:
    dyson_calc_aqi:
      friendly_name: "Dyson Calculated PM2.5 AQI"
      unit_of_measurement: AQI
      unique_id: dypson_tp_04_calc_aqi
      # https://community.home-assistant.io/t/purpleair-air-quality-sensor/146588
      value_template: >
        {% macro calcAQI(Cp, Ih, Il, BPh, BPl) -%}
          {{ (((Ih - Il)/(BPh - BPl)) * (Cp - BPl) + Il)|round }}
        {%- endmacro %}
        {% if (state_attr("air_quality.master_bedroom", "particulate_matter_2_5")|float) > 1000 %}
          invalid
        {% elif (state_attr("air_quality.master_bedroom", "particulate_matter_2_5")|float) > 350.5 %}
        {{ calcAQI((state_attr("air_quality.master_bedroom", "particulate_matter_2_5")|float), 500.0, 401.0, 500.0, 350.5) }}
        {% elif (state_attr("air_quality.master_bedroom", "particulate_matter_2_5")|float) > 250.5 %}
         {% elif (state_attr("air_quality.master_bedroom", "particulate_matter_2_5")|float) > 250.5 %}
        {{ calcAQI((state_attr("air_quality.master_bedroom", "particulate_matter_2_5")|float), 400.0, 301.0, 350.4, 250.5) }}
        {% elif (state_attr("air_quality.master_bedroom", "particulate_matter_2_5")|float) > 150.5 %}
          {{ calcAQI((state_attr("air_quality.master_bedroom", "particulate_matter_2_5")|float), 300.0, 201.0, 250.4, 150.5) }}
        {% elif (state_attr("air_quality.master_bedroom", "particulate_matter_2_5")|float) > 55.5 %}
          {{ calcAQI((state_attr("air_quality.master_bedroom", "particulate_matter_2_5")|float), 200.0, 151.0, 150.4, 55.5) }}
        {% elif (state_attr("air_quality.master_bedroom", "particulate_matter_2_5")|float) > 35.5 %}
          {{ calcAQI((state_attr("air_quality.master_bedroom", "particulate_matter_2_5")|float), 150.0, 101.0, 55.4, 35.5) }}
        {% elif (state_attr("air_quality.master_bedroom", "particulate_matter_2_5")|float) > 12.1 %}
          {{ calcAQI((state_attr("air_quality.master_bedroom", "particulate_matter_2_5")|float), 100.0, 51.0, 35.4, 12.1) }}
        {% elif (state_attr("air_quality.master_bedroom", "particulate_matter_2_5")|float) >= 0.0 %}
          {{ calcAQI((state_attr("air_quality.master_bedroom", "particulate_matter_2_5")|float), 50.0, 0.0, 12.0, 0.0) }}
        {% else %}
          invalid
        {% endif %}

Fortunately it’s a little bit easier now that you can create template sensors via the UI. Go to the Helpers section of the configuration and click on the Create Helper button.

From there choose Template then Template a sensor. Enter anything you want for the name, for example Dyson Calculated PM2.5 AQI.

Paste the following for the State template, but change sensor.dyson_purifier_big_quiet_formaldehyde_pm_2_5 to match the name of your pm 2.5 sensor associated with your Bit and Quiet if it’s different. (taking a look at your post, your sensor is named sensor.dyson_purifier_big_quiet_pm_2_5)

{% macro calcAQI(Cp, Ih, Il, BPh, BPl) -%}
          {{ (((Ih - Il)/(BPh - BPl)) * (Cp - BPl) + Il)|round }}
{%- endmacro %}
{% if (states("sensor.dyson_purifier_big_quiet_formaldehyde_pm_2_5")|float) > 1000 %}
  invalid
{% elif (states("sensor.dyson_purifier_big_quiet_formaldehyde_pm_2_5")|float) > 350.5 %}
{{ calcAQI((states("sensor.dyson_purifier_big_quiet_formaldehyde_pm_2_5")|float), 500.0, 401.0, 500.0, 350.5) }}
{% elif (states("sensor.dyson_purifier_big_quiet_formaldehyde_pm_2_5")|float) > 250.5 %}
 {% elif (states("sensor.dyson_purifier_big_quiet_formaldehyde_pm_2_5")|float) > 250.5 %}
{{ calcAQI((states("sensor.dyson_purifier_big_quiet_formaldehyde_pm_2_5")|float), 400.0, 301.0, 350.4, 250.5) }}
{% elif (states("sensor.dyson_purifier_big_quiet_formaldehyde_pm_2_5")|float) > 150.5 %}
  {{ calcAQI((states("sensor.dyson_purifier_big_quiet_formaldehyde_pm_2_5")|float), 300.0, 201.0, 250.4, 150.5) }}
{% elif (states("sensor.dyson_purifier_big_quiet_formaldehyde_pm_2_5")|float) > 55.5 %}
  {{ calcAQI((states("sensor.dyson_purifier_big_quiet_formaldehyde_pm_2_5")|float), 200.0, 151.0, 150.4, 55.5) }}
{% elif (states("sensor.dyson_purifier_big_quiet_formaldehyde_pm_2_5")|float) > 35.5 %}
  {{ calcAQI((states("sensor.dyson_purifier_big_quiet_formaldehyde_pm_2_5")|float), 150.0, 101.0, 55.4, 35.5) }}
{% elif (states("sensor.dyson_purifier_big_quiet_formaldehyde_pm_2_5")|float) > 12.1 %}
  {{ calcAQI((states("sensor.dyson_purifier_big_quiet_formaldehyde_pm_2_5")|float), 100.0, 51.0, 35.4, 12.1) }}
{% elif (states("sensor.dyson_purifier_big_quiet_formaldehyde_pm_2_5")|float) >= 0.0 %}
  {{ calcAQI((states("sensor.dyson_purifier_big_quiet_formaldehyde_pm_2_5")|float), 50.0, 0.0, 12.0, 0.0) }}
{% else %}
  invalid
{% endif %}

Leave Unit of measurement empty. For the Device class choose Air Quality index. For State class choose Measurement.

Now you will have an entity id you can plug into your card. If you used the same name I did, it will be sensor.dyson_calculated_pm2_5_aqi.

1 Like

Thank you @fahr …This worked like a charm.

Sorry if I can bother you one more time. Cannot figure out what I am doing wrong.

I created the card like in your blog and edited the variables and entity-ids where necessary and I ended up with this:

type: custom:card-templater
entities:
  - fan.dyson_purifier_big_quiet
  - sensor.dyson_purifier_big_quiet_carbon_dioxide
  - sensor.dyson_purifier_big_quiet_carbon_filter_life
  - switch.dyson_purifier_big_quiet_continuous_monitoring
  - sensor.dyson_purifier_big_quiet_hcho
  - sensor.dyson_purifier_big_quiet_hepa_filter_life
  - sensor.dyson_purifier_big_quiet_humidity
  - switch.dyson_purifier_big_quiet_night_mode
  - sensor.dyson_purifier_big_quiet_nitrogen_dioxide_index
  - sensor.dyson_purifier_big_quiet_pm_10
  - sensor.dyson_purifier_big_quiet_pm_2_5
  - sensor.dyson_purifier_big_quiet_temperature
  - sensor.dyson_purifier_big_quiet_volatile_organic_compounds_index
  - sensor.dyson_calculated_pm2_5_aqi
card:
  type: picture-elements
  image: /local/tp-04.png
  elements:
    - type: state-icon
      icon: mdi:power
      entity: fan.dyson_purifier_big_quiet
      tap_action:
        action: call-service
        service: fan.toggle
        service_data:
          entity_id: fan.dyson_purifier_big_quiet
      style:
        left: 0
        right: 0
        bottom: 0
        border: 1px solid rgba(0, 0, 0, 0.4)
        background-color: rgba(0, 0, 0, 0.8)
        padding: 10px
        font-size: 16px
        line-height: 16px
        transform: translate(0%,0%)
        '--paper-item-icon-active-color': green
    - type: state-icon
      state_color: false
      icon: mdi:sleep
      title_template: >-
        Night mode {% if states("switch.dyson_purifier_big_quiet_night_mode") ==
        "on" %}(click to disable){% else %}(click to enable){% endif %}
      entity: switch.dyson_purifier_big_quiet_night_mode
      tap_action:
        action: call-service
        service: switch.toggle
        service_data:
          entity_id: switch.dyson_purifier_big_quiet_night_mode
      style:
        right: 0
        bottom: 0
        padding: 10px
        transform: translate(0%,0%)
        font-size: 16px
        line-height: 16px
        '--paper-item-icon-color_template': >-
          {% if states("switch.dyson_purifier_big_quiet_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 states("fan.dyson_purifier_big_quiet_auto_mode") == "on"
        %}(click to disable){% else %}(click to enable){% endif %}
      entity: fan.dyson_purifier_big_quiet_auto_mode
      tap_action:
        action: call-service
        service: switch.toggle
        service_data:
          entity_id: fan.dyson_purifier_big_quiet_auto_mode
      style:
        right: 61px
        bottom: 0
        padding: 10px
        transform: translate(0%,0%)
        font-size: 16px
        line-height: 16px
        '--paper-item-icon-color_template': >-
          {% if states("fan.dyson_purifier_big_quiet_auto_mode") == "on"
          %}green{% else %}rgb(68, 115, 158){% endif %}
    - type: state-label
      entity: sensor.dyson_calculated_pm2_5_aqi
      suffix: ' (PM2.5)'
      style:
        background-color_template: >-
          {% if states("sensor.dyson_calculated_pm2_5_aqi")|float > 300 %}
          #B71C1C {% elif states("sensor.dyson_calculated_pm2_5_aqi")|float >
          200 %} #9C27B0 {% elif
          states("sensor.dyson_calculated_pm2_5_aqi")|float > 150 %} #E53935 {%
          elif states("sensor.dyson_calculated_pm2_5_aqi")|float > 100 %}
          #FB8C00 {% elif states("sensor.dyson_calculated_pm2_5_aqi")|float > 50
          %} #FFC107 {% else %} #4CAF50 {% endif %}
        width: 25%
        top: 3%
        left: 0%
        border-top-right-radius: 7px
        border-bottom-right-radius: 7px
        border: 2px solid rgba(0, 0, 0, 0.2)
        padding: 5px
        font-size: 16px
        line-height: 16px
        color: white
        transform: translate(0%,0%)
    - type: state-label
      entity: sensor.dyson_purifier_big_quiet_pm_2_5
      suffix: ' PM2.5'
      style:
        background-color_template: >-
          {% if state_attr("sensor.dyson_purifier_big_quiet_pm_2_5")|float > 250
          %} #B71C1C {% elif
          state_attr("sensor.dyson_purifier_big_quiet_pm_2_5")|float > 150 %}
          #9C27B0 {% elif
          state_attr("sensor.dyson_purifier_big_quiet_pm_2_5")|float > 70 %}
          #E53935 {% elif
          state_attr("sensor.dyson_purifier_big_quiet_pm_2_5")|float > 53 %}
          #FB8C00 {% elif
          state_attr("sensor.dyson_purifier_big_quiet_pm_2_5")|float > 35 %}
          #FFC107 {% else %} #4CAF50 {% endif %}
        width: 25%
        top: 17%
        left: 0%
        border-top-right-radius: 7px
        border-bottom-right-radius: 7px
        border: 2px solid rgba(0, 0, 0, 0.2)
        padding: 5px
        font-size: 16px
        line-height: 16px
        color: white
        transform: translate(0%,0%)
    - type: state-label
      entity: sensor.dyson_purifier_big_quiet_pm_10
      suffix: ' PM10'
      style:
        background-color_template: >-
          {% if state_attr("sensor.dyson_purifier_big_quiet_pm_10")|float > 420
          %} #B71C1C {% elif
          state_attr("sensor.dyson_purifier_big_quiet_pm_10")|float > 350 %}
          #9C27B0 {% elif
          state_attr("sensor.dyson_purifier_big_quiet_pm_10")|float > 100 %}
          #E53935 {% elif
          state_attr("sensor.dyson_purifier_big_quiet_pm_10")|float > 75 %}
          #FB8C00 {% elif
          state_attr("sensor.dyson_purifier_big_quiet_pm_10")|float > 50 %}
          #FFC107 {% else %} #4CAF50 {% endif %}
        width: 25%
        top: 31%
        left: 0%
        border-top-right-radius: 7px
        border-bottom-right-radius: 7px
        border: 2px solid rgba(0, 0, 0, 0.2)
        padding: 5px
        font-size: 16px
        line-height: 16px
        color: white
        transform: translate(0%,0%)
    - type: state-label
      entity: sensor.dyson_purifier_big_quiet_nitrogen_dioxide_index
      suffix: ' NO2'
      style:
        background-color_template: >-
          {% if
          state_attr(sensor.dyson_purifier_big_quiet_nitrogen_dioxide_index)|float
          > 8 %} #E53935 {% elif
          state_attr(sensor.dyson_purifier_big_quiet_nitrogen_dioxide_index)|float
          > 6 %} #FB8C00 {% elif
          state_attr(sensor.dyson_purifier_big_quiet_nitrogen_dioxide_index)|float
          > 3 %} #FFC107 {% else %} #4CAF50 {% endif %}
        width: 25%
        top: 45%
        left: 0%
        border-top-right-radius: 7px
        border-bottom-right-radius: 7px
        border: 2px solid rgba(0, 0, 0, 0.2)
        padding: 5px
        font-size: 16px
        line-height: 16px
        color: white
        transform: translate(0%,0%)
    - type: state-label
      entity: sensor.dyson_purifier_big_quiet_volatile_organic_compounds_index
      suffix: ' VOC'
      style:
        background-color_template: >-
          {% if
          state_attr("sensor.dyson_purifier_big_quiet_volatile_organic_compounds_index")|float
          > 8 %} #E53935 {% elif
          state_attr("sensor.dyson_purifier_big_quiet_volatile_organic_compounds_index")|float
          > 6 %} #FB8C00 {% elif
          state_attr("sensor.dyson_purifier_big_quiet_volatile_organic_compounds_index")|float
          > 3 %} #FFC107 {% else %} #4CAF50 {% endif %}
        width: 25%
        border: 2px solid rgba(0, 0, 0, 0.2)
        top: 59%
        left: 0%
        border-top-right-radius: 7px
        border-bottom-right-radius: 7px
        padding: 5px
        font-size: 16px
        line-height: 16px
        color: white
        transform: translate(0%,0%)
    - type: state-icon
      entity: sensor.dyson_purifier_big_quiet_humidity
      style:
        top: 2%
        right: 0px
        background-color: rgba(0, 0, 0, 0.5)
        border: 2px solid rgba(0, 0, 0, 0.2)
        transform: translate(0%,0%)
        width: 20%
        border-top-left-radius: 7px
        border-bottom-left-radius: 7px
    - type: state-label
      entity: sensor.dyson_purifier_big_quiet_humidity
      style:
        top: 2%
        right: 5%
        transform: translate(0%,0%)
        line-height: 25px
    - type: state-icon
      entity: sensor.dyson_purifier_big_quiet_temperature
      style:
        top: 16%
        right: 0px
        background-color: rgba(0, 0, 0, 0.5)
        border: 2px solid rgba(0, 0, 0, 0.2)
        transform: translate(0%,0%)
        width: 20%
        border-top-left-radius: 7px
        border-bottom-left-radius: 7px
    - type: state-label
      entity: sensor.dyson_purifier_big_quiet_temperature
      style:
        top: 16%
        right: 3%
        transform: translate(0%,0%)
        line-height: 25px
    - type: custom:circle-sensor-card
      entity: sensor.dyson_purifier_big_quiet_carbon_filter_life
      name: Carbon Filter
      fill: rgba(0, 0, 0, 0.7)
      style:
        top: 25%
        left: 50%
        width: 20%
    - type: custom:circle-sensor-card
      entity: sensor.dyson_purifier_big_quiet_hepa_filter_life
      name: HEPA Filter
      fill: rgba(0, 0, 0, 0.7)
      style:
        top: 60%
        left: 50%
        width: 20%

However, with this code this is what I end up with:

Image2

Would you be so kind to let me know where I have gone wrong?

P.S: Oscillation & Flow direction was removed as Big + Quiet doesn’t have that.

Without the white background

Image

P.S: I will replace the picture with BP04 once I get all of this sorted :slight_smile:

I think you’ll have to update a lot of the templates. This yaml is for when the values were stored as attributes of the state of the dyson sensor. With the ha-dyson integration all of these are actual sensors. So for example this block of yaml should be updated from:

    - type: state-label
      entity: sensor.dyson_purifier_big_quiet_pm_2_5
      suffix: ' PM2.5'
      style:
        background-color_template: >-
          {% if state_attr("sensor.dyson_purifier_big_quiet_pm_2_5")|float > 250
          %} #B71C1C {% elif
          state_attr("sensor.dyson_purifier_big_quiet_pm_2_5")|float > 150 %}
          #9C27B0 {% elif
          state_attr("sensor.dyson_purifier_big_quiet_pm_2_5")|float > 70 %}
          #E53935 {% elif
          state_attr("sensor.dyson_purifier_big_quiet_pm_2_5")|float > 53 %}
          #FB8C00 {% elif
          state_attr("sensor.dyson_purifier_big_quiet_pm_2_5")|float > 35 %}
          #FFC107 {% else %} #4CAF50 {% endif %}
    - type: state-label
      entity: sensor.dyson_purifier_big_quiet_pm_2_5
      suffix: ' PM2.5'
      style:
        background-color_template: >-
          {% if states("sensor.dyson_purifier_big_quiet_pm_2_5")|float > 250
          %} #B71C1C {% elif
          states("sensor.dyson_purifier_big_quiet_pm_2_5")|float > 150 %}
          #9C27B0 {% elif
          states("sensor.dyson_purifier_big_quiet_pm_2_5")|float > 70 %}
          #E53935 {% elif
          states("sensor.dyson_purifier_big_quiet_pm_2_5")|float > 53 %}
          #FB8C00 {% elif
          states("sensor.dyson_purifier_big_quiet_pm_2_5")|float > 35 %}
          #FFC107 {% else %} #4CAF50 {% endif %}

That is replacing state_attr("sensor.dyson_purifier_big_quiet_pm_2_5") with states("sensor.dyson_purifier_big_quiet_pm_2_5"). Since this is a state value and not an attribute on the state.

Hey @fahr Thank you for responding. Sorry I wasn’t clear in my issue. I have already changed all of the variables (plus removed attributes ) and they are showing as correct values. My live values below

Image

The issue is coming with the color coding — it doesn’t color code any of the values like in your picture and the circle-sensors too small.

Resolved all of the issues. thanks @fahr !!!

new

Will optimize some of the values and background colors as per BP04

The only thing I haven’t been able to figure out is out to set toggle button in the fan entity between auto & normal mode.

Glad to hear! Could you post the yaml so future users who stumble on this thread will have the answer? I’m also curious what you had to change to get the colors to work and increase the size of the circle sensors.

Hey

Sorry for the late reply. Was travelling. So it was me not being diligent enough and made 2 mistakes:

Mistake 1: I found out this the hardway. So if there is anything wrong anywhere on the whole code, it does not execute code. 100 lines down there was this entry

state(sensor.dyson_purifier_big_quiet_nitrogen_dioxide_index) 

without the quotes for the items in the bracket. It should look like this:

state("sensor.dyson_purifier_big_quiet_nitrogen_dioxide_index") 

so if there is a mistake anywhere on the whole code within the custom background it will not do any of them. Surprisingly it doesnt give any error as well.

Mistake 2: I used notepad++ to replace the states_attr but I didn’t double check. not all of them were replaced.

For the circle I had to change the code and add one additional line

    - type: custom:circle-sensor-card
      entity: sensor.dyson_purifier_big_quiet_hepa_filter_life
      name: HEPA Filter
      fill: rgba(200, 200, 200, 0.5)
      stroke_width: 10
      style:
        top: 60%
        left: 34%
        width: 20%

The width was the one that fixed the circle size.

This was the final code - Thanks @fahr

type: custom:card-templater
entities:
  - fan.dyson_purifier_big_quiet
  - sensor.dyson_purifier_big_quiet_carbon_dioxide
  - sensor.dyson_purifier_big_quiet_carbon_filter_life
  - switch.dyson_purifier_big_quiet_continuous_monitoring
  - sensor.dyson_purifier_big_quiet_hcho
  - sensor.dyson_purifier_big_quiet_hepa_filter_life
  - sensor.dyson_purifier_big_quiet_humidity
  - switch.dyson_purifier_big_quiet_night_mode
  - sensor.dyson_purifier_big_quiet_nitrogen_dioxide_index
  - sensor.dyson_purifier_big_quiet_pm_10
  - sensor.dyson_purifier_big_quiet_pm_2_5
  - sensor.dyson_purifier_big_quiet_temperature
  - sensor.dyson_purifier_big_quiet_volatile_organic_compounds_index
  - sensor.dyson_calculated_pm2_5_aqi
card:
  type: picture-elements
  image: /local/bp-04.png
  elements:
    - type: state-icon
      icon: mdi:power
      entity: fan.dyson_purifier_big_quiet
      tap_action:
        action: call-service
        service: fan.toggle
        service_data:
          entity_id: fan.dyson_purifier_big_quiet
      style:
        left: 0
        right: 0
        bottom: 0
        border: 1px solid rgba(0, 0, 0, 0.4)
        background-color: rgba(0, 0, 0, 0.8)
        padding: 10px
        font-size: 16px
        line-height: 16px
        transform: translate(0%,0%)
        '--paper-item-icon-active-color': green
    - type: state-icon
      state_color: false
      icon: mdi:sleep
      title_template: >-
        Night mode {% if states("switch.dyson_purifier_big_quiet_night_mode") ==
        "on" %}(click to disable){% else %}(click to enable){% endif %}
      entity: switch.dyson_purifier_big_quiet_night_mode
      tap_action:
        action: call-service
        service: switch.toggle
        service_data:
          entity_id: switch.dyson_purifier_big_quiet_night_mode
      style:
        right: 0
        bottom: 0
        padding: 10px
        transform: translate(0%,0%)
        font-size: 16px
        line-height: 16px
        '--paper-item-icon-color_template': >-
          {% if states("switch.dyson_purifier_big_quiet_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 states("fan.dyson_purifier_big_quiet",
        "set_preset_mode") == "auto" %}(click to disable){% else %}(click to
        enable){% endif %}
      entity: fan.dyson_purifier_big_quiet
      attribute: set_preset_mode
      tap_action:
        action: call-service
        service: switch.toggle
        service_data:
          entity_id: fan.set_preset_mode = 'normal'
      style:
        right: 61px
        bottom: 0
        padding: 10px
        transform: translate(0%,0%)
        font-size: 16px
        line-height: 16px
        '--paper-item-icon-color_template': >-
          {% if states("fan.dyson_purifier_big_quiet", "set_preset_mode") ==
          "auto" %}green{% else %}rgb(68, 115, 158){% endif %}
    - type: state-label
      entity: sensor.dyson_calculated_pm2_5_aqi
      suffix: ' (PM2.5)'
      style:
        background-color_template: >-
          {% if states("sensor.dyson_calculated_pm2_5_aqi")|float > 300 %}
          #B71C1C  {% elif states("sensor.dyson_calculated_pm2_5_aqi")|float >
          200 %}  #9C27B0  {% elif
          states("sensor.dyson_calculated_pm2_5_aqi")|float > 150 %}  #E53935 
          {% elif states("sensor.dyson_calculated_pm2_5_aqi")|float > 100 %}
          #FB8C00   {% elif states("sensor.dyson_calculated_pm2_5_aqi")|float >
          50 %}  #FFC107  {% else %}  #4CAF50  {% endif %}
        width: 25%
        top: 3%
        left: 0%
        border-top-right-radius: 7px
        border-bottom-right-radius: 7px
        border: 2px solid rgba(0, 0, 0, 0.2)
        padding: 5px
        font-size: 16px
        line-height: 16px
        color: white
        transform: translate(0%,0%)
    - type: state-label
      entity: sensor.dyson_purifier_big_quiet_pm_2_5
      suffix: ' PM2.5'
      style:
        background-color_template: >-
          {% if states("sensor.dyson_purifier_big_quiet_pm_2_5")|float > 250 %}
          #B71C1C {% elif states("sensor.dyson_purifier_big_quiet_pm_2_5")|float
          > 150 %} #9C27B0 {% elif
          states("sensor.dyson_purifier_big_quiet_pm_2_5")|float > 70 %} #E53935
          {% elif states("sensor.dyson_purifier_big_quiet_pm_2_5")|float > 53 %}
          #FB8C00 {% elif states("sensor.dyson_purifier_big_quiet_pm_2_5")|float
          > 35 %} #FFC107 {% else %} #4CAF50 {% endif %}
        width: 25%
        top: 17%
        left: 0%
        border-top-right-radius: 7px
        border-bottom-right-radius: 7px
        border: 2px solid rgba(0, 0, 0, 0.2)
        padding: 5px
        font-size: 16px
        line-height: 16px
        color: white
        transform: translate(0%,0%)
    - type: state-label
      entity: sensor.dyson_purifier_big_quiet_pm_10
      suffix: ' PM10'
      style:
        background-color_template: >-
          {% if states("sensor.dyson_purifier_big_quiet_pm_10")|float > 420 %}
          #B71C1C {% elif states("sensor.dyson_purifier_big_quiet_pm_10")|float
          > 350 %} #9C27B0 {% elif
          states("sensor.dyson_purifier_big_quiet_pm_10")|float > 100 %} #E53935
          {% elif states("sensor.dyson_purifier_big_quiet_pm_10")|float > 75 %}
          #FB8C00 {% elif states("sensor.dyson_purifier_big_quiet_pm_10")|float
          > 50 %} #FFC107 {% else %} #4CAF50 {% endif %}
        width: 25%
        top: 31%
        left: 0%
        border-top-right-radius: 7px
        border-bottom-right-radius: 7px
        border: 2px solid rgba(0, 0, 0, 0.2)
        padding: 5px
        font-size: 16px
        line-height: 16px
        color: white
        transform: translate(0%,0%)
    - type: state-label
      entity: sensor.dyson_purifier_big_quiet_nitrogen_dioxide_index
      suffix: ' NO2'
      style:
        background-color_template: >-
          {% if
          states("sensor.dyson_purifier_big_quiet_nitrogen_dioxide_index")|float
          > 8 %}  #E53935  {% elif
          states("sensor.dyson_purifier_big_quiet_nitrogen_dioxide_index")|float
          > 6 %}  #FB8C00  {% elif
          states("sensor.dyson_purifier_big_quiet_nitrogen_dioxide_index")|float
          > 3 %}  #FFC107  {% else %}  #4CAF50  {% endif %}
        width: 25%
        top: 45%
        left: 0%
        border-top-right-radius: 7px
        border-bottom-right-radius: 7px
        border: 2px solid rgba(0, 0, 0, 0.2)
        padding: 5px
        font-size: 16px
        line-height: 16px
        color: white
        transform: translate(0%,0%)
    - type: state-label
      entity: sensor.dyson_purifier_big_quiet_volatile_organic_compounds_index
      suffix: ' VOC'
      style:
        background-color_template: >-
          {% if
          states("sensor.dyson_purifier_big_quiet_volatile_organic_compounds_index")|float
          > 8 %} #E53935 {% elif
          states("sensor.dyson_purifier_big_quiet_volatile_organic_compounds_index")|float
          > 6 %} #FB8C00 {% elif
          states("sensor.dyson_purifier_big_quiet_volatile_organic_compounds_index")|float
          > 3 %} #FFC107 {% else %} #4CAF50 {% endif %}
        width: 25%
        border: 2px solid rgba(0, 0, 0, 0.2)
        top: 59%
        left: 0%
        border-top-right-radius: 7px
        border-bottom-right-radius: 7px
        padding: 5px
        font-size: 16px
        line-height: 16px
        color: white
        transform: translate(0%,0%)
    - type: state-label
      entity: sensor.dyson_purifier_big_quiet_hcho
      suffix: ' HCHO'
      style:
        background-color_template: >-
          {% if states("sensor.dyson_purifier_big_quiet_hcho")|float > 0.499 %}
          #E53935 {% elif states("sensor.dyson_purifier_big_quiet_hcho")|float >
          0.299 %} #FB8C00 {% elif
          states("sensor.dyson_purifier_big_quiet_hcho")|float > 0.099 %}
          #FFC107 {% else %} #4CAF50 {% endif %}
        width: 25%
        border: 2px solid rgba(0, 0, 0, 0.2)
        top: 73%
        left: 0%
        border-top-right-radius: 7px
        border-bottom-right-radius: 7px
        padding: 5px
        font-size: 13px
        line-height: 16px
        color: white
        transform: translate(0%,0%)
    - type: state-icon
      entity: sensor.dyson_purifier_big_quiet_humidity
      style:
        top: 50%
        right: 0px
        background-color: rgba(0, 0, 0, 0.1)
        border: 2px solid rgba(0, 0, 0, 0.2)
        transform: translate(0%,0%)
        width: 18%
        border-top-left-radius: 7px
        border-bottom-left-radius: 7px
    - type: state-label
      entity: sensor.dyson_purifier_big_quiet_humidity
      style:
        top: 51%
        right: 2%
        transform: translate(0%,0%)
        line-height: 25px
    - type: state-icon
      entity: sensor.dyson_purifier_big_quiet_temperature
      style:
        top: 65%
        right: 0px
        background-color: rgba(0, 0, 0, 0.1)
        border: 2px solid rgba(0, 0, 0, 0.2)
        transform: translate(0%,0%)
        width: 18%
        border-top-left-radius: 7px
        border-bottom-left-radius: 7px
    - type: state-label
      entity: sensor.dyson_purifier_big_quiet_temperature
      style:
        top: 66%
        right: 0%
        transform: translate(0%,0%)
        line-height: 22px
    - type: custom:circle-sensor-card
      entity: sensor.dyson_purifier_big_quiet_carbon_filter_life
      name: Carbon Filter
      fill: rgba(200, 200, 200, 0.5)
      stroke_width: 10
      style:
        top: 25%
        left: 34%
        width: 20%
    - type: custom:circle-sensor-card
      entity: sensor.dyson_purifier_big_quiet_hepa_filter_life
      name: HEPA Filter
      fill: rgba(200, 200, 200, 0.5)
      stroke_width: 10
      style:
        top: 60%
        left: 34%
        width: 20%

to be inline with the Dyson Values---- Please note that I did not have to change anything for the conditions as they were already inline with Dyson Values. The only thing I added was the code for HCHO which wasn’t there in Fahr’s original code, as it was not a sensor available in TP04.

P.S: Please note that the auto sensor button doesn’t work. I have to learn and fix it. Once I do fix it, I will come back and update the code here.

1 Like