esphome:
  name: $devicename
  comment: $comment
  project:
    name: "groovy.industries"
    version: "2.0"
  on_boot:
    priority: -100
    then:
      - lambda: |-
          id(sntp_time).update();

substitutions:
  domain: !secret domain
  timezone: !secret timezone
  fan_script: "dummy"

preferences:
  flash_write_interval: 15s

logger:
  # level: INFO

api:
  password: !secret api_password
  reboot_timeout: 0s

ota:
  password: !secret ota_password

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  fast_connect: on
  reboot_timeout: 1min
  domain: .${domain}
  use_address: ${devicename}.${domain}

web_server:
  port: 80
  local: true
  # include_internal: true

prometheus:
  include_internal: true
  relabel:
    rssi:
      id: rssi
      name: RSSI
    device_uptime:
      id: uptime
      name: Uptime

sensor:
  - platform: wifi_signal
    id: rssi
    name: "Wifi Signal"
    update_interval: 60s

  - platform: uptime
    id: device_uptime
    name: "Device Uptime"
    update_interval: 60s

text_sensor:
  - platform: version
    name: "ESPHome Version"
    hide_timestamp: true

button:
  - platform: restart
    name: "Device Restart"

http_request:
  id: http_request_data
  useragent: esphome/${devicename}
  timeout: 1s

script:
  - id: dummy
    then:
      - lambda: |-
          return;
