Good spot. It might not be a simple case of converting one to the other.
I just added a suggestion on githib (https://github.com/HandyHat/ha-hildebrandglow-dcc/issues/17) with the equation to convert from kWh to M3.
[gas kWh] * 3.6 / 40 / 1.02264 = approx [gas M3]
I’m new to home assistant so don’t know where/how to put this in. I think it can be done in yaml to create a new sensor?
This looks good! You can probably create a template sensor to give you the value you need.
Any advice? I think it needs to be a statistics sensor to show?
I’ve tried this and it’s not working
sensor:
- platform: template
sensors:
gas_in_m3:
unit_of_measurement: 'm3'
value_template: "{{ states('sensor.gas_consumption_today') | float * 3.6 / 40 / 1.02264 }}"
Have a look at my config here
I got mine finally working yesterday but I do have the Hildebrand IHD and pull my data via MQTT.
@HandyHat The integration remains active but is reporting zero consumption. I checked the Bright App and it also is reporting zero consumption, so I think there is an issue elsewhere.
I’ve got it working.
I added the following to my configuration.yaml
:
template:
sensor:
- name: Gas Consumption
unit_of_measurement: 'm³'
state: "{{ states('sensor.gas_consumption_today') | float * 3.6 / 40 / 1.02264 }}"
icon: 'mdi:fire'
state_class: total_increasing
device_class: gas
Thanks, I’ve got it working using this as well, well I say I think I have as my readings have stopped appearing on Bright but I think it’s an issue with my meters not reporting the reads…
Hi Guys
I have this working, but my gas readings seem to be the same every hour. It looks like its not clearing out a variable at the beginning of each hour.
anyone else see this
Electric looks fine though
cheers
Mike C
I really stuggled with this one.
The electricity consumption added fine when the energy panel was introduced after adding the last_reset for the sensor in the customize.yaml. With gas appearing with the new update I tried adding the gas sensor but to got “no matching statistics found”.
My sensor was as follows:
- platform: mqtt
name: "Home Gas"
icon: mdi:fire
state_topic: "SMART/HILD/xxxxxxxxxxxx"
value_template: "{{ value_json['gasMtr']['0702']['00']['00']|int(base=16) * value_json['gasMtr']['0702']['03']['01']|int(base=16) / value_json['gasMtr']['0702']['03']['02']|int(base=16) }}"
unit_of_measurement: "m³"
state_class: measurement
device_class: gas
This sensor also has the last_reset set in the customize.yaml
So I switched the state_class to total_measurement, and nothing. Everything seemed to match what others had set and it simply will not see it. I tried so many different combinations of settings and nothing would work. I ended up editing the config/.storage/energy file to add the source in manually and now it’s showing up. Not using much gas atm so will hopefully see it rise this evening once the water heats up.
I have the same problem. It might be because the sensor were getting the data from is cumulative for the day.
I’m also struggling to get this to work, everything I see is for Mqtt which I don’t use.
Make sure you set the state_class to total_increasing, the device_class to gas and have the correct unit of measurement (m³ not M3)
unit_of_measurement: m³
friendly_name: Approx gas in m3
device_class: gas
state_class: total_increasing
This is what works for me -
- platform: mqtt
name: "Gas M3"
state_topic: "SMART/HILD/XXXXXXXXXXXXX"
unit_of_measurement: 'm³'
value_template: "{{ value_json['gasMtr']['0702']['00']['00']|int(base=16) * value_json['gasMtr']['0702']['03']['01']|int(base=16) / value_json['gasMtr']['0702']['03']['02']|int(base=16) }}"
icon: 'mdi:fire'
state_class: total_increasing
device_class: gas
Something weird is going on. Even though mine is the same as yours, I copied your into my sensors.yaml and restarted - That then appears as sensor I can choose. :-/
I deleted my sensor and used yours except I changed the name back to “Home Gas”, restarted…It’s not available to choose. I restore my sensors.yaml back to the way it was, renamed the sensors from “Home Gas” to “Home Total Gas” and it appears. I dont get why it wouldn’t like the name, but that seems to have been the problem.
Maybe the last_reset
attribute was missing in customisations ? If you change the names the sensor name will also change as well.
Thanks for the heads up. I previously had it set to measurement
. Will this accommodate the fact that the sensor value resets every day?
Thats the bit that makes even less sense… the new sensor doesn’t have a last_reset in the customize.yaml:
Unlike my electricity sensor: