Bedroom Esp

mail@pastecode.io avatar
unknown
plain_text
2 years ago
2.4 kB
1
Indexable
Never
substitutions:
  assigned_ip: 192.168.1.32
  
output:
  - platform: esp8266_pwm
    pin: D5
    id: rtttl_out
  - platform: esp8266_pwm
    id: red_led_op
    pin: D7
    inverted: true
  - platform: esp8266_pwm
    id: green_led_op
    pin: D6
    inverted: true

rtttl:
  output: rtttl_out
  
  
  
light:
  - platform: monochromatic
    name: "D1 Bedroom Red Led"
    output: red_led_op
    effects:
      - pulse:
          name: "Fast Pulse"
          transition_length: 0.5s
          update_interval: 0.5s
  - platform: monochromatic
    name: "D1 Bedroom Green Led"
    output: green_led_op
    effects:
      - pulse:

sensor:
  - platform: dht
    pin: D3
    model: DHT22
    temperature:
      name: "D1 Bedroom Temp"
      accuracy_decimals: 1
      # filters:
      #   - exponential_moving_average:
      #       send_every: 2 
      force_update: true     
    humidity:
      name: "D1 Bedroom Humidity"
      # filters:
      #   - exponential_moving_average:
      #       send_every: 2  
      force_update: true       
    update_interval: 600s 
    
  - platform: dht
    pin: D0
    model: DHT11
    temperature:
      name: "D1 Bedroom Temp DHT11"
      accuracy_decimals: 1
      force_update: true     
    humidity:
      name: "D1 Bedroom Humidity DHT11"
      force_update: true       
    update_interval: 600s  

# Enable Home Assistant API
api:
  services:
    - service: play_rtttl
      variables:
        song_str: string
      then:
        - rtttl.play:
            rtttl: !lambda 'return song_str;'

        
############################################################        
#  __   __   __          __      __  ___       ___  ___    #
# |__) /  \ |__) | |\ | / _`    /__`  |  |  | |__  |__  .  #  
# |__) \__/ |  \ | | \| \__>    .__/  |  \__/ |    |    .  #
#                                                          #
############################################################

esphome:
  name: d1-bedroom
  platform: ESP8266
  board: d1_mini

# Enable logging
logger:



ota:
  password: "49695a8cb9f78e590419f1f3bd798939"

wifi:
  ssid: !secret esp_wifi_ssid
  password: !secret esp_wifi_password
  manual_ip:
    static_ip: $assigned_ip
    gateway: !secret esp_gateway
    subnet: !secret esp_subnet
  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "D1-Kitchen Fallback Hotspot"
    password: "UpGvGXg4C7pT"

captive_portal: