substitutions:
  devicename: d1-006
  Device_Location: Test-Temperature
  # update_interval: !secret d1-update_interval
  update_interval: 20s
  ipaddress: 10.0.0.116

esphome:
  name: d1-006
  friendly_name: "d1-006 - test"

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: hass_time

<<: !include common/website.yaml

font:
  - file: "pixelmix.ttf"
    id: ibm
    size: 6

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:
      - mqtt.publish:
          topic: /sensors/$devicename/temp-test
          payload: "${Device_Location} Testing"

#  - interval: 500ms
#    then:
#      - switch.toggle: led_onboard1

#  - interval: 2s
#    then:
#      - switch.toggle: led_onboard2

  - <<: !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

  - platform: dallas_temp
    address: 0xbc3cbde381343128
    name: "Snoopy"
    id: "snoopy_temperature"
    update_interval: $update_interval

text_sensor:

  - <<: !include common/version.yaml

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