Energy Dashboard: Add Oil-Usage in addition to Gas

Hi, I am also using the same Oilfox :slight_smile:
right now, I am also just using the provided information + a template sensor to get the total amount of oil left in the tank.

For this, I’ve basically just substract the oil Used value from the total amount the tank can have…

Furthermore, to get a daily, weekly, monthly statistics, I would create utility meters…

here’s my template for the oil being used:

  - sensor:
    - name: oilfox_of7090001854_fuelused
      unique_id: 'oilfox_of7090001854_fuelused'
      unit_of_measurement: L
      device_class: volume
      state_class: measurement
      state: >
        {% set max_of7090001854_filllevel = 1000 | float(0) %}
        {% set current_of7090001854_filllevel = states('sensor.oilfox_of7090001854_filllevelquantity') | float(0) %}
        {% set of7090001854_fuelused = max_of7090001854_filllevel - current_of7090001854_filllevel | float(0) %}
        {{ '{:.2f}'.format(of7090001854_fuelused) }}
      availability: >
          {{ states('sensor.oilfox_of7090001854_filllevelquantity') not in ['unknown', 'unavailable', 'None'] }}

and here the utility meters that count the statistics over the given period

# Oilfox
  # Kachelofen
  oilfox_of7090001854_fuelused_daily:
    unique_id: 'oilfox_of7090001854_fuelused_daily'
    source: sensor.oilfox_of7090001854_fuelused
    cycle: daily

  oilfox_of7090001854_fuelused_weekly:
    unique_id: 'oilfox_of7090001854_fuelused_weekly'
    source: sensor.oilfox_of7090001854_fuelused
    cycle: weekly

  oilfox_of7090001854_fuelused_monthly:
    unique_id: 'oilfox_of7090001854_fuelused_monthly'
    source: sensor.oilfox_of7090001854_fuelused
    cycle: monthly

  oilfox_of7090001854_fuelused_quarterly:
    unique_id: 'oilfox_of7090001854_fuelused_quarterly'
    source: sensor.oilfox_of7090001854_fuelused
    cycle: quarterly

  oilfox_of7090001854_fuelused_yearly:
    unique_id: 'oilfox_of7090001854_fuelused_yearly'
    source: sensor.oilfox_of7090001854_fuelused
    cycle: yearly

just replace the sensors ID with the one you have.
I think, that should work… :slight_smile:

2 Likes

Hi Chris,

wow that sounds great, I will try that tonight and let you know!

Thanks!

@CChris thanks a lot, this works perfectly for my Oilfox! Great work!

1 Like

With this setup you can indeed track your oil usage.
But it’s not part of the energy dashboard which is a feature I hope will be implemented someday.

1 Like

The problem is, that it doesn’t make much sense to use this sensor within the Energy-Dashboard, since it does only update once a day.

So it might be a good information for daily monitoring and others, but it does not provide much information for the hourly graphs at all (and probably don’t provide much information to help you optimizing your oil usage)

Hi. I totally agree that a dashboard for oil would be great. Basically the ability to rename gas to oil and allowing liters as a unit of measurement would solve the problem.

I’ve build a sensor for my oil tank based on a esp8266 with an ultrasonic distance sensor which works great. It gathers measurement throughout the day and submits its value once a day at 2 o clock in the night.

It’s very easy to incorporate this in the energy dashboard (1 liter of oil≈ 10 kWh).
Sure it says “gas” in the title, which is a bit annoying and the hourly graph doesn’t make much sense (the sensor probably isnt accurate enough for an hourly graph anyway), but for tracking weekly, monthly and yearly consumption it works absolutely perfect!



Nice solution with the uktraonic sensor! Using gas is indeed a workaround, but not for me. We still use natural gas for warm water.

I agree with Christopher that there is insufficient data to have meaningful insights on hourly basis. However on daily and particularly monthly basis it could really helpful. Keeping track of the total energy costs in 1 place, and comparing the long-term usage to see how energy saving measures like additional insulation are paying off.

with a tank sensor there is little useful hourly energy statistics data, but with a flow meter (cheap) or an electric sensor on the oil burner/pump (a capacitor and a CT and a resistor or three with a wemos), you can know exactly when the pump is running, and most pumps have a fixed consumption rate.

so… back to the original question, yes +++ add oil usage please! one of these days perhaps i will work out the solar generation equivalent that we get from our solar thermal system… but that’s not quite as straightforward!

1 Like

Wouldn’t it be better to instead of adding oil, wood, pellets, heat, etc separately, to just add a generic “add energy type” option where you can choose your own energy type, unit and logo?

For example, I don’t have gas or oil. I’m connected to city heating, so hot water flows into my house into a heat exchanger that provides house heating and hot tap water. The amount of heat consumed is counted in GJ by the energy meter. So I would need an energy category “heat” with unit “GJ”.

7 Likes

First of all, the Dashboard is great !
I think it makes sense to add Oil.
For my situation, to add oil to the dashboard will be fantastic !

BR

2 Likes

@Istria1704s post would be the best solution.

1 Like

Daily consumption translated to kWh for Gas iin the energy dashboard would be awesome - anyone know how to do this from the oilfox fillLevelQuantity sensor? Should be doable with a template sensor…?

For the heating system I have it’s using paraffin. I am monitoring the watts it’s drawing, so when it goes over a certain value I can tell when it’s “firing” Vs when it’s just on.

What I would like to do though is have a flow meter on the fuel pipe it’s self.

Has any one done this with esphome or would be aware of such item I could put on the fuel line to measure that flow and hook up to esphome

I’ve seen a mix of ultrasonic or more mechanical based devices for measuring flow in a pipe but nothing really suited to this, eg low flow rate or suitable to be emersed in oil.

Thanks in advance folks!

Huhu
That’s not quite right. Your OilFox provider can adjust the measurement interval. Every six hours is the lowest setting. This means there are four measuring points per day.

hm… thanks :slight_smile:
This can only be set by the provider itself?
Not within the app? Or if yes - where can this be found?

I don’t really use any provider - I just bought them (used)… so they do not come from any provider / supplier.

I’m doing the same with an ultrasonic sensor. Would you please give more information on “how do you gather measurements throughout the day and submits the values once a day”??

How comes ???

How did you do that? Energy dashboard doesn’t have volumes as you mentioned above.
Did you create a template sensor ??? Would you please also share the yaml for this ??

Hi,

As to not go off-topic in this thread, I’ve decribed my solution over here.

It would still be very nice if we were able to add oil in liters and this poll definitely has my vote!

Hello,

exactly looking for the same.
I triedsomething similar to get set up yesterday with a template and sensor.
However, the conversion to kwh looks strange to me and I am not sure if I am calulating correctly. For our oil tank, I believe we cannot install an extra distance meter. But when I can calculate manually every day by writing down burner hours and multiply with my consumption per hour (eg. 2.4 l/h) then I thought I can do that also automated in home assistant. Maybe it would be easier if there was a generic option for energy where you can pick measurment in liters. So yes I vote for this, too. First I thought I can just export values to my existing excel spreadsheet but seems that is even more complicated… :wink:

Hi,
if you know your burner uses exactly 2.4L (equals ~24kwh) per hour it’s running, you might be able to install a vibration or acoustic sensor on your burner.
Thus passing the time the burner has been running to HA, multiply by 24 to get your consumption in kwh, or multiply by 2.4 to get your consumption in liters.

You will be off a little bit (because the 2.4L is probably an estimation which fluctuates). Over time the discrepancy will get bigger, but to determine your consumption it should be close enough. Just make sure you do not trust these values to determine how much oil is left in the tank though, since the error will increase over time.

Dear Assembly,

Thank you for your response and valuable information.
The problem I had from start with the energy dashboard was that I could not save anything since burner hours weren’t allow (sensor.vicare…) then I tried the approach to create my own sensor with all of the help from different posts here. Once I had one really properly configured I was able to save the energy dashboard and then got all the options for water, gas etc. to set up a energy dashboard. So I added gas with the same sensor. I feel like I am doing something duplicate and can also see that my attempts still show up as sensors (just greyed out - need to find out how to get rid of my tests).
However, thanks for your calculation. I must have been lost somehow and thought 9,8 kWH are 1 liter - so I need to check my ‘calculation’.

Hope I get this sorted. Thanks again and most likely I will come back with another question. For now I have to go into this config jungle again :smiley: