I have several accumulating quantities like rain_today or energy from the smart meter which either reset after a period (each day, week, month) or count indefinitely.
With these now I would like draw graphs (in a sitemap without additional tools like grafana) over time to see rainfall on 1st each day and 2nd week, month. All with an optimized persistence such that only one value per day is stored (using mysql as backend) - which for sure is the max(day) of the initial item.
I cannot believe that I am the first trying to solve this issue but I didn’t find any existing solution
Assuming you have persistence that is not MapDB see the Chart element for sitemaps. But that’s going to be a line graph and not a bar chart which is probably more appropriate if all you care about is two data points.
not as forecast as in this screenshot and it would be perfectly fine to have the bar graph for the rain separately from the temperature line graphs (which work perfectly already in my charts)
The closest thing that looks feasible for plotting would be to have the maximum of my existing (accumulative rain gauge value) of the day stored in mysql with a timestamp of 0:00 and 23:59:59 each day and use a line plot. While the one at the end of day is no big challlenge in a rule I fear I’d need to to some external script to copy it to the beginning of the day, right?
Last but not least the current day is also interesting, so during the day somehow it would be cool to have the maximum till now in these two (start-of-day and now) data points.
Maybe best is to automatically persist every 5 minutes and in a cron-job delete all but the current maximum and additionally copy this to the time stamp 0:00h of the current day? Anyone having a script around for that?
That’s a pity. I have a mix of file based configuration and PaperUI today in OH2 and I sweared I will not configure anything in the UI next time - and the transition to OH3 would be the perfect fit for a configuration from scratch
Ok, this is where I look but it is quite unclear to me what applies to OH2 and what to OH3, what will be deprecated in future.
PaperUI does indeed really suck. But MainUI does not. You are probably doing yourself a disservice by not at least reviewing how MainUI works. Because, unlike PaperUI, it actually does work. I used to only do Things through PaperUI and text for everything else. I’m now moving everything, including my Rules, to the UI. And yes, I still maintain everything in a git repo and have history and version control and all that.
This might be true, but if I read between your lines it seems, that e. g. the chart functionality in the sitemaps is at least not what is recommended with OH3. Whether the new MainUI (I guess this is the name of the OH3-UI) is better I cannot really judge so far. I had tried it and I failed to configure charts until I watched the video of the virtual meetup as I tried to add the chart as an “element” in the page and did not expect that I need to create a new page of type chart… At least it was not intuitive for me using it the first time.
Thanks for the hint, I’ll give it a try as soon as I have persistence setup properly in my OH3 test env. If my problem above is solvable directly in OH3 charts it would be clearly my preferred solution - even if I would directly violate my “everything in text files” rule