esphome:
  name: hub

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:
#   level: VERY_VERBOSE

# Enable Home Assistant API
api:

ota:
  password: "255834738e2dd3d917c17685d550f41b"

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

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Hub Fallback Hotspot"
    password: "dnYDnNYpfmpT"

captive_portal:

esp32_ble_tracker:
#   on_ble_manufacturer_data_advertise:
#       manufacturer_id: 0590
#       then:
#       - lambda: |-
#           id(ble_sensor).publish_state(x[0]);
#   on_ble_service_data_advertise:
#       service_uuid: 0590
#       then:
#       - lambda: |-
#         id(ble_sensor).publish_state(x[0]);

# text_sensor:
#   - platform: ble_scanner
#     name: "BLE Devices Scanner"

sensor:
  - platform: template
    name: "BLE Sensor"
    id: ble_sensor
  - platform: atc_mithermometer
    mac_address: A4:C1:38:A5:8D:B3
    temperature:
      name: "ATC Temperature (8D:B3)"
    humidity:
      name: "ATC Humidity (8D:B3)"
    battery_level:
      name: "ATC Battery-Level (8D:B3)"
    battery_voltage:
      name: "ATC Battery-Voltage (8D:B3)"

  - platform: atc_mithermometer
    mac_address: A4:C1:38:A9:8D:03
    temperature:
      name: "ATC Temperature (8D:03)"
    humidity:
      name: "ATC Humidity (8D:03)"
    battery_level:
      name: "ATC Battery-Level (8D:03)"
    battery_voltage:
      name: "ATC Battery-Voltage (8D:03)"
      
  - platform: atc_mithermometer
    mac_address: A4:C1:38:98:D1:1B
    temperature:
      name: "ATC Temperature (D1:1B)"
    humidity:
      name: "ATC Humidity (D1:1B)"
    battery_level:
      name: "ATC Battery-Level (D1:1B)"
    battery_voltage:
      name: "ATC Battery-Voltage (D1:1B)"
      
  - platform: atc_mithermometer
    mac_address: A4:C1:38:FE:6D:D9
    temperature:
      name: "ATC Temperature (6D:D9)"
    humidity:
      name: "ATC Humidity (6D:D9)"
    battery_level:
      name: "ATC Battery-Level (6D:D9)"
    battery_voltage:
      name: "ATC Battery-Voltage (6D:D9)"

  - platform: atc_mithermometer
    mac_address: A4:C1:38:55:CD:EA
    temperature:
      name: "ATC Temperature (CD:EA)"
    humidity:
      name: "ATC Humidity (CD:EA)"
    battery_level:
      name: "ATC Battery-Level (CD:EA)"
    battery_voltage:
      name: "ATC Battery-Voltage (CD:EA)"

  - platform: atc_mithermometer
    mac_address: A4:C1:38:3B:6F:E6
    temperature:
      name: "ATC Temperature (6F:E6)"
    humidity:
      name: "ATC Humidity (6F:E6)"
    battery_level:
      name: "ATC Battery-Level (6F:E6)"
    battery_voltage:
      name: "ATC Battery-Voltage (6F:E6)"

  - platform: xiaomi_miscale
    mac_address: 50:FB:19:4A:A4:A2
    weight:
      name: "Xiaomi Mi Scale Weight"
    impedance:
      name: "Xiaomi Mi Scale Impedance"

