Lovelace: mini graph card

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

HI
How I can change sunrise/sunset to numerical value?
input_number??

Haha, I believe there’s one open already :wink:

Check out template sensor, or the cards state_map option, see example.

1 Like

I’m an idiot. I looked way back in this thread for an example to answer that question and gave up. :man_facepalming:

Hi, this is an awesome looking card!

I would prefer this over grafana, to keep everything in HA.
One thing, no actually 2, grafana can’t do natively are side-by-side bar charts and drill down charts.

  • Side-by-side: I would like to aggregate 3 entities by date, and have a bar per date for each entit. Is this possible?
  • Drill down: with an date aggregation I would tap on a bar (eg for weeks), and then I would drill down to days for that week.

Thanks for the effort and especially support!

Thank you very much
 How i miss that example
 :man_facepalming:t3:

@LintHart really nice , can you share you code please?