Lovelace: mini graph card

I would simply avoid to mix all those together cause what you want is visible on the footer I guess, the kWh consumption graph by date , right ?

I have done these the past days that are based on the power metering utility or ingeration that resets the hourly, daily, weekly monthly counters when it is time.

You might try this one out, which will give you a daily graph.
you have to adjust lower and upper bound (kWh s in this case)

type: 'custom:mini-graph-card'
name: 14 days - kWh
smoothing: false
hours_to_show: 240
points_per_hour: 1
line_width: 2
line_color: orange
animate: true
height: 80
entities:
  - sensor.kwh_0_2_daily
font_size: 70
show:
  graph: bar
  points: true
  icon: true
  labels: true
  average: false
group_by: date
aggregate_func: max
decimals: 3
lower_bound: 1
upper_bound: 2

Will give you such graph:
image

Not supposed to be used as a footer or header.

1 Like

…Previously worked. But partial works

Only stock graph may be used for header & footer with ONE sensor defined by the “entity:” option.
There is no "entity" option for "mini-graph-card", so there is an error:

I hear what you’re saying, and I see the docs. Just wanted to mention that this works for me on 2021.5.5. I suppose it will break now when I upgrade my HA instance.

      - type: entities
        title: Electricity Consumption
        show_header_toggle: false
        entities:
          - entity: sensor.daily_power_consumption
            name: Today
            icon: mdi:power-plug
          - entity: sensor.monthly_power_consumption
            name: This Month
            icon: mdi:power-plug
          - entity: sensor.monthly_power_consumption_forecast
            name: This Month's Forecast
            icon: mdi:trending-up
        footer:
          type: custom:mini-graph-card
          entities:
            - entity: sensor.current_power
          hours_to_show: 24
          hour24: true
          smoothing: true
          points_per_hour: 12 
          line_width: 2
          line_color: var(--custom-graph-color-red)
          show:
            extrema: true
            name: false
            icon: false
            average: true
            state: true

(See the above config, @typxxi.)

almost ashamed to ask, for this must be way too simple, but it honestly is my first graph with a secondary y-axis…

could somebody please throw me a quick pointer where I can find the options to set the secondary y-axis?

my solar would go from 0- 6000 watt, and the cloud coverage from 0- 100% …

  - type: custom:mini-graph-card
    name: Zon & Wolk
    entities:
      - entity: sensor.zp_actuele_opbrengst
        name: Opbrengst
      - entity: sensor.weatherbit_cloud_coverage
        name: Bewolking
        show_line: true
        show_points: true
        show_legend: true
        y_axis: secondary
    show:
      labels: true
      labels_secondary: true
    upper_bound_secondary: 100

is incorrect obviously:

thanks…

Marius, hi.
Check this.

type: custom:mini-graph-card
name: Zon & Wolk
entities:
  - entity: sensor.cleargrass_1_co2
    name: CO2
    color: green
  - entity: sensor.battery_life360_ildar
    name: Charge
    color: red
    show_points: true
    show_legend: true
    y_axis: secondary
show:
  labels: true
  legend: true
  name: true
  icon: false
  labels_secondary: true
hours_to_show: 24
points_per_hour: 60
line_width: 2
height: 200
lower_bound: 0
lower_bound_secondary: 0
upper_bound_secondary: 100

изображение
The lower_bound_secondary: 0 could be your point.

a yes, I took those for default… adding them makes this:

  - type: custom:mini-graph-card
    name: Zon & Wolk
    entities:
      - entity: sensor.zp_actuele_opbrengst
        name: Opbrengst
        color: gold
      - entity: sensor.weatherbit_cloud_coverage
        name: Bewolking
        color: grey
        show_line: true
        show_points: true
        show_legend: true
        y_axis: secondary
    show:
      labels: true
      labels_secondary: true
    lower_bound: 0
    lower_bound_secondary: 0
    upper_bound_secondary: 100

and

only started recording the cloud coverage sensors since this afternoon, so not sure yet if this is the right one to use, but the graph is better now.,
thanks!

Hi gents
Any idea why this is not working

type: custom:mini-graph-card
name: Watering Last 7 Days
icon: mdi:sprinkler-variant
entities:
  - entity: binary_sensor.irrigation_unlimited_c1_z1
    attribute: today_total
  - entity: binary_sensor.irrigation_unlimited_c1_z2
    attribute: today_total
show:
  graph: bar
  labels: true
unit: min
aggregate_func: max
hours_to_show: 168
group_by: date
lower_bound: 0

I think that you messed up the things - binary sensor have just 2 states - true / false and doesn’t have attributes (attributes are feature of devices).

Be inclusive.

Attributes aren’t supported — it’s not a documented feature. You need to create a template sensor to extract the attributes into its own sensor (it’s been asked several times on this thread).

1 Like

According to Github, attributes are added to dev version; we are waiting for release version; and probably anyway I gonna stay with template sensors & availability checks…

2 Likes

No, you can create a template binary sensor with attributes.

Is there any way to have a graph from a sensor, but also draw in the same graph a horizintal line with a value. The scope is clearly see if we are below or above a certain treshold (horizintal line). THX!

You can add the 2nd graph for a template sensor which is = threshold value.
Kind of this (here the red line is for zero):
image

any way to change this icon according to the status?
For example, off icon A, on icon B
2021-08-28 13_01_13-Window

  1. to replace the icon - use config-template-card
  2. to change the icon’s size or color - use card-mod

any doc about this? How use, example, variables?

config-template-card - read community forum (use search) as well as official docs on GitHub (there is a link to the docs on the 1st post in the corresponding forum’s thread

card-mod - search for my post in this thread with examples

Nice, i’ll search, tks bro.