substitutions:
  devicename: eg-ga-sw-tor

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

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:
  password: "99e1512e8c3c6c74a0941c6265a6bfb8"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

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

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

captive_portal:

# Example configuration entry
switch:
  - platform: gpio
    pin: D2
    id: relay
    name: "Garagentor"
    icon: "mdi:garage"
    on_turn_on:
    - delay: 4000ms
    - switch.turn_off: relay

  - platform: restart
    name: "${devicename} Neustart"

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

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