Simple way of tracking gas bottle usage and costs?

Hi There, We get a 45kg gas (propane) bottle delivered every 1-2 months depending on usage (e.g. number of long hot showers :smiley: ). Im trying to find an easy way to track this in the energy dashboard and wondering if my approach works?

input_number.rockgas_bottle_capacity = 0.088 m³ (88L capacity tanks)
counter.rockgas_bottle_deliveries = 1 (to start with, increase every time we get a new bottle delivered - to be automated FYI)

Then I have setup a template sensor as follows:

template:
  - sensor:
    - name: 'Rockgas Usage'
      unit_of_measurement: 'm³'
      state: >
        {{ states('input_number.rockgas_bottle_capacity') | float * states('counter.rockgas_bottle_deliveries') | float }}
      state_class: total_increasing
      device_class: gas
      attributes:         
        last_reset: '1970-01-01T00:00:00+00:00'

Which has a current reading of 0.088 m³. If I increase counter.rockgas_bottle_deliveries by 1, it changes to 0.176 m³. So this seems to work.

A bottle of gas (delivered) is NZD$134, which means that 1 x m3 of gas is $1522 (delivered). Note to self find out the delivery fee and split that out.

And I have setup the gas consumption in the dashboard like this:

Should this all work over time?

EDIT: I need a way of aggregating the bottle cost over the number of days I think?

Have you considered a load cell? Here is a git repository that has it as a project.

Yep - working on that as we speak :smiley: was just working on the Energy dashboard and wondering if I could work out a more manual way as a fall back really.

If you were to do it manually it will be easier if you do it as mass.

45kg/x days * $134 will give you an average daily cost or a cumalative if you store the input_datetime of the delivery.