substitutions:
  devicename: d1-005
  Device_Location: Switch-Wifi-Temperature
  update_interval: !secret d1-update_interval
  ipaddress: 10.0.0.115

esphome:
  name: d1-005
  friendly_name: "d1-005 - Temperatures"

esp8266:
  board: nodemcuv2

# Enable logging
logger:
  level: WARN

wifi:
  ssid: !secret mogwai_wifi_name
  password: !secret mogwai_wifi_password
  <<: !include common/network.yaml

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "$devicename Fallback Hotspot"
    password: !secret mogwai_ap_key

# Enable Home Assistant API
api:
  encryption:
    key: !secret mogwai_api_key

ota:
  platform: esphome
  password: !secret mogwai_ota_key

captive_portal:

time:

  - platform: homeassistant
    id: homeassistant_time
#    on_time:
#    # Cron syntax, trigger every 5 minutes
#    - cron: '1 3,8,13,18,23,28,33,38,43,48,53,58 * * * *'
#      then:
#        - switch.turn_on: led_onboard
#        - switch.turn_on: led_onboard2
#    - cron: '1 4,9,14,19,24,29,34,39,44,49,54,59 * * * *'
#      then:
#        - switch.turn_off: led_onboard
#        - switch.turn_off: led_onboard2

<<: !include common/website.yaml

switch:

  - <<: !include common/d1-led-onboard1.yaml

  - <<: !include common/d1-led-onboard2.yaml

  - <<: !include common/restart.yaml

<<: !include common/nodemcu-led-onboard-both-mqtt.yaml

interval:
  - interval: $update_interval
    then:

  - <<: !include common/version-interval.yaml

  - <<: !include common/whatami.yaml

# Dallas Temperature Sensors
one_wire:
  - platform: gpio
    pin: GPIO03

# Individual sensors
sensor:

  - <<: !include common/free_space.yaml


text_sensor:

  - <<: !include common/version.yaml

<<: !include common/external-heapmon.yaml