bath_basic.yaml 1.8 KB

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