Newer
Older
homeassistant_config / esphome / sovebt.yaml
@Rolf Bagge Rolf Bagge on 14 Dec 2022 2 KB Updates
esphome:
  name: sovebt

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:
  level: INFO
  baud_rate: 0

# Enable Home Assistant API
api:
  encryption:
    key: "27U+L64zHMWVsRmb7KpIAUshBLXcmsITzMzHnvJ+5ZE="

ota:
  password: "03bdb91f990a4f77a925da3c16eb655b"

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

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

captive_portal:

esp32_ble_tracker:

bluetooth_proxy:
  active: true

sensor:
  - platform: uptime
    name: Uptime

  - platform: xiaomi_miscale
    mac_address: '5C:CA:D3:8F:B1:B6'
    weight:
      name: "Xiaomi Mi Scale Weight"
      id: weight_miscale
      on_value:
        then:
          - lambda: |-
              if (id(weight_miscale).state >= 65 && id(weight_miscale).state < 89) {
                return id(weight_user2).publish_state(x);}
              else if (id(weight_miscale).state >= 89 && id(weight_miscale).state < 100) {
                return id(weight_user1).publish_state(x);}
    impedance:
      name: "Xiaomi Mi Scale Impedance"
      id: impedance_miscale
      on_value:
        then:
          - lambda: |-
              if (id(weight_miscale).state >= 65 && id(weight_miscale).state < 89) {
                return id(impedance_user2).publish_state(x);}
              else if (id(weight_miscale).state >= 89 && id(weight_miscale).state < 100) {
                return id(impedance_user1).publish_state(x);}

    clear_impedance: true
  - platform: template
    name: Weight Rolf
    id: weight_user1
    unit_of_measurement: 'kg'
    icon: mdi:weight-kilogram
    accuracy_decimals: 2
  - platform: template
    name: Impedance Rolf
    id: impedance_user1
    unit_of_measurement: 'Ω'
    icon: mdi:omega
    accuracy_decimals: 0

  - platform: template
    name: Weight Berit
    id: weight_user2
    unit_of_measurement: 'kg'
    icon: mdi:weight-kilogram
    accuracy_decimals: 2
  - platform: template
    name: Impedance Berit
    id: impedance_user2
    unit_of_measurement: 'Ω'
    icon: mdi:omega
    accuracy_decimals: 0