ff-bath-bt-proxy-02.yaml 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. substitutions:
  2. devicename: ff-bath-bt-proxy-02
  3. low_devicename: ff_bath_bt_proxy_02
  4. friendly_devicename: FF Bath Bluetooth Proxy
  5. globals:
  6. - id: asia_low
  7. type: float
  8. initial_value: '60.0'
  9. - id: asia_high
  10. type: float
  11. initial_value: '94.95'
  12. - id: patryk_low
  13. type: float
  14. initial_value: '95.0'
  15. - id: patryk_high
  16. type: float
  17. initial_value: '120.0'
  18. - id: ala_low
  19. type: float
  20. initial_value: '10.0'
  21. - id: ala_high
  22. type: float
  23. initial_value: '20.0'
  24. packages:
  25. diag: !include common/diag.yaml
  26. esphome:
  27. name: $devicename
  28. friendly_name: $friendly_devicename
  29. esp32:
  30. board: esp32dev
  31. framework:
  32. type: arduino
  33. # type: esp-idf
  34. # sdkconfig_options:
  35. # CONFIG_BT_BLE_50_FEATURES_SUPPORTED: y
  36. # CONFIG_BT_BLE_42_FEATURES_SUPPORTED: y
  37. # CONFIG_BOOTLOADER_WDT_ENABLE: n
  38. # CONFIG_BOOTLOADER_WDT_DISABLE_IN_USER_CODE: y
  39. # CONFIG_ESP_INT_WDT: n
  40. # CONFIG_ESP_TASK_WDT: n
  41. # CONFIG_INT_WDT: n
  42. # CONFIG_TASK_WDT: n
  43. # Enable logging
  44. logger:
  45. web_server:
  46. port: 80
  47. # Enable Home Assistant API
  48. api:
  49. encryption:
  50. key: "ejeMnlF5M60w/yuYwAWn/kIBz701xLwVkUGf9iN8uLA="
  51. ota:
  52. password: "2c27af3ab81f992e23745c20ab5dfc02"
  53. wifi:
  54. ssid: !secret iot_ssid
  55. password: !secret iot_password
  56. domain: .int.mmax.cloud
  57. # esp32_ble_tracker:
  58. # scan_parameters:
  59. # We currently use the defaults to ensure Bluetooth
  60. # can co-exist with WiFi In the future we may be able to
  61. # enable the built-in coexistence logic in ESP-IDF
  62. # active: true
  63. bluetooth_proxy:
  64. active: true
  65. sensor:
  66. - platform: xiaomi_miscale
  67. mac_address: 'd0:3e:7d:3e:e3:5e'
  68. clear_impedance: true
  69. weight:
  70. name: "Xiaomi Mi Scale Weight"
  71. id: weight_miscale
  72. force_update: true
  73. # on_value:
  74. # then:
  75. # - lambda: |-
  76. # if (id(weight_miscale).state >= id(asia_low) && id(weight_miscale).state <= id(asia_high)) {
  77. # return id(weight_user_asia).publish_state(x);}
  78. # else if (id(weight_miscale).state >= id(patryk_low) && id(weight_miscale).state <= id(patryk_high)) {
  79. # return id(weight_user_patryk).publish_state(x);}
  80. # else if (id(weight_miscale).state >= id(ala_low) && id(weight_miscale).state <= id(ala_high)) {
  81. # return id(weight_user_ala).publish_state(x);}
  82. impedance:
  83. name: "Xiaomi Mi Scale Impedance"
  84. id: impedance_miscale
  85. force_update: true
  86. # on_value:
  87. # then:
  88. # - lambda: |-
  89. # if (id(weight_miscale).state >= id(asia_low) && id(weight_miscale).state <= id(asia_high)) {
  90. # return id(impedance_user_asia).publish_state(x);}
  91. # else if (id(weight_miscale).state >= id(patryk_low) && id(weight_miscale).state <= id(patryk_high)) {
  92. # return id(impedance_user_patryk).publish_state(x);}
  93. # else if (id(weight_miscale).state >= id(ala_low) && id(weight_miscale).state <= id(ala_high)) {
  94. # return id(impedance_user_ala).publish_state(x);}
  95. # - platform: template
  96. # name: Weight Asia
  97. # id: weight_user_asia
  98. # unit_of_measurement: 'kg'
  99. # icon: mdi:weight-kilogram
  100. # accuracy_decimals: 2
  101. # - platform: template
  102. # name: Impedance Asia
  103. # id: impedance_user_asia
  104. # unit_of_measurement: 'Ω'
  105. # icon: mdi:omega
  106. # accuracy_decimals: 0
  107. # - platform: template
  108. # name: Weight Patryk
  109. # id: weight_user_patryk
  110. # unit_of_measurement: 'kg'
  111. # icon: mdi:weight-kilogram
  112. # accuracy_decimals: 2
  113. # - platform: template
  114. # name: Impedance Patryk
  115. # id: impedance_user_patryk
  116. # unit_of_measurement: 'Ω'
  117. # icon: mdi:omega
  118. # accuracy_decimals: 0
  119. # - platform: template
  120. # name: Weight Ala
  121. # id: weight_user_ala
  122. # unit_of_measurement: 'kg'
  123. # icon: mdi:weight-kilogram
  124. # accuracy_decimals: 2
  125. # - platform: template
  126. # name: Impedance Ala
  127. # id: impedance_user_ala
  128. # unit_of_measurement: 'Ω'
  129. # icon: mdi:omega
  130. # accuracy_decimals: 0