substitutions: devicename: ff-bath-bt-proxy-02 low_devicename: ff_bath_bt_proxy_02 friendly_devicename: FF Bath Bluetooth Proxy globals: - id: asia_low type: float initial_value: '60.0' - id: asia_high type: float initial_value: '94.95' - id: patryk_low type: float initial_value: '95.0' - id: patryk_high type: float initial_value: '120.0' - id: ala_low type: float initial_value: '10.0' - id: ala_high type: float initial_value: '20.0' esphome: name: $devicename friendly_name: $friendly_devicename esp32: board: esp32dev framework: type: arduino # type: esp-idf # sdkconfig_options: # CONFIG_BT_BLE_50_FEATURES_SUPPORTED: y # CONFIG_BT_BLE_42_FEATURES_SUPPORTED: y # CONFIG_BOOTLOADER_WDT_ENABLE: n # CONFIG_BOOTLOADER_WDT_DISABLE_IN_USER_CODE: y # CONFIG_ESP_INT_WDT: n # CONFIG_ESP_TASK_WDT: n # CONFIG_INT_WDT: n # CONFIG_TASK_WDT: n packages: # Enable Home Assistant API esphome: !include common/keys.yaml diag: !include common/diag.yaml # Enable logging logger: web_server: port: 80 wifi: ssid: !secret iot_ssid password: !secret iot_password domain: .int.mmax.cloud esp32_ble_tracker: # scan_parameters: # We currently use the defaults to ensure Bluetooth # can co-exist with WiFi In the future we may be able to # enable the built-in coexistence logic in ESP-IDF # active: true # bluetooth_proxy: # active: true sensor: - platform: xiaomi_miscale mac_address: 'd0:3e:7d:3e:e3:5e' clear_impedance: true weight: name: "Xiaomi Mi Scale Weight" id: weight_miscale force_update: true # on_value: # then: # - lambda: |- # if (id(weight_miscale).state >= id(asia_low) && id(weight_miscale).state <= id(asia_high)) { # return id(weight_user_asia).publish_state(x);} # else if (id(weight_miscale).state >= id(patryk_low) && id(weight_miscale).state <= id(patryk_high)) { # return id(weight_user_patryk).publish_state(x);} # else if (id(weight_miscale).state >= id(ala_low) && id(weight_miscale).state <= id(ala_high)) { # return id(weight_user_ala).publish_state(x);} impedance: name: "Xiaomi Mi Scale Impedance" id: impedance_miscale force_update: true # on_value: # then: # - lambda: |- # if (id(weight_miscale).state >= id(asia_low) && id(weight_miscale).state <= id(asia_high)) { # return id(impedance_user_asia).publish_state(x);} # else if (id(weight_miscale).state >= id(patryk_low) && id(weight_miscale).state <= id(patryk_high)) { # return id(impedance_user_patryk).publish_state(x);} # else if (id(weight_miscale).state >= id(ala_low) && id(weight_miscale).state <= id(ala_high)) { # return id(impedance_user_ala).publish_state(x);} # - platform: template # name: Weight Asia # id: weight_user_asia # unit_of_measurement: 'kg' # icon: mdi:weight-kilogram # accuracy_decimals: 2 # - platform: template # name: Impedance Asia # id: impedance_user_asia # unit_of_measurement: 'Ω' # icon: mdi:omega # accuracy_decimals: 0 # - platform: template # name: Weight Patryk # id: weight_user_patryk # unit_of_measurement: 'kg' # icon: mdi:weight-kilogram # accuracy_decimals: 2 # - platform: template # name: Impedance Patryk # id: impedance_user_patryk # unit_of_measurement: 'Ω' # icon: mdi:omega # accuracy_decimals: 0 # - platform: template # name: Weight Ala # id: weight_user_ala # unit_of_measurement: 'kg' # icon: mdi:weight-kilogram # accuracy_decimals: 2 # - platform: template # name: Impedance Ala # id: impedance_user_ala # unit_of_measurement: 'Ω' # icon: mdi:omega # accuracy_decimals: 0