Calculate consumed energy since a specific date

Hello,
I integrated a Siemens PAC2200 with Modbus TCP to track my import & export comsumption.
I also have SMA inverters integrated with the platform.

Everything is working great but I’d like to add a function to track my electric comsumption.
My electricity provider annually ask me the index of the counter to make the bill.

I’d like to make a variable, somewhere to encode the date which is the last time they ask me, for example this year it was the 30 october 2022

I’d like to make a sensor which will sum my import and remove the export comsumption from this date to now, to have an idea of what I use on the grid since my last bill.

How can I achieve that? I need some advices :slightly_smiling_face:

Kind regards

1 Like

Nobody can help me ?
To be clearer, I’d like to sum “net consumed from the grid” value from a specific date.
With the energyboard, it’s possible to show per day / month / year etc… so I presume that this value is somewhere?

Thanks!

Would you mind sharing the yaml code you have to read data from the pac2200? I’m using

      data_type: float32
      count: 2
      offset: 1

but HA does not accept count with float32 .