--- # Basic Config esphome: name: ff-bath-fan platform: ESP8266 board: esp8285 web_server: port: 80 wifi: ssid: !secret wifi_ssid password: !secret wifi_password domain: .int.mmax.cloud button: - platform: restart name: "FF-Bath-Fan Restart" logger: api: encryption: key: "ejeMnlF5M60w/yuYwAWn/kIBz701xLwVkUGf9iN8uLA=" ota: password: "73cea25506d095b4970dedc41e2399fb" # Device Specific Config binary_sensor: - platform: gpio id: push_button pin: number: GPIO0 mode: input: true pullup: true inverted: true internal: true on_press: # Prevents unintended LED lit states. if: condition: - switch.is_off: relay then: - switch.turn_on: blue_led - switch.turn_on: relay else: - switch.turn_off: relay switch: # The relay switches on the red side of the LED when active. - platform: gpio name: "FF_Bath_Fan" pin: GPIO12 id: relay on_turn_off: if: condition: - switch.is_on: blue_led then: - switch.turn_off: blue_led # With this we can control the blue side of the LED. - platform: gpio id: blue_led pin: number: GPIO13 inverted: True sensor: - platform: dht pin: GPIO14 model: AM2302 temperature: name: "FF Bath Temperature" humidity: name: "FF Bath Humidity" on_value_range: - above: 85.0 then: - switch.turn_on: relay - below: 80.0 then: - switch.turn_off: relay update_interval: 30s - platform: uptime name: Uptime Sensor id: uptime_sensor update_interval: 60s