Hello everybody,
I’m really new to ESPHOME and Home assistant, but I already have 3 ESPs running at home on fairly simple things.
To finish describing myself, I am not an English speaker but French, so please excuse my somewhat clumsy English.
I am continuing my oil boiler monitoring project and more specifically on measuring the level of fuel oil in the tank.
I abandoned the ultrasonic measurement which sends me back anything, probably because of the shape of the tank, for lack of a sensor with a very low reading angle.
So I tinkered with a system using the original gauge (by hydrostatic pressure) by including a pressure sensor.
It works pretty well, but there are leaks so you have to “inflate” the system before taking the measurement, so I installed an aquarium air pump to “inflate” the circuit before I could read the sensor. pressure.
On the other hand, there is no point in running this pump permanently, because there is no point in measuring the level all the time. Once a day will be enough.
Still the same, I struggle with the ESPHOME docs, and I tried a script.
I launch it with an “on_interval”, and I manage to start the pump for the time necessary to reinflate the system, but I do not see how to trigger and save the pressure measurement when stopping the pump. This measurement remains the only valid one before the next measurement.
So here is my script and the definition of the sensor that works, my question is how to put them end to end.
I also tried with a global variable but failed!..
# trigger for the script (10 s it's for trials !, will be much more in future)
- interval: 10s
then:
- script.execute: mesure_niveau_cuve
# the script
script:
- id: mesure_niveau_cuve
then:
- switch.turn_on: pompe
- delay: 5s
- switch.turn_off: pompe
- delay: 0.5s
# Now itis time to read the sensor and to freeze the value for the day !
# The Pressure sensor (here it take one mesure each 10 secondes but I struggle to integrate this mesure in the script up there.
- platform: hx711
name: "Pression"
id: "pression_fioul"
dout_pin: 26
clk_pin: 27
gain: 128
update_interval: 10s
filters:
- calibrate_linear:
- 180000 -> 0
- 8000000-> 100
unit_of_measurement: "%"
accuracy_decimals: 0
Anyway I tried, variable globals, lambda etc , either I have compilation errors or the return value remains at zero.
If anyone has done or seen this before, I’m all ears.
Thanks in advance.
Philippe
A+