Version 1.0.0
- Added Recommendation Field
to take advantage of the recommendation field create a new sensor that provide recommendations
you can check the full ESPHome code in the repository
Example code:
- platform: template
name: "Air Quality Recommendation"
lambda: |-
std::string action = "";
if (id(ens160_air_quality_index).has_state()) {
int aqi = (int) id(ens160_air_quality_index).state;
if (aqi >= 4) {
action += "Turn Air purifier ON. ";
}
}
if (id(ens160_voc).has_state() && id(ens160_voc).state > 350) {
action += "Ventilate room (high VOC). ";
}
if (id(ens160_eco2).has_state() && id(ens160_eco2).state > 900) {
action += "Open window (high CO₂). ";
}
if (id(air_pollutants).has_state() && id(air_pollutants).state > 12) {
action += "Limit activity (PM2.5). ";
}
if (id(temperature).has_state() && id(temperature).state > 25) {
action += "Cool room. ";
} else if (id(temperature).state < 18) {
action += "Heat room. ";
}
if (id(humidity).has_state() && id(humidity).state > 65) {
action += "Dehumidify. ";
} else if (id(humidity).state < 40) {
action += "Use humidifier. ";
}
return action.empty() ? "Air quality is OK." : action;
icon: "mdi:lightbulb-on-outline"
update_interval: 60s- Added Air quality rating next to Title
- Adjusting the card screen alignment and size