I’m just getting started with Grafana. Apologies if I’ve missed a post that has already covered the following, but at least when I was looking at resources setting it up, I didn’t see such. That is, how to get Grafana panels to automatically switch from light to dark theme.
So. Once Grafana is up and running, and you have your fancy (or, in my case, less fancy) graphs in place [this was a great post, by the way, getting going], there might be a mismatch between your themes? Especially if you have HA automatically switching between light and dark.
Well, it’s pretty easy to get your Grafana panels to follow suit! I’m sure there are other, possibly better ways to achieve it (tips are appreciated!), but here’s how I did it:
(1) Create two camera entities, one for pulling a light Grafana panel, the other for pulling a dark Grafana panel.
(2) Have a true/false sensor of some kind (I made a binary template sensor) for when you want light or dark theme.
(3) Use the conditional card in Lovelace to show “camera light panel” or “camera dark panel” depending on the state of the aforementioned true/false sensor.
Here is a gist with the code for (1), (2), and (3).