substitutions:
  devicename: og-wz-eh-ring

esphome:
  name: ${devicename}
  platform: ESP8266
  board: nodemcuv2

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:
  password: "55ce775e3e40f10d38d43421dcefc476"

wifi:
  ssid: !secret wifi_wled_ssid
  password: !secret wifi_wled_password

  # Optional manual IP
  manual_ip:
    static_ip: 192.168.1.191
    gateway: 192.168.1.1
    subnet: 255.255.255.0

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "${devicename}"
    password: "anO1GGY2nsmz"

captive_portal:

wled:

e131:
  method: multicast # default: register E1.31 to Multicast group
        
# Example configuration entry
light:
  - platform: neopixelbus
    id: neopixel
    name: "NeoPixel Light"
    type: GRB #GRB
    variant: WS2812
    pin: RX
    num_leds: 18
    internal: false
#    brightness: 100%
    effects:
      - wled:
          port: 19446
      - e131:
          universe: 1
          channels: RGB


status_led:
  pin:
    number: GPIO2
    inverted: True

sensor:
  - platform: wifi_signal
    name: "${devicename} Wi-Fi Signal"
    update_interval: 60s

  - platform: uptime
    name: "${devicename} Uptime"
    update_interval: 60s

  - platform: hx711
    name: "Bed Weight (L)"
    id: bed_weight_l
    dout_pin: D2
    clk_pin: D3
    filters:
      - calibrate_linear:
          - 909154 -> 0
#          - 887502 -> 1.0
#          - 840704 -> 2.0
          - 531330 -> 10.86
#          - 70000 -> 0
#          - 145000 -> 5.6
      - sliding_window_moving_average:
          window_size: 5
          send_every: 5
    update_interval: 2s
    unit_of_measurement: kg
    accuracy_decimals: 2

binary_sensor:
  - platform: template
    name: "Bed Occupancy (Left)"
    device_class: occupancy
    lambda: |-
      if (id(bed_weight_l).state > 10) {
        return true;
      } else {
        return false;
      }

  - platform: gpio
    pin: D5
    name: "${devicename} Red"

  - platform: gpio
    pin: D6
    name: "${devicename} Green"

  - platform: gpio
    pin: D7
    name: "${devicename} Blue"

# buzzer von vwbus und weather klauen welcher port
# D6