ESP Home - mulitple sensor on same GPIO

Following Brinkman’s water usage sensor setup on a NodeMCU 8266 and ESP home.

I can make all sensors work, but only one at a time.
Given all the working examples of this setup it should work.
Anyone who can tell why this don’t work?

No errors. Just reporting 0

sensor:

- platform: pulse_counter
  pin: GPIO12
  update_interval : 5s
  name: "water pulse"
  id: water_pulse

- platform: pulse_meter
  pin: GPIO12
  name: "Water Pulse Meter"
  unit_of_measurement: "liter/min"
  icon: "mdi:water"
  total:
    name: "Water Total"
    unit_of_measurement: "liter"

- platform: pulse_meter
  pin: GPIO12
  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

Output from ESPHome:

[16:01:09][D][pulse_counter:174]: 'water pulse': Retrieved counter: 0.00 pulses/min
[16:01:09][D][sensor:093]: 'water pulse': Sending state 0.00000 pulses/min with 2 decimals of accuracy
[16:01:09][D][sensor:093]: 'Water Meter Total': Sending state 0.28800 m³ with 3 decimals of accuracy
[16:01:09][D][sensor:093]: 'Water Pulse Meter': Sending state 394.10419 liter/min with 2 decimals of accuracy
[16:01:09][D][sensor:093]: 'Water Meter Total': Sending state 0.28900 m³ with 3 decimals of accuracy
[16:01:09][D][sensor:093]: 'Water Pulse Meter': Sending state 377.81235 liter/min with 2 decimals of accuracy
[16:01:09][D][sensor:093]: 'Water Meter Total': Sending state 0.29000 m³ with 3 decimals of accuracy
[16:01:09][D][sensor:093]: 'Water Pulse Meter': Sending state 347.88257 liter/min with 2 decimals of accuracy
[16:01:09][D][sensor:093]: 'Water Meter Total': Sending state 0.29100 m³ with 3 decimals of accuracy
[16:01:09][D][sensor:093]: 'Water Pulse Meter': Sending state 341.47952 liter/min with 2 decimals of accuracy
[16:01:10][D][sensor:093]: 'Water Meter Total': Sending state 0.29200 m³ with 3 decimals of accuracy

I dont see the problem here. You are getting the flow rate and a running total of liters used based on that flow rate. The number of pulses is only relevant for part of the equation to calculate flow rate and total. Its not really meant to be a sensor itself just used to create a sensor.

1 Like

Are you at least getting accurate rate and volume totals? You can use a 2-liter bottle or 1gal jug to calibrate it

1 Like

If I add an entity card and show the state of all these sensors, they all display 0.
Except for the last one in ESPhome. If I comment out sensors, and only have one at a time, I get their state on the card.

In configuration.yaml i also have a utilitymeter that don’t give anything.

utility_meter:
  util_water_usage_hourly:
    source: sensor.water_total
    cycle: hourly
  util_water_usage_daily:
    source: sensor.water_total
    cycle: daily
  util_water_usage_monthly:
    source: sensor.water_total
    cycle: monthly
  util_water_usage_yearly:
    source: sensor.water_total
    cycle: yearly

Yes, I get correct flow. And 75 pulses give one L

Numbers are correct. And utility meter don’t seem to work.

I stumbled upon this post Water usage sensor - #22 by rasika by @rasika
It was more or less the same problem.
Now I can try to make my numbers correct.

Thanks

New code:

sensor:
- platform: pulse_counter
  pin: GPIO12
  update_interval : 60s
  name: "water pulse"
  id: water_pulse

- platform: pulse_meter
  pin: GPIO12
  name: "Water Pulse Meter"
  unit_of_measurement: "liter/min"
  icon: "mdi:water"
  total:
    name: "Water Total"
    id: water_total
    unit_of_measurement: "liter"

- platform: copy
  source_id: water_total
  name: "Water Meter Total"
  icon: "mdi:water"
  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 / 75);
  update_interval: 6s`