kalkih / mini-graph-card

Minimalistic graph card for Home Assistant Lovelace UI
MIT License
3.05k stars 237 forks source link

extrema config per entity #51

Open SeLLeRoNe opened 5 years ago

SeLLeRoNe commented 5 years ago

It would be nice on the Extrema View to be able to see one line per entity so to keep track of all min-max of each entity of the graph.

It would also be nice, when there are multiple entities but you want to see only one min/max, to be able to define which entity provides you the min and which the max.

Hope is clear enough, if not let me know :)

Cheers Andrea

kalkih commented 5 years ago

I think we could add this as an optional option in the entity object, similar to show_state.

Possibly something like this:

entities:
  - sensor.temperature
  - entity: sensor.pressure
    name: Pressure
    show_state: true
    show_extrema: true #show this entity in the extrema
  - sensor.humidity
SeLLeRoNe commented 5 years ago

Yep I think that would make a lot of sense.

It might actually also work in another way:

extrema: true
entities:
  - sensor.temperature
  - entity: sensor.pressure
    name: Pressure
    show_state: true
    show_extrema: false #don't show this entity in the extrema but show all the rest
  - sensor.humidity
ahd71 commented 5 years ago

When displaying data over more than 24h it shows only TIME of the extreme value, would be good to be able to format the value to show DATE+TIME (in 12/24h, and with different date formats, i.e yyyy-mm-dd, preferably from some system setting)

kalkih commented 5 years ago

When displaying data over more than 24h it shows only TIME of the extreme value, would be good to be able to format the value to show DATE+TIME (in 12/24h, and with different date formats, i.e yyyy-mm-dd, preferably from some system setting)

The day / weekday will be displayed by default in the next release if the graph timeframe is longer than 24 hours d1bdfce64a285e9bf9ccb068a668ebef021cb954

The format will be (D ddd, HH:mm - HH:mm ) or corresponding am/pm format

ahd71 commented 5 years ago

Excellent, thanks!

hekm77 commented 5 years ago

Is it possible to display the weekdays in a local HA language?

kalkih commented 5 years ago

@hekm77

Sure, coming next update https://github.com/kalkih/mini-graph-card/commit/6d542863695e62a3d44dc089cc8ab82f3472a085

kalkih commented 5 years ago

@hekm77 This is now available in the latest release v0.3.2, no config needed, utalize the language set in HA.

mihalski commented 4 years ago

Did this every get implemented? I was just trying to achieve this for a temp/humidity graph so I could see the min/max for both sensors.

kalkih commented 4 years ago

No, this issue is still open.

mihalski commented 4 years ago

Was thinking maybe something like:

Min: TempValue / Time           Min: HumidityValue / Time
Max: TempValue / Time           Max: HumidityValue / Time

Maybe it can be even simpler and more elegant.

Extreme79 commented 3 years ago

How about to have an option to place extrema on the same line of current status? This to have a more compact view. something like this: image

peter-dolkens commented 3 years ago

I'd also love a more compact view - and also one that only triggers on hover

So my graph might normally look like: image

But when I hover, it might look like: image

Additionally, the ability to control show_min and show_max separately would be great too.

Let me know if these should be separate tickets - this issue appears to be a bit of a "catch all for extrema improvements" at the moment, which feels weird, but I'd rather not give you duplicate tickets too.

Manlycookiebear commented 2 years ago

I would find this an extremely useful feature right now, to have an option for which entity I can see the extrema.

jlsjonas commented 2 years ago

I would find this an extremely useful feature right now, to have an option for which entity I can see the extrema.

entity-level configuration is our main goal for the next release, extrema will definitely be included in that.

@Extreme79 & @peter-dolkens : there's a ticket (#699) to tackle a compact view; your input would be welcome there

ildar170975 commented 2 years ago

Let me conclude:

  1. For each entity we may define show_extrema & show_average options (false/true).

  2. If some graph is selected:

    • the extrema data for THIS entity are displayed (if show_extrema=true for THIS entity);
    • the average data for THIS entity are displayed (if show_average=true for THIS entity).
  3. If no graph is selected:

    • if entity No1 has show_extrema=true or show_average=true - the extrema or average data are displayed for this entity;
    • otherwise - a blank line is displayed.

Additionally - I propose a new extrema_average_adaptive_color option (per-entity) - similarly to state_adaptive_color.

As for "show extrema / average" data in a compact manner - let it be a separate issue.

ncd7 commented 1 year ago

Any plans to implement this?

BuurmanG commented 11 months ago

Would be nice if this was implemented.... 🎅 🎁

antonio1475 commented 4 months ago

This is a pity 🥲 I have one card per room, with a "comparison" one (outside temp) to manage the windows. I would want the extrema for only the room so that I know how that room is behaving, keeping the secondary (outside temp) just as a reference line without affecting the extrema. Right now, in practice the extrema ends up being the outside temp (much more variable) than the room.

image

ildar170975 commented 4 months ago

@antonio1475 Currently extrema & average are shown for the 1st entity only:

type: custom:mini-graph-card
entities:
  - entity: sensor.xiaomi_cg_1_temperature
  - entity: sensor.ac68u_cpu_temperature
    show_state: true
points_per_hour: 60
name: xxx
show:
  extrema: true
  labels: true

image

Means - this is achieved:

I would want the extrema for only the room so that I know how that room is behaving, keeping the secondary (outside temp) just as a reference line without affecting the extrema

antonio1475 commented 4 months ago

show: extrema: true labels: true

My apologies. I just learnt that extrema is not what I thought it was. I was talking about what I now know are the labels, which grab the min and max values of all entities and I have yet to learn if this is configurable so that labels only grab the data of the 1st entity.

image

Thank you for your quick answer and I'm sorry. I'm happy to delete both my messages to avoid confusion, please tell me so.

ildar170975 commented 4 months ago

that labels only grab the data of the 1st entity

It is only possible if the 2nd entity is assigned to the 2nd axis:

type: custom:mini-graph-card
entities:
  - entity: sensor.xiaomi_cg_1_temperature
  - entity: sensor.ac68u_cpu_temperature
    show_state: true
    y_axis: secondary
points_per_hour: 60
name: xxx
show:
  extrema: true
  labels: true
  labels_secondary: true

image

Now just remove labels_secondary: true.

GigiPompieru commented 3 months ago

I googled hoping there is an option to this, seems like it's not here yet. Is it at least in the works? I would really like this as well.