My house uses heating oil. I built a sensor to measure the oil level in the outside oil tank which reports the oil remaining in litres. It does this every 60 minutes. So in the main it steadily decreases from a high ‘water’ mark around 1,500L to a minimum of around 50L. Then every 3-4 months it is topped up to around 1,500L. Worth mentioning occasionally the value could go up slightly in between top ups - the sensor has a lot of noise.
I want to be able to visualise the data over a year (or more ideally). I don’t mind the hourly readings being aggregated into daily or even weekly averages after a while.
I figured this was the purpose of the new long term statistics function. I can’t for the life of me work out how to do it though. total_decreasing doesn’t seem to be an option. Nor am I clear how to ‘reset’ the level when it is filled up.
I’m starting to suspect this is not really a good use case for long term stats but before giving up thought I might throw the net out there for any thoughts from the community?
Use a state_class of “measurement” for this.
Unless you actually want to see daily statistics about consumption, in which case it would be “max - current_level”, which will be increasing.
@koying - thanks for the reply. I am interested in the daily and weekly values. For example Its useful to see how consumption varied yesterday with say weather changes during the day, after a week though I’m more likely to be interested in the daily average over the course of a week rather than intra-day changes and similarly after a month and year I am interested in the trend rather than granular detail. Its a bit like the graphs in MRTG if you by any chance have heard of it.
I’m not familiar with max - current_level can’t find a reference to that Type in the docs, do you have a link you could share? Also my value decreases, which sounds like it might be a problem.
The max capacity of your oil tank (1500) minus the current level of oil
ahhhhhh totally misread that!
Hi!
Did you finally implemented this @AbelardSnazz?
If so, could you share your code?
Thanks and best regards,
José
Hi @jjvelar,
Sorry only just noticed your post. Sadly I did not work out long term stats, instead I recorded the stats locally to an SD card from which I occasionally pull the data to do the long term view in Excel. In HA I have only 90 days worth of data which I find is OK for most things!
John.