Lovelace: mini graph card

My problem described above about graphs not appearing seems to be gone after 0.117.6 update.

Hello everyone!

Is it possible to use a template instead of using a fixed number in the color_thresholds section?

So, instead of doing this:

color_thresholds:
  - value: 0
    color: "#4d68ff"
  - value: 300
    color: "#66ffe6"

Iā€™d like to use a template, like this:

color_thresholds:
  - value: '{{ states("input_number.value_1") | int }}'
    color: "#4d68ff"
  - value: '{{ states("input_number.value_2") | int }}'
    color: "#66ffe6"

Iā€™ve tried the code above but it does not work.

1 Like

Try to add this option to the secondary sensor
y_axis: secondary

Great, thatā€™s exactly what I needed. Thanks

Hello,

I am quite new to HomeAssintant, trying to implement mini graph card.

I successfully installed HACS and added the frontend ā€œmini graph cardā€.

But how do I get the card into my lovelace? I want to display the CPU temperature of the Pi.
Can anyone give me detailed instruction how to add the card???

Thanks
Mike

Hi
there is all information and many example on the repo
https://github.com/kalkih/mini-graph-card

Hi,

thanks for the link.

I did install HACS according to the instructions, I am able to download the mini graph card, then I tried to add the respective custom card card by choosing the option at the bottom. I edited the following:

  • type: custom:mini-graph-card
    entities:
    • sensor.cpu_temperature
      show:
      icon: false
      name: CPU
      state: false

But I still an error!

Any Idea?
Do I have to add a line to a .yaml file after HACS installation?

Mike

Sorry to bother, I was able to add a card to my locelace but I do not see any graph!

I used the examples, I see the value e. g. the Pi temperature but no graph at all!
Any idea folks

Mike

Everything is stated in the documentation.
Can you share your code?

Here is my code of the card:

type: ā€˜custom:mini-graph-cardā€™
entities:

  • sensor.cpu_temperature
    name: CPU
    hours_to_show: 12
    points_per_hour: 6

Even without the last 2 lines it doesnā€™t work. As I said before, the temperature is shown but no graph!

Try this

type: 'custom:mini-graph-card'
name: CPU
entities:
  - entity: sensor.cpu_temperature

I tried but get the following Error:

Error: No visual editor available for: custom:mini-graph-card

I even canā€™t save the card!

Thatā€™s not an error. Itā€™s information telling you there is no UI and you have to define the card using yaml. The reason you canā€™t save is because your configuration is incorrect.

Paste it correctly formatted and we will be able to help.

Do you have sensor.cpu_temperature configured to be recorded by recorder component? For me this type of symptoms indicate that graph have no data to draw the chart, only current state of sensor is available.

1 Like

Hi,

no I havenā€™t configured the cpu sensor to be recorded! How do I do this?

I have this in config.yaml

sensor:
  - platform: command_line
    name: CPU
    command: "cat /sys/class/thermal/thermal_zone0/temp"
    unit_of_measurement: "Ā°C"
    value_template: '{{ value | multiply(0.001) | round(1) }}'

The result of the code I wrote above
cpu

HI,

I changed my configuration.yaml like you posted above and I used the code for the card like you posted but still no help! It shows the current temperature, no background colour nor graph.

What about the recorder component mirekmal mentioned?

Find this sensor in the entities and use the entity of this sensor on the card.
Probably the sensor entity will be sensor.cpu

Thats what I did! I changed my config.yaml like you posted and of course I changed the entity to sensor.cpu! But still no graph

Again, what about he recorder component mirekmal mentioned?

You do not have a recorder set in config.yaml where sensors are excluded