I'd like to track heating oil usage for my home and add it as gas consumption. I currently have a binary sensor to indicate when the furnace is on/running, and I know it has a fixed flow rate of about 0.75 US gal/hour. There is a turn on delay of about 20s for oil to start actually being consumed after the binary turns on, and no off delay. Ideally I want to track usage in Litres. How can I go about setting this up?
#Add a 'gas' source, with a binary sensor and known flow rate
1 messages · Page 1 of 1 (latest)
If you have a sensor of the flow rate, the integral of that is the consumption
You can make a template that is either 0 (off) or the flow rate when on
I have made a number Input helper for the flow rate, and two automations to set the flow to zero or value for the turn on and off events of the binary sensor. I have an integral sensor helper for the flow rate, but don't see where I can set a unit. The energy dashboard requires a volume unit to add the consumption
Make a template sensor.
If the unit is on, the value should be 0.75
If the unit is off, the value should be 0.
Set the unit for this sensor to "gal/h".
Then I think when you integrate this, the resulting unit will be "gal".
You may need to use customize to set the device_class to gas
I changed the value from 0.75gal to 2.84L to avoid the unit conversion now
Gal should be fine as well, but you can use L if you want.
You can use customize as well to force the unit of the integral sensor, but I don't think it should be necessary if the source is correct.
I'm in a metric country, and the oil is billed in litres too
Alright, I'm creating a template sensor for the flow rate, but L/h is not a valid unit for the device class 'gas'. An integral helper doesn't have the option to add a device class.
Yes, the flow rate will not be gas. The flow rate will be no device_class, and then you have to manually override the integral to gas
You can do it via customize
I have it all working with an input number being changed by 2 automations, and the integral of the input number. It outputs the desired unit of L (as a total, not resetting)
Integral will automatically convert a power device class to an energy device class, but we have no equivalent device class for "gas flow rate"
Ok, that's fine then if you want to keep that (just a little more convoluted to me, but it will work)
okay, I just need to override the integral helper then