Global Variables for Mini-Graph Cards in Dashboard

Hi everyone! I’m trying to streamline my Home Assistant setup, specifically with the mini-graph cards in my Lovelace dashboard. I have multiple rooms, each with their own temperature and humidity sensors, and I’ve set up mini-graph cards for each. The issue I’m facing is that each graph’s color configuration is duplicated across all cards. For example, I have orange for temperature and blue for humidity in every room.

While this works, it’s a bit tedious to manage. If I ever want to change the colors, I’d have to manually update each card’s YAML configuration. This isn’t just time-consuming; it’s also prone to errors, especially with multiple rooms. I was wondering if there’s a way to centralize these color settings.

I thought about creating global variables that I could reference in each card’s configuration. This way, changing the color would be as simple as updating the variable, and all graphs would reflect the change automatically. I tried using a text helper entity along with a template to fetch the variable’s value, but it didn’t work as expected.

Has anyone successfully implemented something similar? Any tips or workarounds would be greatly appreciated! I’m really hoping to find a more efficient way to manage these settings without diving into the YAML every time I want a minor tweak. Thanks in advance for your help!