Open tensiondriven opened 2 years ago
Another case is to select hours_to_show
dynamically.
Currently I have to use config-template-card
for this.
Definitely something to consider; depending on complexity-level, to be considered for 0.12.0
Still considering this for a few elements (like state, icon, ...) for next release; but I'm foreseeing a lot of potential side-effects & complications when adding this to any element inside the graph. Updated the issue for transparency.
+1 for this.
Very useful for upper_bound / lower bound to show multiple graphs on the same scale.
Also for color_thresholds: https://github.com/kalkih/mini-graph-card/issues/834
color_thresholds:
- value: "{{ ((states.sensor.hallway_temperature.state) | float +0) }}"
color: '#0066ff'
- value: "{{ ((states.sensor.hallway_temperature.state) | float +3) }}"
color: '#d35400'
From my post that got merged, I would like to do something like this:
show_graph: |
{{ states('input_boolean.test_graph_icon') }}
Hello team !
After opening this ticket : https://github.com/kalkih/mini-graph-card/issues/943
ildar170975 told me to add my comments here :
I'm trying to do a simple thing, but it seems that i'm taking it on the wrong side!
I have created cards where I display temperature and humidity of the room (on that no issue). The temperature icon, is colored with different values as you can see below :
It's working fine and I have the right color with the right temperature. But when I want to apply this scheme to my mini-graph-card, it's not working : I just want to have my graph-line with the same color as my icon...
For that, here is the code :
This is driving me crazy, I'm sure it can work, but I don't understand why it is not.
Important : The color_treshold behaviour is not what I want. I want the whole graph to be from the color I put in parameter, not the threshold.
For example, If my temperature is 19, I want the whole graph line in green. If my temperature is 22, I want the whole line to be in red.
This is the difference between the treshold and my question.
Any idea ?
Kind regards.
Any idea ?
Currently dynamic color is not supported by the card.
Your possible workaround - place the card inside config-template-card
.
For details you may ask questions in a dedicated mini-graph-card
or config-template-card
threads in Community to avoid cluttering this issue.
Another +1 for this FR. Would like the ability to dynamically change the graph color based on an entity's state.
My particular use-case is for climate devices. I'd like the graph to be orange if heating or blue if cooling.
color: |
{% if is_state('climate.thermostat_bar','heat') %}
var(--orange-color)
{% elif is_state('climate.thermostat_bar','cooling') %}
var(--blue-color)
{% endif %}
@MRobi1
dynamically change the graph color based on an entity's state.
Currently this may be done by card-mod:
https://community.home-assistant.io/t/lovelace-mini-graph-card/71385/2316?u=ildar_gabdullin
@ildar170975 Thanks!! I had managed to do it using config-template-card but I use card-mod everywhere else in my dashboard so it would be better for consistency.
Any idea how to handle when you have multiple lines on 1 graph and dynamically set the color of both?? EDIT: Figured it out by adding last-of-type
using config-template-card
Not a good solution - you need to define your graph's sensor as "monitored" in CTC (config-template-card). Also, on every change of the sensor the whole card will flicker.
adding last-of-type
Yes, any possible pseudoclass.
If you need to continue this discussion - please move to the mini-graph community thread to avoid hijacking this issue.
Here is a one-line excerpt of my card code:
show_hours: 720
I would need to be able to change it from the hard-coded value (here: 720) to any numerical external value being kept in the numerical helper (e.g. input_number.show_hours
) or any other numerical entity.
This is basically what I want to achieve (don't look at the syntax, the semantic counts here):
show_hours: Number(states['input_number.show_hours'].state)
Is it possible to have it coded somehow?
this would be INCREDIBLY useful for all config fields agreed!
another example I have is for the value_factor
field -- to be controlled through an input value
Another use-case for this would be converting a string state into a value that could then be graphed. For example, converting an hvac_action from a climate entity into values. This would allow me to highlight the background of the chart in red or blue depending on if the heating or cooling was running during a time period which I am currently doing with the apexcharts card (but I like the look of this card much better and wish I could replicate this functionality)
+1 for this. Been waiting for this for a looong time.
I'd like to be able to dynamically change de number of hours showing.
+1
I don't know if this is here but it would be usefull for name
field of each entity. In my case all temperature sensors are numbered to avoid having there names/id linked to a room and I would like to use area_name('sensor.xxx')
to avoid changing the graph if I move a sensor to an other room
Anyone with a config-template-card
example as a workaround ?
Love
mini-graph-card
!Forgive me if this has been requested. I'd like to be able to use jinja templates in attribute values to, for example, change the
lower_bound
andupper_bound
to be relative to the current value, for example: