History graph for non-default attribute


So I’m finally jumping in on the lovelace bandwagon after just using the default setup for the last few years. The only thing I’m having troubles with so far, is that I have a power switch that also reports consumption; I want to have a graph of the power consumption for this switch, but if I use history_graph, I seem to only be able to graph the on/off state.

Reading the docs doesn’t seem to have helped, so is there a way to generate a graph for an attribute of an entity, and not just the default “on/off” that it shows?


Create a template sensor for the attribute and graph that.

Ah, that will work. A bit hacky, but it’ll work.


It’s the only way I know of.

Having the attribute broken out as a sensor is usually handy for automations without having to resort to templates too.

Fair enough. I’ve been using node-red for automations for a while now, and it makes accessing these attributes trivial without adding the extra templates