Solution found - Calculate variable and save in item

Hi @ all,

I’m using Openhab from latest Docker-Image on Ubuntu 20.04 and I’m absolutely new to this.
I’ve started because I want to show the values of my photovoltaic system.
Therefore I created a Standard-Site with normal cards and it works fine.

Now I wonder if it is possible to save a calculated value in an item so that I can then display this value as a card (oh-label-card).
Specifically, it is about the current daily power consumption. Unfortunately I only have the total value of the electricity meter as an item, i.e. I would have to store the first value at 00:00 o’clock (is stored as persistant in a MariaDB anyway) in a variable and then subtract this value from the current meter reading item and store it as a new value in another item that I can then display as a oh-label-card…
So I have the consumption per day and can also store it in the MariaDB (Persistant)
Is something like this possible? Or is there another/better possibility?
Many thanks and best regards

Mr Mister

Related

A few hours after my posting I found some Information that helped me

=> https://zukunftathome.de/stromzaehler-und-aktuellen-stromverbrauch-in-openhab-darstellen/

In German, but now I have the values that I want.

Hint: This post is for OpenHab 2.x, in OpenHab 3.x the timestamps are different

=> Migrate JodaTime to Java LocalDateTime in OH3 (withTimeAtStartOfDay) - #5 by MrSebi

Thank you