Solar Production Visualization with openHAB and rrd4j

Hello, I’m a new user to the openHAB community and I’m currently exploring how to visualize my solar production data. I’m using a Hoymiles HM-1500 solar inverter and reading various channels via MQTT. The inverter provides two key channels: yield total (an ever-increasing value) and yield day (which resets daily when the inverter starts).

I’ve managed to set up a daily solar production chart using the month chart type, which displays the daily yield across the days of the month. Here’s the configuration I used:

yaml
chartType: month
label: Solar Yield - Day of Month
sidebar: true
slots:
grid:
- component: oh-chart-grid
config:
show: true
- component: oh-category-axis
config:
categoryType: month
monthFormat: default
weekdayFormat: default
- component: oh-value-axis
config:
gridIndex: 0
name: kWh
- component: oh-aggregate-series
config:
gridIndex: 0
xAxisIndex: 0
yAxisIndex: 0
type: bar
item: HM1500_HM1500_YieldDay
aggregationFunction: last
dimension1: date
name: kW/h pro Tag
- component: oh-aggregate-series
config:
name: Letzter Monat
gridIndex: 0
xAxisIndex: 0
yAxisIndex: 0
type: line
item: HM1500_HM1500_YieldDay
dimension1: date
offsetAmount: 1
offsetUnit: month
aggregationFunction: last
- component: oh-chart-legend
config:
show: true
orient: horizontal
- component: oh-chart-tooltip
config:
show: true
orient: vertical

This setup allows me to track daily solar production effectively. However, I’m looking to expand this visualization further. My next goal is to create two additional charts:

  1. Monthly Production Chart: This chart should display the monthly power production on a yearly basis. Similar to the daily chart, I’d like to have bars for the current year and a line for last year. The x-axis should show the months (January, February, etc.), and the y-axis should represent the power production. To achieve this, I need to calculate the delta for each month by subtracting the previous month’s total from the current month’s total. For example, if the yield total was 106 kWh on July 1st, 199 kWh on August 1st, and 374 kWh on September 1st, the bars should display 106 kWh for June, 93 kWh for July, and 175 kWh for August.

  2. Annual Production Chart: This chart should be a bar chart where each bar represents a whole year. Ideally, it would show up to the last 5 or 10 years, with the oldest year dropping off the chart after the 11th year. This would provide a long-term overview of solar production trends.

I’m confident that with the right guidance, I can achieve these visualizations. If anyone has experience with similar setups or can provide tips on how to structure the data aggregation for these charts, I’d greatly appreciate your input! Thanks in advance for your help.