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

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