Hmm, I’m not getting any pulses. Two questions, did you keep the same wiring diagram as the original blog post? And also, I have a plexiglass cap on my meter which stops me from getting right up against it. Is this similar for everyone?
I managed to fix this. It’s because the same pin is defined twice for two sensors. Only the latter sensor definition will work. platform: copy
is the solution, but a template sensor should also work. See two sensors with same input not work with latest firmware · Issue #3364 · esphome/issues · GitHub.
I also cleaned up the code a bit, I can now see both usage in litres and meter reading in cubic meters:
sensor:
- platform: pulse_counter
pin: GPIO14
id: water_flow_rate
name: "Water Flow Rate"
update_interval : 60s
accuracy_decimals: 1
unit_of_measurement: "l/min"
icon: "mdi:water"
- platform: pulse_meter
pin: GPIO14
internal: true
id: water_pulse_meter
total:
id: water_usage_total
icon: "mdi:water"
name: "Water Usage Total"
unit_of_measurement: "litres"
accuracy_decimals: 0
device_class: water
state_class: total_increasing
- platform: copy
source_id: water_usage_total
id: water_meter_total
name: "Water Meter Total"
icon: "mdi:water"
unit_of_measurement: "m³"
accuracy_decimals: 3
device_class: water
state_class: total_increasing
filters:
- multiply: 0.001
2 Likes