Water usage sensor

Most examples show, and I believe the pulse counter default, is to report liters per minute, but I wanted gallons per hour. My meter documentation provided the flow rate in pulses per gallon, so the * 60 converts it from per minute to per hour. @DeeBeeKay has an example here that shows this.

Once you think you have it working do a test by filling a liter or gallon bottle with water and see if it closely matches what’s being reported. I first started out with a different meter that I used only for an outside yard irrigation valve where I didn’t know what the pulse per liter/gallon was. I kept testing with a 1 gallon jug until I got it reporting accurately. Amazingly, it resulted in using a value of 2775 before it was accurate as tested against actual measurements.

sensor:
  - platform: pulse_counter
    name: "Water Meter Flow Rate"
    id: water_meter_flow_rate
    pin: GPIO5
    update_interval: 5s
    filters:
     - lambda: return (x / 2775) * 60.0;
    unit_of_measurement: "gal/hr"
    accuracy_decimals: 1