Python OpenHAB Charts (Pyohc) for advanced

I found the charting capabilities of OpenHAB a bit lacking and slow when accessing them. So I wrote a Python module that can access the OpenHab Mysql Persistence database and render charts using Pygal.

Some highlight features:

  • Multi-series support
  • Multi-axis support
  • Line charts, bar graphs etc etc
  • Quite flexible query generation, with some pre-defined constants to filter, group by and aggregate for common use-cases
  • Can be easily implemented in sitemaps using the Image element
  • Pre-rendered, so the UI doesn’t have to wait for the graph. Can be rendered from cronjobs for example.

Not done with writing documentation, but maybe people already have feedback. Code is available here:

Small example of the solar production in KW during the day. Red=today, Pink=yesterday, green is the max values within the last 20 days, blue is the 20 day average.

1 Like

You could even use HABApp to run your functions, so you wouldn’t even have to setup a cronjob.