Pulse_counter via serial

Hi there,

can someone please give me a hand editing configuration.yaml?

I have a power meter in the basement which works fine with pulse_meter on ESPhome when i temporarily bring WiFi there.

I’d prefer to not bring WiFi there but link an ATTiny to my serial interface which simply sends “ping” to the home-assistant host whenever the power meter pulses.

I found a few threads in the community here recommending to add the serial device to configuration.yaml
sensor:

  - platform: serial
    serial_port: /dev/ttyUSB0
    baud_rate: 9600

How can I treat incoming messages as an event for pulse_meter now?
There is nothing to parse hence

- trigger:
  - platform: state
    entity_id: sensor.serial_sensor
  action:
  - service: counter.increment
    entity_id: counter.serial_counter

wouldn’t work.

Any recommendation how I can get the serial pulses into sth like that:

  - platform: pulse_counter
    pin: D5
    name: 'FuseBox2 current power consumption'
    id: fusebox2_pulse
    unit_of_measurement: 'kW'
    filters:
      - multiply: 0.01  # (100/1000 pulses per kWh)

    total:
      unit_of_measurement: 'kWh'
      name: 'FuseBox2 Meter Summary'
      filters:
        - multiply: 0.01  # (100/1000 pulses per kWh)

Thanks and best regards,
Itchy