History graph for state_attr

I would like to create history graph of my vaccum clearer time
I used templating to get attibute of 'cleaning_time"
Unforunetly, I can’t use it to display it on graph like

entity: {{state_attr("vacuum.roborock_vacuum_s5", "cleaning_time")}

Any idea how to do it ?

As you have discovered, history graph cards do not support attributes, but you have a couple of options:

  1. Create a template sensor from the attribute and use that in your history graph (you already have the template).

  2. Use the Apex Chart card, it supports graphing attributes. https://community.home-assistant.io/t/apexcharts-card-a-highly-customizable-graph-card/272877

1 Like