Energy Integration - It can't be just me

…that finds it incredibly hard to set up and frustrating to get any kind of useful documentation to help them?

It is very tempting to enter rant mode but I promise not to use the term ‘half-baked’.

I have tried for weeks to get this set up in a satisfactory manner and yes, for electricity it seems eventually to be ok (but it’s a shame there are some apparently undocumented ‘extras’ that need to be included in the customize section).

But gas? Oh no, that is a completely different story. I have started again many times.

To keep it simple, one step at time, with my latest attempt, what on earth is this error message telling me?

image

Because it is clearly wrong (or very badly worded)

Like I said, one step at a time but just to give an idea of the frustration, clicking on the link ‘More information on how to get started.’ takes you here which frankly is useless in the context of the error.

Is gas measured in kWh? killowatts per hour?

M³ is hardly an energy unit, so yeah, it’s transformed to kWh based upon the quality of the gas being delivered.

According to my provider, 1 m³ of gas is equivalent to between 9.5278 and 12.7931 kWh depending on where it comes from.

Ok, then shouldn’t the device class be energy? I don’t use this stuff. But as an engineer, I would expect the device_class gas to expect gas unit of measurements so it can do the conversions for you.

Yep. Looking at the code, it seems only “m³” and “ft³” are actually considered valid for gas.

So there is an issue, not sure if it’s the label or the code…

Yeah… that worked.

Like I said, very frustrating. (And not at all half baked :wink: )

Well not for nothing but to me, the first thing I saw was “Gas can’t be measured as energy because it’s a volume”.

I get what koying is saying, but I don’t really agree with it. Gas is gas and it has units. Energy is energy and it has units. This is outside of HA, I’m talking real world. I would expect HA to follow suit.

I’m not going to try to measure my car speed in kWh… I know you can get there… but it should be mph or km/h

Hang on a minute…
No it didn’t.

I thought it did
image

But when I went to add more entities I couldn’t because they weren’t there. And neither was the original one (Octopus Gas Consumption Night)

It seems if it is gas it needs to be device_class: gas
But then you can’t have unit_of_measurement: kWh

right… because kWh is energy…

I actually agree with you.
But my gas is metered in m3 (as is the case for most(?) people in the UK) but charged in units of kWh using an industry agreed conversion. So I need to convert it to kWh if I am to use the option of adding a cost per unit.

Then change your gas units to m3 with gas. Then move from there. I’m sure there’s some sort of tariff system setup for this stuff, if not make a template sensor that converts the m3 to w and track that.

That’s what I tried to explain, basically :wink:

I get it, I really do. But I haven’t gone through the process. He hasn’t even created it correctly to find out what the next steps are. It may just track volume consumption. If that’s the case then we’d have to do some other work behind it. Yes that may not be favorable, but at this point none of us know without doing it.

1 Like

I’m just going through the process I would go through when trying this crap out. Because yes, the docs are lacking.

  1. Make sensor that works
  2. See what it does.
  3. Adjust until I get what I want.

Yes I can do that and in fact I have. I was having such a nightmare with this Energy Integration that I made a Lovelece view to help me sense check what was going on.

But I don’t think what you are suggesting is compatible with the actual Energy Integration.

EDIT: Oh and yesterday the gas side was all in m3. I changed it today to match what I thought I needed to do in the Energy integration. So it works both ways. Just not (as far as I can see) in the energy integration.

That’s entirely possible, but how do you know without creating a proper gas entity? We already know 2 things:

  1. Gas requires m3 or ft3
  2. Energy requires w/h or kw/h

we don’t know:

  1. what gas does when set up properly, which is posted in things we know #1.

So just try setting it up with what it wants and see what it outputs.

I have. This one cannot be included in the Energy integration at all

        unit_of_measurement: kWh
        device_class: gas

This can but I cannot then track costs because they are in GBP/kWh

        unit_of_measurement: m³
        device_class: gas

Ok, then do you know the unit of your m3 to kw? Because at this point, you need to convert the gas consumption into kw or w then convert that into kwh or wh. Then use that entity as the energy entity.

Yes:

{% set consumption_m3 = states('sensor.octopus_gas_consumption_m3') | float(0) %}
{% set calorific_value = states('input_number.octopus_gas_calorific_value') | float(0) %}
{% set conversion = 1.02264 * calorific_value / 3.6 %}
{{ (consumption_m3 * conversion) | round(3) }}

image