bed scale recalibrate

This commit is contained in:
2024-10-21 18:46:30 +02:00
parent fb908f9d50
commit af7bfb2727
2 changed files with 9 additions and 9 deletions
+8 -8
View File
@@ -13,6 +13,7 @@ api:
password: "" password: ""
ota: ota:
platform: esphome
password: "" password: ""
wifi: wifi:
@@ -26,7 +27,6 @@ wifi:
captive_portal: captive_portal:
globals: globals:
- id: constant_weight - id: constant_weight
type: float type: float
@@ -41,8 +41,8 @@ sensor:
gain: 128 gain: 128
filters: filters:
- calibrate_linear: - calibrate_linear:
- 2827100 -> 0 - 1827200 -> 0
- 5170670 -> 103.9 - 3218000 -> 105
on_value: on_value:
- if: - if:
condition: condition:
@@ -52,15 +52,15 @@ sensor:
last = x; last = x;
return x < 10.0 && diff < 1.0 && diff > - 1.0; return x < 10.0 && diff < 1.0 && diff > - 1.0;
then: then:
- lambda: 'id(constant_weight) = x;' - lambda: "id(constant_weight) = x;"
- platform: template - platform: template
name: Bedscale name: Bedscale
icon: mdi:weight-kilogram icon: mdi:weight-kilogram
update_interval: 3s update_interval: 3s
unit_of_measurement: kg unit_of_measurement: kg
lambda: 'return id(bed).state;' lambda: "return id(bed).state;"
filters: filters:
- lambda: 'return x - id(constant_weight);' - lambda: "return x - id(constant_weight);"
- lambda: 'return x >= 10.0 ? x : 0;' - lambda: "return x >= 10.0 ? x : 0;"
- delta: 0.5 - delta: 0.5
+1 -1
View File
@@ -13,6 +13,7 @@ api:
password: "" password: ""
ota: ota:
platform: esphome
password: "" password: ""
wifi: wifi:
@@ -33,4 +34,3 @@ sensor:
clk_pin: D3 clk_pin: D3
gain: 128 gain: 128
update_interval: 3s update_interval: 3s