How to get uniform graphs from items and influxdb data?

  • Platform information:
    • Hardware: Orangepi 3 LTS
    • OS: Armbian 23.02.2 Bullseye Kernel 5.15.93
    • Java Runtime Environment: Zulu 11.43+100
    • openHAB version: 3.4.2

I am using the earth source heat pump control code developed by @masipila and also the graph he has developed. The control code uses a Tasmota relay to allow my heat pump to only run when electricity price is low. The code works and my electricity bill is saving me money.

However, I would like to monitor what is going on with the heat pump and the control system. I have three items I would like to graph a) the control provided by @masipila’s code, b) the tasmota relay and c) the heat pump motor. I can read a) from influxdb and b) and c) from mqtt and influxdb. However, I am not able to graph these nicely. In the graph below I have electricity price, forecasted windspeed, temperature and cloudiness, heat pump control graphed. Relay and motor are missing from this first graph.

I have managed to add relay state and heat pump motor to the graph like so:

As one can see, the relay and heat pump motor state bars extend all the way from bottom to top. I would like them to behave like the shorter yellow control signal bar. I do not understand OH graphing well enough to get this to work. I would appreciate help on how to get this working correct.

Here is my code:

config:
  chartType: day
  label: Spotsähkön hinta ja ohjaus II
  order: "-15"
  sidebar: true
slots:
  grid:
    - component: oh-chart-grid
      config: {}
  legend:
    - component: oh-chart-legend
      config:
        orient: horizontal
        show: true
  series:
    - component: oh-time-series
      config:
        areaStyle:
          opacity: "0.4"
        gridIndex: 0
        item: spot_price
        markLine:
          data:
            - label:
                distance: -150
              name: Avg
              type: average
        name: Sähkön tuntihinta
        step: middle
        type: line
        xAxisIndex: 0
        yAxisIndex: 0
    - component: oh-time-series
      config:
        gridIndex: 0
        item: fmi_forecast_temperature
        markLine:
          data:
            - label:
                distance: -100
              name: Avg
              type: average
        name: Sääennuste
        type: line
        xAxisIndex: 0
        yAxisIndex: 1
    - component: oh-time-series
      config:
        areaStyle: {}
        gridIndex: 0
        name: Nibe 1245 Status
        type: line
        xAxisIndex: 0
        yAxisIndex: 2
      slots:
        markArea:
          - component: oh-mark-area
            config:
              item: Nibe1245Sensor
              name: Nibe1245Sensor
              service: influxdb
              stack: foo
              type: bar
    - component: oh-time-series
      config:
        areaStyle:
          opacity: "0.4"
        gridIndex: 0
        name: Nibe 1245 Rele
        service: influxdb
        step: middle
        type: line
        xAxisIndex: 0
        yAxisIndex: 2
      slots:
        markArea:
          - component: oh-time-series
            config:
              item: Lampopumpun_ohjaus_Nibe1245_rele
              name: Lampopumpun_ohjaus_Nibe1245_rele
    - component: oh-time-series
      config:
        areaStyle:
          opacity: "0.4"
        color: orange
        gridIndex: 0
        item: nibe_control
        name: Ohjaus
        step: middle
        type: line
        xAxisIndex: 0
        yAxisIndex: 2
    - component: oh-time-series
      config:
        gridIndex: 0
        item: fmi_forecast_WindSpeedMS
        markLine:
          data:
            - label:
                distance: -100
              name: Avg
              type: average
        name: Tuuliennuste
        type: line
        xAxisIndex: 0
        yAxisIndex: 1
    - component: oh-time-series
      config:
        gridIndex: 0
        item: fmi_forecast_TotalCloudCover
        markLine:
          data:
            - label:
                distance: -100
              name: Avg
              type: average
        name: Pilvisyys
        type: line
        xAxisIndex: 0
        yAxisIndex: 1
    - component: oh-time-series
      config:
        gridIndex: 0
        item: aaroninHuoneenAnturi
        name: Aaronin MH lämpötila
        type: line
        xAxisIndex: 0
        yAxisIndex: 1
  tooltip:
    - component: oh-chart-tooltip
      config:
        orient: horizontal
        show: true
  xAxis:
    - component: oh-time-axis
      config:
        gridIndex: 0
  yAxis:
    - component: oh-value-axis
      config:
        gridIndex: 0
    - component: oh-value-axis
      config:
        gridIndex: 0
        splitLine:
          show: false
    - component: oh-value-axis
      config:
        gridIndex: 0
        max: "5"
        min: "0"
        show: false

You need to play with different y axis. You already seem to have multiple of them. So different series (different measurements) can have different scales if you have different y axis.

In the y axis configuration you can force the min and max of the scale. This way you can guarantee that the bar is not going all the way to the top if that was the correct interpretation of your problem statement.

After playing with the Y-axes I found out my relay and motor statuses are “ON” and “OFF”, not 1 and 0 as in the nibe_control. This needs a bit more work, which after a couple of hours seems fairly difficult. How do I display On and Off values as 1 and 0 on a numerical Y-axis in graphs?

It might be as simple as linking a new item of type Number to your ON/OFF channel:

2 Likes

That did the trick!