bath_basic.yaml 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. ---
  2. # Basic Config
  3. esphome:
  4. name: ff-bath-fan
  5. platform: ESP8266
  6. board: esp8285
  7. web_server:
  8. port: 80
  9. wifi:
  10. ssid: !secret wifi_ssid
  11. password: !secret wifi_password
  12. domain: .int.mmax.cloud
  13. button:
  14. - platform: restart
  15. name: "FF-Bath-Fan Restart"
  16. logger:
  17. api:
  18. encryption:
  19. key: "ejeMnlF5M60w/yuYwAWn/kIBz701xLwVkUGf9iN8uLA="
  20. ota:
  21. password: "73cea25506d095b4970dedc41e2399fb"
  22. # Device Specific Config
  23. binary_sensor:
  24. - platform: gpio
  25. id: push_button
  26. pin:
  27. number: GPIO0
  28. mode:
  29. input: true
  30. pullup: true
  31. inverted: true
  32. internal: true
  33. on_press:
  34. # Prevents unintended LED lit states.
  35. if:
  36. condition:
  37. - switch.is_off: relay
  38. then:
  39. - switch.turn_on: blue_led
  40. - switch.turn_on: relay
  41. else:
  42. - switch.turn_off: relay
  43. switch:
  44. # The relay switches on the red side of the LED when active.
  45. - platform: gpio
  46. name: "FF_Bath_Fan"
  47. pin: GPIO12
  48. id: relay
  49. on_turn_off:
  50. if:
  51. condition:
  52. - switch.is_on: blue_led
  53. then:
  54. - switch.turn_off: blue_led
  55. # With this we can control the blue side of the LED.
  56. - platform: gpio
  57. id: blue_led
  58. pin:
  59. number: GPIO13
  60. inverted: True
  61. sensor:
  62. - platform: dht
  63. pin: GPIO14
  64. model: AM2302
  65. temperature:
  66. name: "FF Bath Temperature"
  67. humidity:
  68. name: "FF Bath Humidity"
  69. on_value_range:
  70. - above: 85.0
  71. then:
  72. - switch.turn_on: relay
  73. - below: 80.0
  74. then:
  75. - switch.turn_off: relay
  76. update_interval: 30s
  77. - platform: uptime
  78. name: Uptime Sensor
  79. id: uptime_sensor
  80. update_interval: 60s