Declining values extracted from each other

Hi there

I have a command line that extracts a value that shows the content of wood pellets in my silo. This value is a declining number.

I would like to calculate the used wood pellets the last two days, with use of this number.
I know i have to save the value every midnight, and extract that somehow from the value from the day before, but honestly I do not know where to begin.
Please help to get me in the right direction.

integration sensor will tell you the wood pellet extraction rate per day. It won’t give you over the past 2 days though.

sensor:
  - platform: integration
    source: sensor.wood_pellet
    unit_time: d

It was built for ‘power consumption’ but you can use it for anything.

You can also use statistics for 2 days:

  - platform: statistics
    entity_id: sensor.wood_pellet
    max_age:
      days: 2

This will give you a min/max attribute and you’d just subtract one from the other in a template sensor.

1 Like