esphome: name: watermeter friendly_name: "Water meter" area: "Laundry" project: name: dasfoo.watermeter version: "1.0" packages: device_base: !include templates/esp8266.yaml sensor: !include templates/esp8266-vcc.yaml sensor: - platform: pulse_meter # Our meter (USLF20) is rated Q3=4.0 (m3/h). # The official one is rated 5.0 (assuming also Q3). # There's no Q4 value available. # # 3600 / 5000 = 0.72 seconds per liter. That's the shortest # pulse length at a normal flow rate for the meter. Assuming # 5x worst case, take 100ms as a reasonable margin. internal_filter: 100ms # Assuming Q1=70 (l/h), a flow with 52 second between pulses # is beyond the measuring capabilities. timeout: 1min pin: number: D2 inverted: true mode: input: true pullup: true name: "Incoming water flow" unit_of_measurement: "L/min" state_class: "measurement" total: name: "Incoming water total" unit_of_measurement: "L" device_class: "water" state_class: "total_increasing"