-
-
Save markusressel/e888544d4404fbed4c841ec83df638bb to your computer and use it in GitHub Desktop.
Moved to https://github.com/markusressel/ESPHome-Smart-Scale |
Please use the repository for questions and issues.
https://github.com/markusressel/ESPHome-Smart-Scale
I'm wondering if anyone can help.
I have used this with an ESP8266 board in an outside hedgehog box. It weighs the hogs as they are feeding. Everything works, however the zero reading drifts massively being outside. I have tried a previous auto tare which keeps the reading at 0g throughout the day, but the weight is quite a distance out once the temperatures drop on the night.
Can anyone include some code so that I can use a spare GPIO pin on the board so as the hog enters the box, the scales zero themselves before it reaches the main compartment ?
Current code is:
globals:
- id: constant_weight
type: float
`captive_portal:
sensor:
-
platform: hx711
id: weight
name: "HX711 Value2"
dout_pin: GPIO14
clk_pin: GPIO12
gain: 128
update_interval: 5s
unit_of_measurement: g
filters:
calibrate_linear:
- 68604 -> 0
- 626959 -> 2030
on_value:
- if:
condition:
- lambda: |-
static float last = 0.0;
float diff = x - last;
last = x;
return x < 50.0 && diff < 1.0 && diff > - 1.0;
then:
- lambda: 'id(constant_weight) = x;' -
platform: template
name: Hog Weight2
icon: mdi:scalee
unit_of_measurement: g
accuracy_decimals: 0
lambda: 'return id(weight).state;'
filters:
- lambda: 'return x - id(constant_weight);'
- lambda: 'return x >= 10.0 ? x : 0;'
- delta: 0.5`
Hi,
I am trying to build a scale for an aquarium (I want to find out how much water evaporates) using 4 x load cells and a HX711 ADC converter.
I followed this example here for the wiring (I have the same load cells)
Now I have followed the example code in the esphome docs and I already get values back.
At least a success :slight_smile:
Here is my code:
All these different values within 1 minute and there is no weight at all.
Why is this?
If the values are so extremely different, how can I calibrate the whole thing reasonably?
Above all, which of the many raw values do I use for 0 kg?