| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142 |
- 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: '110.0'
- - id: ala_low
- type: float
- initial_value: '10.0'
- - id: ala_high
- type: float
- initial_value: '20.0'
- packages:
- diag: !include common/diag.yaml
- 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
- # Enable logging
- logger:
- web_server:
- port: 80
-
- # Enable Home Assistant API
- api:
- encryption:
- key: "ejeMnlF5M60w/yuYwAWn/kIBz701xLwVkUGf9iN8uLA="
- ota:
- password: "2c27af3ab81f992e23745c20ab5dfc02"
- 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'
- weight:
- name: "Xiaomi Mi Scale Weight"
- id: weight_miscale
- 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
- 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);}
- clear_impedance: True
- - 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
|