Improving pulse meter sensor

Sorry if this is in wrong forum, i really do not know what is right place to ask…

I installed “home assistant glow” node in my electricity meter today. On high loads measurements seems to be “spikey”, picture attached below. Measurements are between 13139W and 13091W.
My energy meter has 1000 pulses/kWh, and i calculated that 19139W gives pulses every 273,9934546ms and 13091W in 274,9980903ms.

It seems that pulse_meter_sensor has resolution of about 1ms.

I am not coder, but in github esphome i found that
pulse_meter_sensor.cpp

has this code:

  // We quantize our pulse widths to 1 ms to avoid unnecessary jitter
  const uint32_t pulse_width_ms = this->pulse_width_us_ / 1000;
  if (this->pulse_width_dedupe_.next(pulse_width_ms)) {
    if (pulse_width_ms == 0) {
      // Treat 0 pulse width as 0 pulses/min (normally because we've not detected any pulses for a while)
      this->publish_state(0);
    } else {
      // Calculate pulses/min from the pulse width in ms
      this->publish_state((60.0f * 1000.0f) / pulse_width_ms);

Is there reason for reducing resolution? And how could i test changing that for example to 100us?

You can try using internal_filter.
My config:

- platform: pulse_meter
    id: energy_pulse_meter
    name: '${human_name} actual power'
    unit_of_measurement: 'W'
    state_class: measurement
    device_class: power
    icon: mdi:flash-outline
    accuracy_decimals: 0
    pin: ${pulse_pin}
    internal_filter: 50ms
    filters:
      # multiply value = (60 / imp value) * 1000
      # - multiply: 60
      - lambda: return x * ((60.0 / ${pulse_rate}) * 1000.0);

I have tried internal_filter, it does not do anything. The problem is not that i have false pulses (bounceback).

I think that problem is that pulse widths are rounded to 1ms resolution. It is not big thing in small power, but when power is higher, resolution drops.

For meter with 1000imp/kWh 1ms difference in pulse width in different power levels are:
100W 2,8mW/1ms
1kW 278mW/1ms
10kW 27,7W/1ms
15kW 62,2W/1ms

And i have meter that gives 1000imp/kWh, there are meters that output 10000pulses/kWh, for those 1ms@10kW is 270W.