Compare commits

...

2 Commits

Author SHA1 Message Date
4f0dc7082a Adjust README slightly 2025-07-06 13:37:36 -04:00
a03e12dfa7 Readd health scores 2025-06-29 13:04:46 -04:00
2 changed files with 65 additions and 12 deletions

View File

@ -27,14 +27,7 @@ To Use:
* Add/adopt the SuperSensor to HomeAssistant using the automatic name.
* Tune the SuperSensor values to your needs.
Note: Once programmed, the output LED will flash continuously until connected
to HomeAssistant, and a bit longer to establish if the wake word
functionality is enabled. This is by design, so you know if your sensors
are connected or not. If you do not want this, comment out the
`light.turn_on` block starting on line 38 of the ESPHome configuration
to disable this functionality.
For more details, please [see my first blog post on the SuperSensor project](https://www.boniface.me/the-supersensor/)
For more details, please [see my first blog post on the original SuperSensor project](https://www.boniface.me/the-supersensor/)
and [my update post on version 2.0](https://www.boniface.me/the-supersensor-2.0).
**NOTE: For those with v1.x hardware, see [the repository for that code instead](https://github.com/joshuaboniface/supersensor).**
@ -142,9 +135,8 @@ configurable. See [the documentation](https://esphome.io/components/sensor/ld241
### Enable Voice Support (switch)
If enabled (the default), the SuperSensor's voice functionality including
wake word will be started. Disabling this defeats most of the point of the
SuperSensor, but can be done if desired, for instance if you have multiple
SuperSensors in a single room and only want one to respond to voice commands.
wake word will be started, or it can be disabled to use the SuperSensor
purely as a presence/environmental sensor.
### Enable Presence LED (switch)

View File

@ -634,7 +634,6 @@ sensor:
humidity: sht45_humidity
id: sht45_absolute_humidity
# Dew Point
- platform: template
name: "SHT45 Dew Point"
icon: mdi:thermometer-water
@ -649,6 +648,40 @@ sensor:
return (b * alpha) / (a - alpha);
update_interval: 15s
- platform: template
name: "Room Health Score"
id: room_health_score
unit_of_measurement: "%"
accuracy_decimals: 0
icon: mdi:home-heart
lambda: |-
float voc_index = id(sgp41_voc_index).state;
float temp = id(sht45_temperature).state;
float humidity = id(sht45_humidity).state;
// VOC Score (0100)
float voc_score = 0;
if (voc_index <= 100) voc_score = 100;
else if (voc_index <= 200) voc_score = 80;
else if (voc_index <= 300) voc_score = 60;
else if (voc_index <= 400) voc_score = 40;
else if (voc_index <= 500) voc_score = 50;
else voc_score = 0;
// Temperature Score (0100)
float temp_score = 100.0 - abs(temp - 23.0) * 10.0;
if (temp_score < 0) temp_score = 0;
// Humidity Score (0100), ideal range 3555%
float humidity_score = 100.0 - abs(humidity - 50.0) * 3.0;
if (humidity_score < 0) humidity_score = 0;
// Weighted average
float overall_score = (voc_score * 0.5 + temp_score * 0.25 + humidity_score * 0.25);
return round(overall_score);
update_interval: 15s
- platform: tsl2591
address: 0x29
update_interval: 1s
@ -776,6 +809,34 @@ text_sensor:
mac_address:
name: "LD2410C MAC Address"
- platform: template
name: "Chemical Pollution"
id: sgp41_chemical_pollution
icon: mdi:molecule
lambda: |-
float voc_index = id(sgp41_voc_index).state;
if (voc_index < 1 || voc_index > 500) return {"Unknown"};
if (voc_index <= 100) return {"Excellent"};
else if (voc_index <= 200) return {"Good"};
else if (voc_index <= 300) return {"Moderate"};
else if (voc_index <= 400) return {"Unhealthy"};
else return {"Hazardous"};
update_interval: 15s
- platform: template
name: "Room Health"
id: room_health_text
icon: mdi:home-heart
lambda: |-
float score = id(room_health_score).state;
if (score < 0) return {"Unknown"};
else if (score >= 90.0) return {"Great"};
else if (score >= 80.0) return {"Good"};
else if (score >= 60.0) return {"Fair"};
else if (score >= 40.0) return {"Poor"};
else return {"Bad"};
update_interval: 15s
button:
- platform: ld2410
restart: