Lovelace: mini graph card

Thank you, it was indeed missing the “-bundle.js”

Found my error: i disabled “history” and “logbook” in the configuration.yaml.
If you do this, the mini graph card isn’t able to display a chart.

Silly error but now resolved.
/ Ralf

That’s a really nice graph you got there, do you mind to share it with us ?

I’m not used to card-mod, but it looks like the .line-fill parameter is no longer available in mini-graph-card ? (I searched it in the style.js file)

Hello,

I discovered this plugin and I use it everywhere. But I want to display the sunrise and sunset hour, but it doesn’t work well (Only hours display it)… Do you have an idea ?

  - align_state: center
    entities:
      - sensor.couche_soleil
    name: Coucher
    show:
      graph: false
    type: 'custom:mini-graph-card'

Capture

I’m using a binary sensor to show night time on a graph displaying temperatures.
Is there any way to stop the primary axis showing ‘Day’ when the lower temperature is zero?

          - type: custom:mini-graph-card
            entities:
              - entity: sensor.dark_sky_current_temperature
                name: Outside
              - entity: sensor.hall_temperature
                name: Hall
              - entity: sensor.kitchen_temperature
                name: Kitchen
              - entity: sensor.sitting_room_temperature
                name: Sitting Room
              - entity: sensor.back_bedroom_temperature
                name: Back Bedroom
              - entity: sensor.upstairs_hall_temperature
                name: Upstairs Hall
              - entity: sensor.loft_temperature
                name: Loft
              - entity: binary_sensor.above_horizon
                name: Night
                y_axis: secondary
                color: black
                show_line: false
                show_points: true
            line_width: 1
            points_per_hour: 2
            aggregate_func: max
            show:
              labels: true
              labels_secondary: true
              average: true
              extrema: true
            state_map:
              - value: 'on'
                label: 'Day'
              - value: 'off'
                label: 'Night'

I updated the plugin to 0.90 beta because of de fix for the bar graph cache issue. But with 0.90 beta the problem still exists.
Have tried cache: false in the graph configuration.

I’ve been having the cache issue with the bar graph as well on the latest version (v0.8.2). As suggested the 0.9.0 beta should fix this issue, so I want to test that version out on my instance.

Since I’m using HACS I was wondering whether the ‘dev’ version in HACS is the same as the 0.9.0 beta from Github. I checked the 0.9.0 beta tag in Github and it does seem to be the same as the ‘dev’ branch on there.

Just want to know whether I’m using the correct version to test the cache issue as some people in this thread (and on Github) have said that version does not fix the bug.

1 Like

Hoping someone can help me! I have two sensors, one for energy consumption and one for energy production and a template sensor that inverts the consumption sensor to get a negative value. I want to get a graph that looks like the attached, any ideas?

There is a conflict with mini-graph-card parameter group:true and styling card with box-shadow:
Grouping disable shadow,

And feauture request: option making graph filling entire card hight.

I’m having problems displaying a binary sensor to represent day and night.

Can you check my config please?

          - type: custom:mini-graph-card
            entities:
              - entity: sensor.dark_sky_current_temperature
                name: Outside
              - entity: sensor.mean_downstairs_temperature
                name: Mean Downstairs
              - entity: sensor.hall_temperature
                name: Hall
              - entity: sensor.kitchen_temperature
                name: Kitchen
              - entity: sensor.sitting_room_temperature
                name: Sitting Room
              - entity: sensor.back_bedroom_temperature
                name: Back Bedroom
              - entity: sensor.upstairs_hall_temperature
                name: Upstairs Hall
              - entity: sensor.loft_temperature
                name: Loft
              - entity: binary_sensor.above_horizon
                name: Night
                y_axis: secondary
                color: black
                show_line: true
                show_points: true
                show_legend: true
            line_width: 1
            points_per_hour: 4
            aggregate_func: min
            show:
              labels: true
              labels_secondary: true
              # extrema: true
            state_map:
              - value: 'on'
                label: 'Day'
              - value: 'off'
                label: 'Night'

Hi! I am getting the wrong colors on my graph.
It will not change to correct colors and sometime every thing just turn red (’#c0392b’) Now everything should be green. Is there something i have missed here?

color_thresholds:
  - color: '#067d23'
    value: 1400
  - color: '#d35400'
    value: 3900
  - color: '#c0392b'
    value: 4900
entities:
  - sensor.real_time_consumption_draugveien_61
fill: false
font_size: 70
height: 65
hours_to_show: 24
line_width: 2
show:
  labels: false
style: |
  ha-card {
    border-radius: 15px;
  }
type: 'custom:mini-graph-card'

Strange, even if the caching issue is still there, the cache: false option should completely disable caching and the card will request all history data on every update.

That’s intentional, and is stated in the docs.

The full size request is a good idea, there’s a request open for it on github already.

I don’t see anything wrong, looks good, copy pasted and replaced the entities and it and works fine here.

Hard to say without the y-axis scale but this looks like an issue that was present in the card a while back.
You could also try the color_thresholds_transition: true option, to display hard transitions vetween colors, might be easier to debug with.

Try updating the card/clearing cache.
And if you are using HACS, check this:

Hi all,

I started some time back to have this issue - when I click my page for temperatures, they show up like the picture attached. If I leave the page open for a while - suddenly they get updated. Even the statistical graphs stop updating until I have had the page open for a while. I’m currently running version 0.103.0 and latest mini graph card installed through HACS.

Any ideas how to resolve this would be highly appreciated.

What king of sensors? Do the entities you are showing have a valid state if you look in dev-tools? Some sensors can take a while to update when Home Assistant starts… There is probably a solution for that depending on the sensors you are using.

The cards will look like that when there’s no history data available or before fetching of the initial history data is complete. The current state is not fetched from history and will therefore display almost instantly
This is especially noticeable if your HA setup/database is slow, or if you’re doing several large history requests to the database at once. This is not only affecting this card but all frontend using history data, check the HA history tab for example.

I’ve experienced this myself so I switched from the default database to mariadb and that did improve things (I think). You could try purging your db or lower hours_to_show in your card configs.

Hi @DavidFW1960

Sensors are temperature sensors. If I look in dev-tools I get the state immediately, the same as I do in Lovelace UI. It is the statistics that are extremely slow to update. This happens whenever it has been a few minutes since last time I looked at my UI page for temperatures.

Hi @kalkih,

Correct, the current state (live) is always updated immediately.

I’m running the latest HA addon of Maria DB on an Intel NUC i7 with 16Gb mem & 400Gb M.2 SSD (so the system should be quite fast) with Ubuntu 18.04.

Hours to show is 48 hours, do you think that is too much?

I’ve started using MariaDB just a few days ago, setting it up like this:

recorder:
  db_url: mysql://user:pass@core-mariadb/homeassistant?charset=utf8
  purge_keep_days: 30

Is this set up correct?

I had this problem was when I was a bit overzealous and accidentally excluded a sensor from the recorder - thus no history available. Do you have any recorder exclusions for these sensors?

When you click on one of the entities (not the mini-graph-cards) in the frontend, is the built in pop-up history graph showing any history?

If you don’t have the entities available in the front end look in the side panel History page for the sensors. See any history?

Hi @tom_l

No I don’t have any exlusions in my recorder.
Yes, the pop-up graph is showing as it should, immediately.

Hey guys! Is it possible to have the lines displayed in a more “expressive” way? Not sure how to describe it in english therefore a pic :slight_smile:

I included the sensor data of a humidity sensor and since then my temperature line is pretty flat and on the bottom of the card.

Im looking now for a way to get it “up” again.