Based on the Home Assistant docs I read this blog. and ordered the sensor.
I setup my ESPHome (ESP8266 module) exactly as in the example, except the fact that I used another I/O, GPIO4 for all sensors:
sensor:
- platform: pulse_counter
pin: GPIO4
update_interval: 6s
name: "water pulse"
id: water_pulse
- platform: pulse_meter
pin: GPIO4
name: "Water Pulse Meter"
unit_of_measurement: "liter/min"
icon: "mdi:water"
total:
name: "Water Total"
unit_of_measurement: "liter"
- platform: pulse_meter
pin: GPIO4
name: "Water Pulse Meter"
unit_of_measurement: "liter/min"
icon: "mdi:water"
total:
name: "Water Meter Total"
unit_of_measurement: "m³"
id: water_meter_total
accuracy_decimals: 3
device_class: water
state_class: total_increasing
filters:
- multiply: 0.001
- platform: template
name: "Water Usage Liter"
id: water_flow_rate
accuracy_decimals: 1
unit_of_measurement: "l/min"
icon: "mdi:water"
lambda: return (id(water_pulse).state * 10);
update_interval: 6s
The sensor has an LED and blinks every time the ‘radar’ on the meter made 1 turn to indicate 1 liter of consumption. I restarted HA and all created ESPHome sensors were available within HA.
It’s nice to copy/paste a project but it’s more convenient to understand how it works especially when some things aren’t as expected.
I observed that sensor.water_pulse_meter
indicates correctly the current water consumption in liters per minute. Also the integration in the Energy dashboard based on the sensor sensor.water_meter_total
works fine. I could see today the total consumption of yesterday.
When I check the history of the first created sensor sensor.water_pulse
created by ESP Home it always shows 0:
Could someone explain me why I have correct reading for sensor
sensor.water_meter_total
and no data for sensor.water_pulse
while both are using the same GPIO4.I’m also wondering the purpose of sensor.water_pulse…