Hi, unfortunately I can’t find good documentation on how I can provide my CO2, humidity and TVOC sensors with the correct measurement, so to speak. So that in HA I not only see the numbers but also what kind of number it is.
Can someone please help me with this?
I’ve already done some testing with device class and state class, but I can’t get it done yet. Which in any case doesn’t work:
- sensor:
- name: "humidity"
state: '{{ states.sensor.air_sensors.attributes["humidity"] }}'
device_class: humidity
state_class: measurement
- name: "TVOC"
state: '{{ states.sensor.air_sensors.attributes["tvoc"] }}'
device_class: volatile_organic_compounds
state_class: measurement
- name: "CO2"
state: '{{ states.sensor.air_sensors.attributes["eco2"] }}'
device_class: carbon_dioxide
state_class: measurement