How to plot sensor trends on Lovelace cards?

Hi,

I’ve got a Lovelace card showing a voltage, which I do calculations to turn into water level. I’d like to create another sensor which takes the raw voltage - 0.5 Vdc -3.9 Vdc, and creates a trendline, which I could overlay onto on top of the overall chart.

I can’t think of a way to do this, and the “trend” binary sensor can tell me when a yes/no trend is used, but it doesn’t draw.

What am I missing?

Thanks,
Ambi

use a history-graph card.

Thanks!

I don’t see a way to plot a trendline with this. What am I missing?

Cheers,

Ambi

sorry, I missed the trend line requirement.

I think the easiest way is to create a derivative sensor with the data you want to trend and then use that data in the history graph card.

I use the same thing for tracking my fish tank temperature trend:

  - platform: derivative
    source: sensor.tank_sensor_temperature
    name: Tank Temperature Derivative
    round: 3
    unit_time: h 
    time_window: "00:30:00"
    unit: '°F/Hr'

then use it in a history graph with these results:

ex

That should do it, thanks! I’ll give it a go!