Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- esphome:
- name: mi-scale-2
- friendly_name: Mi-Scale 2
- esp32:
- board: esp32dev
- framework:
- type: arduino
- # Enable logging
- logger:
- # Enable Home Assistant API
- api:
- encryption:
- key: "GgYrNcnD4YjuCCgppb5rFomCmwK7cQVgS4ENNULaav0="
- ota:
- password: "b89172cbcd767fa46509f8616db70ce2"
- wifi:
- ssid: !secret wifi_ssid
- password: !secret wifi_password
- # Enable fallback hotspot (captive portal) in case wifi connection fails
- ap:
- ssid: "Mi-Scale-2 Fallback Hotspot"
- password: "kMTFeO1drgj3"
- captive_portal:
- esp32_ble_tracker:
- sensor:
- # XIAOMI MISCALE
- - platform: xiaomi_miscale
- mac_address: '70:87:9E:25:16:A8'
- weight:
- id: "miscale_weight"
- name: "Person1 Weight"
- icon: mdi:scale-bathroom
- accuracy_decimals: 2
- on_value:
- then:
- - lambda: |-
- const float bmi_factor = 0.29860551;
- return id(miscale_bmi).publish_state(x * bmi_factor);
- - platform: template
- id: "miscale_bmi"
- name: "Person1 BMI"
- icon: mdi:human-pregnant
- unit_of_measurement: ""
- accuracy_decimals: 1
Advertisement
Add Comment
Please, Sign In to add comment