masaccio / ha-kingspan-watchman-sensit

Kingspan Connect Sensor integration for Home Assistant
MIT License
11 stars 0 forks source link

Documentation: How to hook this Oil stuff up to the 'Gas' part of the energy dashboard #31

Open dretful opened 3 months ago

dretful commented 3 months ago

Great project!

Now I want the data to be nicely visible in the energy dashboard, where the PV battery and electricity are.

There is only a spare slot for 'Gas' (there are other posts elsewhere about improving that) but I just borrowed it to show Oil. The only downside is the title - it still says Gas, but I know what it means :-) Also, there are special cases for the units here - only certain ones are allowed with Device Class: 'Gas' - I chose to work in m³. Be careful, its a superscript. But all the actual values are Wh (not kWh!) in these areas. The graph y axis and energy distribution map for 'gas' (oil!) shows m³, but I know what it means :-)

The dashboard wants to work at a faster rate than daily, but the data from the oil sensor, and the price of oil don't change that much (they are daily) so I went for an hourly approach assuming that the averages will work out across the day. Then it matches what the dashboard wants - and will only vary from day to day, probably overnight when the two da sources are updated.

This means you should ensure only one oil usage per day is reported in the energy dashboard, I changed “How often to refresh the tank data (hours)” in this integration configuration to 24.

It might be necessary to validate the tank levels with the daily usage over time to handle any rounding, if you are bothered about accuracy at that wider level, but for just monitoring what's going on this will do for me, and we do have the tank level to fall back on

Of course if you have knowledge of when the burner is running on the boiler and the flow rate when it is, then something better could be done, but then perhaps a validation against the expected burn volumes and the kingspan 'current rate' (daily) or the tank level would be needed.
For my use case and need, I don't really care when in the day the oil is being used, I'm more interested in how that changes as the outside temperature changes and the 'replacement' oil usage rate changes with it, and how much I'm spending in winter.

### I've tried to show that I have done:

Just to say to start, I called by Kingsman service 'Oil' - which matters later - or use your own name

oil

and I found it helpful to group all this around the area 'oil tank'

Prices: I needed to get the oil prices from somewhere. Inspiration from this: https://community.home-assistant.io/t/uk-oil-price-multiscrape-assistance-required/577701/13 To do it -

  1. Find your county - go here, https://homefuelsdirect.co.uk/home/heating-oil-prices/ceredigion select yours and make a note of the URL like the one above
  2. install Scrape. Then add one and configure it: Heating Oil Prices Ceredigion
resource

Add your sensor (I was just getting the 500 litre price)

sensor

... and you get an entity:

entity
  1. Add in input number for the energy density of oil (which the web says is 10350 Wh/L)
    • Helpers/Create/Number for Oil Wh/L its a constant but better not buried in a formula.
input_number heating_oil_wh_per_l

4: add three helpers: Helper/Create/Template (Install Template if you didn't already first!) with these state classes, Units and Devices

1

State class:{{ states('sensor.current_usage') | float * states('sensor.heating_oil_prices_ceredigion') | float / 24 /100 }} Units: GBP Device : Oil

2 3

State class:{{ states('sensor.current_usage') | float * states('input_number.heating_oil_wh_per_l') | float }} Units: m³ This cant be 'Wh'- only certain units are allowed with the Gas section Device Class: Gas this cant be 'Energy' - that's for solar and electricity State Class: total Increasing Device : Oil Label: optional, but I thought it helped remind me....

4

-oil_price_perwh (edit was called "oil_price_this_hour_pounds_perWh" but rename clearer)

5

State class:{{ states('sensor.heating_oil_prices_ceredigion') | float /100 / states('input_number.heating_oil_wh_per_l') | float }} Units: GBP/m³ This cant be 'GBP/Wh'- only certain units are allowed with the Gas section State Class: Measurement Device : Heating Oil Prices Ceredigion Label: optional, but I thought it helped remind me....

6

Then, in your Energy dashboard ( the one that comes with the system by default) you can configure "Gas" - for your Oil.

Energy configuration > Gas consumption > add gas source

gas source

then pick up the two entries you need as below

gas config

the dashboard gains a gas element, just ignore the m³ its Kw

distribution with gas-oil

and also a graph, just ignore the m³ its Kw:

gas-oil consumption

so what we have is entities with units that are allowed by the GAS processing screen and that's why it was allowed to be configured.

oil tank entities

and you can add a gauge to your own dash showing how much your comfort is costing you (on average) every hour (its summer right now):

oil spend gague

Wouldn't it be nice if this could just be added to an 'Oil' section with the right labels and units?

Well, its a hack, but it works as far as I can tell, and I hope it complements the great work by others.!

hilburn commented 1 week ago

Just because I enjoy poking at this kind of stuff (and I'm waiting for some sensit connection issues to finalise so I can actually start pulling in data), I've been looking at improving the granularity of the data when used like this.

Each of my heating zones has an approximate weight - based on number/size/type of radiators in it and as they all have electric trvs I can track how much they are used per day and once I have the oil data I can use each days total "weighted heating hours" to calculate a cost for the next day and use this for a live value based on radiator usage.

Annoyingly I don't have a hot water flow sensor, so that might be the next step, rather than just guessing based on number of showers and if the dishwasher and washing machine ran today to correct for that part of the consumption.