My wife bought a cheap (€ 19,95) but OK BLE e.volve smart scale, ofcourse without checking if it can be integrated. It looks like e.volve is a very unknown ‘company’.
I was about to post a question, but luckily it became the solution, right on time!
Here is what works for me. If anyone else has a similar e.volve scale, please post your details if your scale also starts with BLE MAC address 80:F4:16.
esphome:
esp32:
board: esp-wrover-kit
framework:
type: esp-idf
ble_client:
- mac_address: XX:XX:XX:XX:XX:XX
id: ble_evolve_smart_scale
# auto_connect: true
on_connect:
then:
- lambda: |-
ESP_LOGD("ble_client_lambda", "Connected to ble_evolve_smart_scale");
on_disconnect:
then:
- lambda: |-
ESP_LOGD("ble_client_lambda", "Disconnected from ble_evolve_smart_scale");
esp32_ble_tracker:
sensor:
- platform: template
name: "Evolve Smart Scale User1"
id: evolve_smart_scale_user1
unit_of_measurement: "kg"
icon: mdi:weight-kilogram
accuracy_decimals: 2
update_interval: never
- platform: template
name: "Evolve Smart Scale User2"
id: evolve_smart_scale_user2
unit_of_measurement: "kg"
icon: mdi:weight-kilogram
accuracy_decimals: 2
update_interval: never
- platform: template
name: "Evolve Smart Scale User3"
id: evolve_smart_scale_user3
unit_of_measurement: "kg"
icon: mdi:weight-kilogram
accuracy_decimals: 2
update_interval: never
- platform: ble_client
type: characteristic
ble_client_id: ble_evolve_smart_scale
id: scale_data
internal: true
notify: true
service_uuid: '0000FFB0-0000-1000-8000-00805F9B34FB'
characteristic_uuid: '0000FFB2-0000-1000-8000-00805F9B34FB'
lambda: |-
// Assuming x is std::vector<uint8_t>
// Combine the bytes x[3], x[4], and x[5] into a single 3-byte integer
int32_t raw_value = (x[3] << 16) | (x[4] << 8) | x[5];
// The offset is likely part of the raw value. Subtract it.
int32_t final_value = raw_value - 0x680000;
// The final value is likely in grams or decigrams. Divide to get kg.
float weightKg = static_cast<float>(final_value) / 1000.0f;
ESP_LOGD("scale_data", "Raw Value: 0x%X, Final Value: %d, Weight: %.2f kg", raw_value, final_value, weight);
// Round the weight to two decimal places
float roundedWeightKg = round(weightKg * 100.0) / 100.0;
id(weight).publish_state(roundedWeightKg);
return roundedWeightKg;
- platform: template
name: Weight Filters
id: weight
on_value:
then:
- lambda: |-
if (id(weight).state < 0) {
return;
}
if (id(weight).state >= 77) {
id(evolve_smart_scale_user1).publish_state(x);
} else if (id(weight).state >= 65 && id(weight).state <= 77) {
id(evolve_smart_scale_user2).publish_state(x);
} else {
id(evolve_smart_scale_user3).publish_state(x);
}
Resources: