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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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: '110.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. weight:
  69. name: "Xiaomi Mi Scale Weight"
  70. id: weight_miscale
  71. on_value:
  72. then:
  73. - lambda: |-
  74. if (id(weight_miscale).state >= id(asia_low) && id(weight_miscale).state <= id(asia_high)) {
  75. return id(weight_user_asia).publish_state(x);}
  76. else if (id(weight_miscale).state >= id(patryk_low) && id(weight_miscale).state <= id(patryk_high)) {
  77. return id(weight_user_patryk).publish_state(x);}
  78. else if (id(weight_miscale).state >= id(ala_low) && id(weight_miscale).state <= id(ala_high)) {
  79. return id(weight_user_ala).publish_state(x);}
  80. impedance:
  81. name: "Xiaomi Mi Scale Impedance"
  82. id: impedance_miscale
  83. on_value:
  84. then:
  85. - lambda: |-
  86. if (id(weight_miscale).state >= id(asia_low) && id(weight_miscale).state <= id(asia_high)) {
  87. return id(impedance_user_asia).publish_state(x);}
  88. else if (id(weight_miscale).state >= id(patryk_low) && id(weight_miscale).state <= id(patryk_high)) {
  89. return id(impedance_user_patryk).publish_state(x);}
  90. else if (id(weight_miscale).state >= id(ala_low) && id(weight_miscale).state <= id(ala_high)) {
  91. return id(impedance_user_ala).publish_state(x);}
  92. # clear_impedance: True
  93. - platform: template
  94. name: Weight Asia
  95. id: weight_user_asia
  96. unit_of_measurement: 'kg'
  97. icon: mdi:weight-kilogram
  98. accuracy_decimals: 2
  99. - platform: template
  100. name: Impedance Asia
  101. id: impedance_user_asia
  102. unit_of_measurement: 'Ω'
  103. icon: mdi:omega
  104. accuracy_decimals: 0
  105. - platform: template
  106. name: Weight Patryk
  107. id: weight_user_patryk
  108. unit_of_measurement: 'kg'
  109. icon: mdi:weight-kilogram
  110. accuracy_decimals: 2
  111. - platform: template
  112. name: Impedance Patryk
  113. id: impedance_user_patryk
  114. unit_of_measurement: 'Ω'
  115. icon: mdi:omega
  116. accuracy_decimals: 0
  117. - platform: template
  118. name: Weight Ala
  119. id: weight_user_ala
  120. unit_of_measurement: 'kg'
  121. icon: mdi:weight-kilogram
  122. accuracy_decimals: 2
  123. - platform: template
  124. name: Impedance Ala
  125. id: impedance_user_ala
  126. unit_of_measurement: 'Ω'
  127. icon: mdi:omega
  128. accuracy_decimals: 0