Help Water Water Meter Math

Hi All,

I’ve adjusted my code following the classic Pieter Brinkman code and the edits within the comments section on this forum regarding his water meter walk though.

I seem to be having, from what I can tell, a math problem! When running a bath, I am seeing 0.000’s across the ESPHome logs screen, it doesn’t seem to be picking up any values.

In previous iterations of this code, I was detecting pulses on GPIO4 on the NodeMCU ESP8266- so I feel that this is a code/math issue.

My meter produces a pulse for every 1/100 of a ft3, and thus I’m multiplying by 0.000283 to get to m3.

Can anyone help out and understand whats going on why Im getting no info our of ESPhome?

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 Meter Total"
    unit_of_measurement: "m³"
    id: water_meter_total
    accuracy_decimals: 3
    device_class: water
    state_class: total_increasing
    filters:
      - multiply: 0.00028316846592    
    
- platform: template
  name: "Water Usage Liter"
  id: water_flow_rate
  accuracy_decimals: 2
  unit_of_measurement: "l/min"
  icon: "mdi:water"
  lambda: return (id(water_pulse).state * 10);
  update_interval: 6s
  device_class: water   

Any help or suggestions here?

Why are you running two sensor platforms on GPIO4?

I don’t think you can do that. Please correct me

For fault finding use one platform and ignore the maths just check that you are picking up a pulse. I can’t see a pulse being shown in the logs

If you want to do more than one thing on a sensor I use templates and I understand that copy integration works. I may have misunderstood your code