I am looking for an easy way to create a sensor or helper which gives me the current total amount of driven km of my car of the current and the amount of last month.
I have a sensor which shows me the current total km and any change via history. I already tried history stats - but I have no specific state - and utility meter doesn’t seem to work either.
The utility meter should work for this months kilometers. It does not read history before its creation date, so you’d need to wait until next month to get the first full months worth. It will start at unavailable until the car (or the odometer to be presise) moves as well.
The history of the utility meter should show a sawtooth kind of graph, the highest peak of last month should be the total for that month. If you want it in a separate sensor, you could create a trigger based sensors that triggers just before the new month starts to copy the current month sensor value.