Now I have had the heating on a little I have noticed that the values, although correct are reversed, ie the bar calculation is the opposite, so it is showing oil used and not oil remaining. How would I use that calculation to display the amount remaining. I know the capacity of the tank is 1250ltr which is 1400mm or 140cm in depth?
You can make 2 new sensors that subtract from the total value.
sensor:
- platform: template
sensors:
oil_tank_volume_remaining:
name: "Oil Tank Volume Remaining"
value_template: "{{ 1250 - states('sensor.oil_tank_volume') | float }}"
unit_of_measurement: l
oil_tank_bars_remaining:
name: "Oil Tank Bars Remaining"
value_template: "{{ 10 - states('states.oil_tank_bars') | int }}"
unit_of_measurement: bar
I now get the following error:
Invalid config for [sensor.template]: [name] is an invalid option for [sensor.template]. Check: sensor.template->sensors->oil_tank_volume_remaining->name.
Thanks that’s mostly working, the oil tank volume remaining calculation is correct, however the oil tank bars remaining shows 10 all the time, where it should be showing 5.
Then you’re using the wrong entity_id in the equation.
I made a guess at the name. You gotta put the correct one in there.