I would like to utilize the Rest API for getting persistence historic data. I want to build a Widget where I can show power usage today, this week, this year ext. I could do this by creating dedicated items for this and create a rule that fills that items but I wont have historic data as this would start of today and, as we have this data already in persistence it seems logical to just get that data from the Rest API.
I could use the
Can this somehow be done? Perhaps with lazy loading some functions which you can use in the custom widgets?
component: oh-label-card config: title: Power meter test label: =fetch('/rest/persistence/items/<the_item>?starttime=2023-01-01&page=1&pagelength=1').then(response => response.json()).then(data => console.log(data.data.state))
Thanks in advance!