bath_basic.yaml 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. ---
  2. substitutions:
  3. devicename: ff-bath-fan
  4. low_devicename: ff_bath_fan
  5. friendly_devicename: FF Bath Fan Controller
  6. packages:
  7. # Enable Home Assistant API
  8. esphome: !include common/keys.yaml
  9. diag: !include common/diag.yaml
  10. # Basic Config
  11. esphome:
  12. name: $devicename
  13. esp8266:
  14. board: esp8285
  15. web_server:
  16. port: 80
  17. wifi:
  18. ssid: !secret iot_ssid
  19. password: !secret iot_password
  20. domain: .int.mmax.cloud
  21. logger:
  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