@schmucke There are various plugins (emon/volkszähler/smartmeter, etc) which implement this kind of functionality (in most cases combined with a another building block to facilitate the data logging and accumulation into different registers). It is possible to implement such functionality as a generic building block into pimatic but it is a fair amount of work.
For the time being my suggestion is to have a look at Volkzähler. It should be possible to use it along with espeasy as far as I understand this.
http://wiki.volkszaehler.org/
http://wiki.volkszaehler.org/hardware/controllers/espeasy
https://pimatic.org/plugins/pimatic-volkszaehler/