bed scale recalibrate
This commit is contained in:
@@ -13,6 +13,7 @@ api:
|
||||
password: ""
|
||||
|
||||
ota:
|
||||
platform: esphome
|
||||
password: ""
|
||||
|
||||
wifi:
|
||||
@@ -26,7 +27,6 @@ wifi:
|
||||
|
||||
captive_portal:
|
||||
|
||||
|
||||
globals:
|
||||
- id: constant_weight
|
||||
type: float
|
||||
@@ -41,8 +41,8 @@ sensor:
|
||||
gain: 128
|
||||
filters:
|
||||
- calibrate_linear:
|
||||
- 2827100 -> 0
|
||||
- 5170670 -> 103.9
|
||||
- 1827200 -> 0
|
||||
- 3218000 -> 105
|
||||
on_value:
|
||||
- if:
|
||||
condition:
|
||||
@@ -52,15 +52,15 @@ sensor:
|
||||
last = x;
|
||||
return x < 10.0 && diff < 1.0 && diff > - 1.0;
|
||||
then:
|
||||
- lambda: 'id(constant_weight) = x;'
|
||||
- lambda: "id(constant_weight) = x;"
|
||||
|
||||
- platform: template
|
||||
name: Bedscale
|
||||
icon: mdi:weight-kilogram
|
||||
update_interval: 3s
|
||||
unit_of_measurement: kg
|
||||
lambda: 'return id(bed).state;'
|
||||
lambda: "return id(bed).state;"
|
||||
filters:
|
||||
- lambda: 'return x - id(constant_weight);'
|
||||
- lambda: 'return x >= 10.0 ? x : 0;'
|
||||
- lambda: "return x - id(constant_weight);"
|
||||
- lambda: "return x >= 10.0 ? x : 0;"
|
||||
- delta: 0.5
|
||||
@@ -13,6 +13,7 @@ api:
|
||||
password: ""
|
||||
|
||||
ota:
|
||||
platform: esphome
|
||||
password: ""
|
||||
|
||||
wifi:
|
||||
@@ -33,4 +34,3 @@ sensor:
|
||||
clk_pin: D3
|
||||
gain: 128
|
||||
update_interval: 3s
|
||||
|
||||
Reference in New Issue
Block a user