Daily consumption card from P1 slimme meter

The data read from P1 slimme meter are total consumption since the meter has been installed. I added a card to show Gas Consumption, as you can see the data are big numbers, 5465+.

I have been thinking to make that only showing the current consumption of today.

  • At 23:59 time, record the consumption and save the value to a variable consumption_yesterday.

  • Plot the P1 data in the card by subtracting it with consumption_yesterday:

    data_to_plot = P1_gas_consumption - consumption_yesterday

Would that be correct? But, I don’t know how to do that, anyone can help? Or perhaps there is other way?

image

1 Like

Feed your ever increasing sensor to a utility meter helper with a daily cycle.

This is all you need to do and you can do it from the UI.

1 Like

Thanks, I made a helper below and use it for the history card. I guess that’s how to do it :slight_smile:

Have you used any gas?

Yes, but not so much (heater is off). Below is the graph now after we cooked lunch and clean the dishes :slight_smile:

image

Is there any way to add the current value in the title? Something like this:

Daily Gas Consumption: 0.21 m3

[ … graph is shown here ]

I did it :slight_smile:

type: custom:config-template-card
entities:
  - entity: sensor.gas_consumption
variables:
  - states['sensor.gas_consumption'].state
card:
  type: history-graph
  show_names: false
  entities:
    - entity: sensor.gas_consumption
  title: ${ "Daily Gas Consumption = "+vars[0]+" m³"}

1 Like