Hardware setup for water meter pulse output

The municipality installed today a new water meter with pulse output. Before I start to connect my ESPHome device, I would like to verify the hardware setup to avoid any possible damages caused. I have little skills for the electronics here.

Water meter device: Axioma F1/IP65
Max load current: 20 mA
Max voltage: 50V
Pulse length: 125 ms
Pulses per litre: 1

Planned setup
+Pulse → D2 (GPIO04)

ESPHome configuration:

  - platform: pulse_counter
      number: GPIO04
      inverted: true
        input: true
        pullup: true
     unit_of_measurement: 'l/min'


  • Can I connect PINs directly as above or do I to add a separate power source with a pullup resistor as seen in the diagram below
  • Any other problems with the above setup