Secondary axis on charts for displaying temperature and humidity in one chart


Is it possible to create a chart which has a primary and secondary Y-axis and a common X-axis? I would like to show both temperature and humidity (from a DHT22 sensor) on one chart. Here are my relevant items:


Group chart_home

Number esp_dht22_t "Temperature [%.1f °F]" <temperature> (Living, chart_home) {mqtt="<[mymosquitto:LV_temp:state:default]"}
Number esp_dht22_h "Humidity [%.1f %%]" <humidity> (Living, chart_home) {mqtt="<[mymosquitto:LV_humid:state:default]"}


Chart item=chart_home period=W refresh=30000 visibility=[Temp_Chart_Period==2]

This displays the top chart:

Obviously, the top chart is not ideal, since the scale does not show me the relevant features of each data series. I am looking for something more like the bottom chart. Notice how the temperature scale on the left is scaled differently than the humidity scale on the right. (Blue is temperature, red is humidity. Sorry, the legends overlapped).

Is there a way to achieve this with the default charting?

You can’t achieve this with the default charting.

Thanks for the reply. What would be the next step to implement a secondary axis?

Implement a new charting servlet or some other external server that queries the DB and builds the chart.

You might look into Habmin2 which has some more advanced charting capabilities. You also might consider looking at what is available for the other persistence engines. For example, I bet InfluxDB has a lot of charting tools that work with it.

I do this with habmin charts for my temperature and humidity chart

I’ve the same problem. How did you solve it? Thanks

Hi there.

I never did solve this. My suggestion would be to make two charts over the same time interval and place them top-to-bottom so you can view the time series simultaneously. Not as useful as having a secondary axis, but it might get the job done.

Otherwise, do what @rlkoshak suggested and use a 3rd party charting software.

Have a look at:

I followed the tutorials and now I have for example:

Many thanks at all for the answer.
In a first moment I tried to install influxDB following that tutorial, but I’m a newbie and it’s quiet hard so I thougth to follow a simpler road. I’ll try again.