Fronius Smart Meter - How to Read the Saved Values by timestamp

Dear Community,

i have created a rule with ECMAScript (ECMA - 262 Edition 5.1).

My current script:

var logger = Java.type('org.slf4j.LoggerFactory').getLogger('org.openhab.rule.' + ctx.ruleUID);
SMconsumed = itemRegistry.getItem('FroniusSmartMeter_RealEnergyConsumed').getState();
SMproduced= itemRegistry.getItem('FroniusSmartMeter_RealEnergyProduced').getState();'SMconsumed: ' + (SMconsumed/1000)+ ' kWh');'SMproduced: ' + (SMproduced/1000)+ ' kWh');

Now i want display the daily comsumed-produced kWh for each day in the “Overview (Dashboard)”".

can anybody tells me how i can do that? it seems that the smart meter does the read out all 5-15 Seconds. But now i need to grap the first entry from today (e.g. 24.02.2023 00:00:00 to current time). i want then create text like “today produced, today consumed”, and the same for last week / month…

thank you so much