clear_grass-ha icon indicating copy to clipboard operation
clear_grass-ha copied to clipboard

co2 history

Open ruslanruslanruslan opened this issue 5 years ago • 4 comments

How to view history graph of every indicator? I see only AQI..

ruslanruslanruslan avatar Feb 11 '20 09:02 ruslanruslanruslan

You need to create templates for each sensor. I will share mine shortly if nobody answers before.

GreyEarl avatar Feb 11 '20 10:02 GreyEarl

@GreyEarl @Cheaterdev can someone help with creating graphs for every attribute like tVOC and CO2?

khmyznikov avatar Oct 10 '21 13:10 khmyznikov

@khmyznikov

  - platform: template
    sensors:
      home_co2:
        friendly_name: "CO2"
        value_template: "{{states.sensor.clear_grass.attributes.co2}}"       
        unit_of_measurement: ppm   
        icon_template: mdi:periodic-table-co2
      home_tvoc:
        friendly_name: "tVoc"
        value_template: "{{states.sensor.clear_grass.attributes.tvoc}}"       
        unit_of_measurement: ppb    
        icon_template: mdi:air-filter
      home_temperature:
        friendly_name: "Temperature"
        value_template: "{{states.sensor.clear_grass.attributes.temperature}}"     
        unit_of_measurement: '°C'
        icon_template: mdi:temperature-celsius
      home_humidity:
        friendly_name: "Humidity"
        value_template: "{{states.sensor.clear_grass.attributes.humidity}}"   
        unit_of_measurement: '%'
        icon_template: mdi:water-percent
      home_pm25:
        friendly_name: "PM 2.5"
        value_template: "{{states.sensor.clear_grass.state}}"   
        unit_of_measurement: 'mg'
        icon_template: mdi:weight-gram

Cheaterdev avatar Oct 10 '21 13:10 Cheaterdev

# Xiaomi Air Quality Monitor
sensor:
  - platform: clear_grass
    name: Xiaomi ClearGrass Air Detector
    host: 192.168.1.35 # replace ip
    token: 123456789 # replace token
  - platform: template
    sensors:
      home_co2:
        friendly_name: "CO2"
        value_template: "{{states.sensor.xiaomi_cleargrass_air_detector.attributes.co2}}"       
        unit_of_measurement: ppm   
        icon_template: mdi:periodic-table-co2
      home_tvoc:
        friendly_name: "tVoc"
        value_template: "{{states.sensor.xiaomi_cleargrass_air_detector.attributes.tvoc}}"       
        unit_of_measurement: ppb    
        icon_template: mdi:air-filter
      home_temperature:
        friendly_name: "Temperature"
        value_template: "{{states.sensor.xiaomi_cleargrass_air_detector.attributes.temperature}}"     
        unit_of_measurement: '°C'
        icon_template: mdi:temperature-celsius
      home_humidity:
        friendly_name: "Humidity"
        value_template: "{{states.sensor.xiaomi_cleargrass_air_detector.attributes.humidity}}"   
        unit_of_measurement: '%'
        icon_template: mdi:water-percent
      home_pm25:
        friendly_name: "PM 2.5"
        value_template: "{{states.sensor.xiaomi_cleargrass_air_detector.state}}"   
        unit_of_measurement: 'mg'
        icon_template: mdi:weight-gram

I have figured out, this is the correct one.

khmyznikov avatar Oct 10 '21 15:10 khmyznikov