Lovelace: mini graph card

There’s a request for this feature open here

No, but this is a great idea, should default to what’s specific in HA, I’m pretty sure that information is exposed to custom cards so should hopefully be possible to implement.

Thank you Karl, this would be excellent! Just discovered this component and still trying to learn how to handle this mighty beast :smile:

1 Like

Wouldn’t that just be two graph cards in a horizontal stack …?

If the second graph could show data between two specified sets of hours, then yes I would have two graphs in a horizontal stack. At the moment it can only graph data from the current time to x hours in the past.

Thanks, I’ve added a me too comment :wink:

Love the card! thank you.

question:
i have 15 rooms in the house, rather then create 15 cards, is it possible to have an input select, which you can pick and the card would then feed the data from?
so rather then 15 different cards, you have 1 card and a drop down selection, to give you the (temp) data for that room selected?

You could do that with the state switch card.

The graph displayed would depend on the state of the input select.

My attempt to visualise a bayesian sensor including (most of) its observations in a single graph.
image

1 Like

I use this code to display max value per day :

title: test
panel: true
cards:


    - type: custom:mini-graph-card
      entities:
        - entity: sensor.dsmr_day_consumption_electricity1
          aggregate_func: max
          name: Max
          color: #e74c3c
      name: energy_consumption_per_day (last week)
      hours_to_show: 168
      group_by: date  

However for every date the same value is shown, while none of the dates has a similar maximum value
To investigate whether I did something wrong I load the database in DBbrowser for sqllite and used this sql:

select substr(last_changed,1,10) as date, max(cast(state as decimal)),entity_id from states
where entity_id = ‘sensor.dsmr_day_consumption_electricity1’
group by substr(last_changed,1,10) ;
the results are in the image.
I do not understand what I am doing wrong. Only reason I can think of is that some states in the database have the value “unknown”.

I posted a similar topic before but I think this make things more clear

SOLVED: I had a corrupt database

With the standard history-graph card you can click on an entity to hide or show it in the graph (if it is hidden the name is crossed out). Is there any way to do similar with the mini graph card?

I can hover over one of the entities to only show that entity in the graph, but that only works while you hover and it would be nice to be able to easily toggle entities on and off without editing the card each time.

Then how would you bring up the more info-pop-up?

I actually had the tap_action set to none, since I didn’t want the more-info card popup (I’m using it as a replacement for history-graph which doesn’t display the more-info when you click on the headings).

I’d wondered if I could use tap_action to do this (using a set of input_bolleans toggled on tap and templating with card-templater to hide/show the lines) but tap_action is a global option for all entities on the card and can’t be set per-entity.

sorry if this has been answered before, it is such a simple question… cant find it in the doc under show options, nor here in the community.

can we show a time grid in the mini-graph (very light vertical lines, maybe coinciding with the plot frequency)? my use case: I am trying to find an exact spot in time for 2 different sensors, which I have set as entities in a mini-graph card. A simple time grid would make it easy to find a certain state in on e of these sensors, and find the value for the same time in the other sensor.

thanks for having a look.

Have. Look here: https://github.com/kalkih/mini-graph-card/issues?q=is%3Aissue+is%3Aopen+grid

Hey @kalkih

Is there any way to template / add a prefix to the current values?
I’d really love to move the graph name as a prefix to save a little vertical space.

Current load 124w
3V 8w
Etc

Cheers :slight_smile:

2 Likes

Is this now possible to have multiple colors? Can you show me your code?

Anyone got a cool example for humidity sensors?
I ordered 3 xiaomi humidity sensors, wanna show those values in a cool way

I do use them differently depending if it’s for the weather view, a specific room view or the house view:

House View (house average + outside value):


Specific room View (only room value):

Weather View (Only external value):

If you want to get the code, you can find it here: https://github.com/SeLLeRoNe/HA-Config
I do use templates for the house and per-room ones, so you might want to check them inside the lovelace/templates and lovelace/views for the weather one (still didn’t have the time to move into a template or check if I can use the existing one).

Hope this helps :slight_smile:

3 Likes

My code is here: https://github.com/SeLLeRoNe/HA-Config

But it depends on what you mean by multiple colors, if you mean one per-entity then yes, but I think (not sure tho) that the threshold will be common…

Actually that might be interesting for a FR :stuck_out_tongue: @kalkih don’t hate me please :smiley:

1 Like

Thnx for sharing guys

I’m not using any graphs with thresholds at this time. I see you’ve got some good examples from @SeLLeRoNe - mine wouldn’t add anything new.

Have fun :slight_smile:

1 Like