Guest User

Untitled

a guest
Aug 9th, 2023
5,382
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.83 KB | None | 0 0
  1.  
  2. i2c:
  3. - id: "bme680_1"
  4. sda: GPIO22
  5. scl: GPIO33
  6. scan: true
  7.  
  8. bme680_bsec:
  9. - id: bme680
  10. i2c_id: "bme680_1"
  11. address: 0x77
  12.  
  13. sensor:
  14. - platform: bme680_bsec
  15. bme680_bsec_id: bme680
  16. temperature:
  17. name: "BME680 Temperature"
  18. accuracy_decimals: 1
  19. id: temperature
  20. pressure:
  21. name: "BME680 Pressure"
  22. accuracy_decimals: 5
  23. id: pressure
  24. humidity:
  25. name: "BME680 Humidity"
  26. id: humidity
  27. accuracy_decimals: 1
  28. iaq:
  29. name: "BME680 IAQ"
  30. id: iaq
  31. co2_equivalent:
  32. name: "BME680 CO2 Equivalent"
  33. gas_resistance:
  34. name: "BME680 Gas Resistance"
  35. id: gas
  36. accuracy_decimals: 5
  37. breath_voc_equivalent:
  38. name: "BME680 Intake Breath VOC Equivalent"
  39.  
  40. text_sensor:
  41. - platform: bme680_bsec
  42. bme680_bsec_id: bme680
  43. iaq_accuracy:
  44. name: "BME680 IAQ Accuracy"
  45.  
  46. - platform: template
  47. name: "BME680 IAQ Classification"
  48. icon: "mdi:checkbox-marked-circle-outline"
  49. lambda: |-
  50. if ( int(id(iaq).state) <= 50) {
  51. return {"Excellent"};
  52. }
  53. else if (int(id(iaq).state) >= 51 && int(id(iaq).state) <= 100) {
  54. return {"Good"};
  55. }
  56. else if (int(id(iaq).state) >= 101 && int(id(iaq).state) <= 150) {
  57. return {"Lightly polluted"};
  58. }
  59. else if (int(id(iaq).state) >= 151 && int(id(iaq).state) <= 200) {
  60. return {"Moderately polluted"};
  61. }
  62. else if (int(id(iaq).state) >= 201 && int(id(iaq).state) <= 250) {
  63. return {"Heavily polluted"};
  64. }
  65. else if (int(id(iaq).state) >= 251 && int(id(iaq).state) <= 350) {
  66. return {"Severely polluted"};
  67. }
  68. else if (int(id(iaq).state) >= 351) {
  69. return {"Extremely polluted"};
  70. }
  71. else {
  72. return {"error"};
  73. }
  74.  
Advertisement
Add Comment
Please, Sign In to add comment