How to plot a null line in a chart?

Hello!

I would like to draw a null line in this chart - see mock-up in green. I understand that I need to decide to which y-axis to align it (primary or secondary), but I utterly fail to find out how to draw it at all.

grafik

I am not sure whether it matters that I use the custom:mini-graph-card (HACS) but hope to get some general idea how this can be accomplished. See my YAML:

type: custom:mini-graph-card
title: Mythz_Plot2_HC1Offset_Integral
hours_to_show: 24
hour24: true
height: 200
line_width: 2
decimals: 1
show:
  icon: false
  name: true
  state: true
  labels: true
  labels_secondary: true
entities:
  - entity: sensor.mythz_heatsettemp_heattemp
    name: HC1_Ist - HC1_Soll
    unit: K
    color: '#6666ff'
  - entity: sensor.mythz_integralheat
    name: Integralwert
    unit: Kmin
    color: '#ff6666'
    y_axis: secondary

Can you please provide me with some hints? E.g., do I have to create some kind of a “dummy” sensor or helper that always has the value of zero?

Thank you so much for your help! :heart:

Creating a template sensor that is always zero would be the easiest way to go. You can create these on the Helpers tab. The template would be

{{ 0 }}
1 Like

Hi,

I had a quick look at the documentation (GitHub - kalkih/mini-graph-card: Minimalistic graph card for Home Assistant Lovelace UI), but did not find anything, that would be helpful.

I would create a helper (-> number) and set it to zero.

(please note: there is a difference in the German “Null” ( → figure 0 ) and the English “null” in programming. The English page for this in Wikipedia is not helpful, have a look at the German one: Nullwert – Wikipedia)

Chris

1 Like

Thanks! In fact I meant zero (not a null value from programming). However, when I go to helpers and add a number (or try doing so), it tells me that there must be a difference between minimum and maximum etc. I cannot set it to zero, it seems - unless I misunderstand something about it. Besides, it offers me the option for a slider or an entry field. But where can I simply say this should be constantly zero? Any further hints?

PS:
The red message (that denies me entering zero twice for minimum and maximum) says:

value must be at least 1e-09 for dictionary value @ data[‘step’]. Got 0

Hi @7wells,

oh, I never actually used a “Number”. I thought… well, never mind.

Take a Template Helper and put in, what @atlflyer provided. full credits to him/her. :slight_smile:
grafik

1 Like

Ah, thank you, too! :heart:
I realize that fiddling on this forum by mobile phone is really not good - as I obviously missed this post of yours, sorry!

Perfect, works like a charm! :blush:
Thank you both, @atlflyer and @schneich :+1: