Count pulses and store in influxdb (energymeter with IR sensor)

Hi,

I would like to store and visualize pulses that are generated by an IR sensor. It is reading my energy meter (rotating disk with a an optical marking).
I have an wemos d1 mini (esp8266) and a TRCT5000 optical sensor. Reading and sending the pulse data over mqtt to HA is working, als the integration with influxdb is working.

My goal is to store each pulse, so each datapoint is basically a timestamp with value 1. Each pulse is 1/420kWh. My idea is that you can use this to create the calculations and visualizations (count pulses per timeframe and use the 1/420kWh constant).

The solutions I found are based on the kWh and Watt data per timeframe, which is calculated in the sensor and send to HA, however I can’t seem to find a solution for the setup I am trying to achieve.

I hope someone can help me with this, thanks!