Transforming data with available sensor

Hi,


So this is my, lets say “query”. I get daily driven kilometers.
What i want now is to extend this with my own calculation, like with this sensor
{{(states(‘sensor.zoe_mileage’)|int - 35000)7/1001.5}}, so it calculates how much i saved on gas.
This last sensor is working, but i cant implement it in statistics it only shows last status.
What i want is to see last 10 days in graph. Is that possible?

To generate statistics, add the following to your template sensor:

state_class: measurement

Otherwise just use the graph card instead of the statistics graph card (line only, not bar).

1 Like


i dont think i got it right :slight_smile:
i am new to this and also i am doing all this with helpers…is that the correct way?

1 Like

it i sthat easy, you say :slight_smile:
ok, i am getting readings on this sensor, i guess i will be able to do same graph in 1weak as above for milage. Thanks
But what i initially wanted is to get graph based on history of driven kilometeres. So i could today see the savings from 1 week ago.
But nvm if it is not easy lets just wait for this new sensor to populate numbers