Lovelace: mini graph card

So it works?

Yes with the default dashbord:

Your ui-yaml does not have a view.

Hereā€™s an example

title: My Awesome Home
views:
    # View tab title.
  - title: Example
    cards:
        # The markdown card will render markdown text.
      - type: markdown
        title: Lovelace
        content: >
          Welcome to your **Lovelace UI**.

See: https://www.home-assistant.io/lovelace/dashboards-and-views/#adding-more-dashboards-with-yaml

Hi. Loving the card :slight_smile: Is it possible to use the aggregate functions with a period shorter than day? For example group by date and hour then plot hours?

Oops, should learn to read :confused: Groupby Interval and PointsPerHour as <1. This thing is so clever.

@kalkih
Thank you for this awesome card I have been overly using in my UI.
I had a feature suggestion and I donā€™t know if here is the right place to explain it. So here it is:

Goal: compare on a bar chart a value to an average in the historic per date, day or hour.
Use case: compare your current power consumption to what you have been using for the past 2 months, with an hourly or daily comparison. So it can reveal that you are using a lot of power between 8am and 9am then between 7pm and 10pm. On another graph, it will point out, that you barely use power on weekends and that the Wednesday is the most consuming day.

In terms of configuration, I see the use of the potential following option:
compare_on: [date, day, hour]
It will take the last available data on the selected period (month for date, week for day and day for hour) and add the average of the remaining available historical data since now() - hours_to_show. Therefore for each y value, there will be two bars (as it is now when you enter two entities and select bar chart).
The important thing to me, to bring readability into it, is to fix the placement of the y values. Instead of making them move like on the traditional mini graph card, in this case, it will be fixed so that 01st of the month will always be the first bar.
To me, it can bring deeper sense into our data. Currently, mini graph card is the most advanced solution within lovelace and I am sure it can go even beyond!

What do you think?

On a totally different topic, is it possible on a bar chart to color some bars letā€™s say during night time ? A bit similarly as what we do with a secondary axis on a line chart.

So either coloring the bars that are during night hours or adding another axis which would be a line axis.
In other words, is it possible to have a bar chart and a line chart in the same graph?

Hi all.
I am facing the same problem: no graph.
I have installed home assistant on a docker container on a Raspberry pi 3 B+
and this is the situation of containersā€¦
ā€¦ missing imageā€¦

This is what I see of Home Assistant
ā€¦ missing imageā€¦

This is my frontend configuration file (I donā€™t understant if this is ui.lovelace, please explain):
resources:

  • url: /local/community/mini-graph-card/mini-graph-card-bundle.js?v=0.9.4
    type: module
    views:
  • title: Generale
    theme: Google Dark Theme
    panel: false
    icon: ā€˜mdi:home-assistantā€™
    badges: []
    cards:
    • type: weather-forecast
      entity: weather.casa
  • title: Mappa
    path: mappa
    theme: Google Dark Theme
    panel: false
    icon: ā€˜mdi:lightbulb-groupā€™
    badges: []
    cards:
    • type: entities
      entities:
      • entity: cover.tapparella_bagno
      • entity: cover.tapparella_camera
      • entity: cover.tapparella_cameretta
      • entity: cover.tapparella_cucina
      • entity: cover.tapparella_sala
        state_color: true
    • type: glance
      entities:
      • entity: sensor.temp_camera
      • entity: sensor.temp_sala
      • entity: sensor.temp_bagno
      • entity: sensor.temp_cameretta
      • entity: sensor.temp_cucina
        state_color: true
    • type: vertical-stack
      cards:
      • type: entities
        entities:
        • entity: light.luce_camera
        • entity: light.luce_cucina
        • entity: light.luce_bagno
        • entity: light.luce_sala
          state_color: true
  • title: Technicals
    path: technicals
    icon: ā€˜mdi:gauge-lowā€™
    badges: []
    cards:
    • type: ā€˜custom:mini-graph-cardā€™
      entities:
      • sensor.cpu_temp
        hours_to_show: 3
        line_color: red
        name: CPU Temp
        points_per_hour: 60
        min: 30
        max: 80
        show:
        fill: false
    • entities:
      • entity: sensor.processor_use
        hours_to_show: 3
        name: CPU Load
        points_per_hour: 60
        type: ā€˜custom:mini-graph-cardā€™
    • entities:
      • entity: sensor.disk_use_percent
        hours_to_show: 3
        name: SSD
        points_per_hour: 60
        type: ā€˜custom:mini-graph-cardā€™
    • entities:
      • entity: sensor.memory_use_percent
        hours_to_show: 3
        name: Memoria
        points_per_hour: 60
        type: ā€˜custom:mini-graph-cardā€™
        title: Casa

This is the reaction of the browser (it can reach the bundle file):
ā€¦ missing imageā€¦

I also tried to assign x attribute to the bundle file
ā€¦ missing imageā€¦

and finally this is what I see on Chrome debugger

Thanks in advance for your help.

Do you have history: in your config file?

Added ā€œhistory:ā€ in config and it worked !
Thank you so much.

1 Like

Hello
Is there any way to show immediate values changes (square line) instead of interpolated somehow?
Iā€™m monitoring Internet connection by ping. Iā€™m interested to monitor whether the connection exists or not.
I would like to draw 1 or 0 (while 1 is ussual state) but I need imediate change from one value to another. I can achieve that by drawing as many points as samples but it seems to me to be waste of resources (900 points per hour multiplied by number of hours: 72) while there is no change at all during this time or few changes max.

Maybe there is such option but I cannot find that.

thank you.

Turn off smoothing. It will still interpolate, just less so.

I have smoothing actually disabled:


Obviously connection state wasnā€™t changing gradually.

and card config

        - entities:
          - entity: binary_sensor.isp_active
            show_points: false
        font_size: 75
        hour24: true
        hours_to_show: 10
        points_per_hour: 10
        icon: 'mdi:server-network'
        line_color: orange
        line_width: 4
        smoothing: false
        lower_bound: 0
        upper_bound: 1
        update_interval: 5
        state_map:
          - label: Disconnected
            value: 'off'
          - label: Connected
            value: 'on'
        type: 'custom:mini-graph-card'

Anyone could help me?

Increase points_per_hour to number significantly higher that number of actual readings you have during 1 hour. So if you ping once per minute, increase points_per_hour to lets say 600.

yeah, I did that. but then it seemed to me to be waste of resources. itā€™s the reson why Iā€™m asking.

Well, it might slow down the redraw of graph itself, but until it is actually drawn it should not consume any system resources. Finally it wonā€™t increase actual data points, but only their representation while charting. E.g. it will multiply the use of the same data from HA database artificially increasing datapoints in graph.
The other alternative I might think of is to switch to bar chart. This will make changes more prominent and will require to sync actual readings with bars datapoints, so no waste.

Hi,
Maybe already ask. But could we use state.sensor value for hours to show ?

On a separate note, anyone figured out how to invert the showing of negative numbers?
For example:
image
The smaller bars in the screenshot above represent larger negative numbers (ex -6000W) and higher blue bars show lower numbers like -2000w. I would like to reverse this behavior as it makes sense that -6000 should be taller then -2000. Is this something i can do in config or is this a bug?

I believe you would need to change the order of your state: map values.

Could be wrong about it with negative numbers, but give it a try.

Hmm wouldnā€™t i need a variable value instead of just a single true / false. The state map example is a simple true/false

  state_map:
    - value: "off"
      label: Clear
    - value: "on"
      label: Detected