#How to integrate a Gas Meter into Home Assistant?

1 messages · Page 1 of 1 (latest)

lofty fjord
#

I have a gas meter that is able to poll the meter reading value via BLE. I would like to create an integration for this.
What kind of entity/sensor should I present it to home assistant? In what unit?

I have figured out how to pull data with Python Bleak. Just need to integrate it into an integration.

sacred lotus
#

Not sure how this is a question we could answer. You likely want to expose details you think are important in a way that they are useful to you. The more details you can read directly from the meter the less templating you may need to do in homeassistant to further use those results.

tawdry scroll
#

Maybe as a reference: I have a HomeMatic gas counter that reports recent power and a full count in cubic meters, I have a template sensor that converts the cubic meters into kWh according to energy density and environmental correction factor as published by my gas provider.

#

If your BLE counter would only provide the cubic meter count, you would need to add a template sensor for the power sensor as well

lofty fjord
tawdry scroll
#

really impossible to say with an image that may or may not be of your counter, you should check with your gas meter provider for details

normal frost
#

CF is indeed cubic feet, which is the standard in (sighs most of) the US.
You can either just read this directly as a volume or, as @tawdry scroll mentioned - you can then multiply that by the energy density of the gas (either pick a static value, or work out something more dynamic using environmental factors based on your location, or pull from your supplier or whatever)
If you go the route of a dynamic energy calculation, you want to keep an internal total and add the change*energy density to it rather than just multiplying the total volume or you'll see big consumption swings as the density changes through the year

buoyant stream
#

Note CF not to be confused with CCF, which I have personally seen more often than CF.

fathom silo
#

A lot of these meters have a magnet on the most granular wheel - so you should be able to read it with a hall effect sensor.

lofty fjord
wet gyro
slow bridge
#

If you would share a Brand and Model, that would help a lot. If it is a kind of Smart Meter, and used in a commercial environment, then it likely will have an encryption which needs to be handled. So with Brand and Model you could help to narrow down what you really need to do. I have not read, that you managed to read it already. You need sensor, unit_of_measurement: ft³ device_class: gas state_class: total_increasing according this topic and comments: https://community.home-assistant.io/t/adding-gas-to-energy-dashboard-solved/334988/

lofty fjord
# slow bridge ~~If you would share a Brand and Model, that would help a lot. If it is a kind o...

I am looking at https://developers.home-assistant.io/docs/core/entity/sensor/
and I am wondering if I should useSensorDeviceClass.GAS SensorDeviceClass.VOLUME or SensorDeviceClass.VOLUME_STORAGE(obviously not this, right? since it is not storing)

A sensor is a read-only entity that provides some information. Information has a value and optionally, a unit of measurement. Derive entity platforms from homeassistant.components.sensor.SensorEntity

slow bridge
#

If you want to add it to your energy dashboard, I think that you need to use gas

lofty fjord
#

also, where can I see what data type does it accept?

lofty fjord
slow bridge
#

When you are paying for your gas consumption, you are paying for the used amount of energy (kWh or kiloJoule), that is calculated from the measured amount of volume, which has passed through your meter, and it is multiplied by a factor, which defines how much kWh of energy is in 1 unit of volume. So, let's say, you have a remote reading meter on your gas meter, which supplies the amount of volume which you used per hour, and the supply company calculates the amount of energy used from that, and provides with that through an API, then you would use that value as kWh and would define as energy.

#

These factors usually are all the same for extended periods. Maybe change a little bit, because the gas is supplied from the same source.

#

Of course, you might have heard from older relatives, especially if you are from an Eastern European country, that the color of burnt gas is blue or yellow, and indicating that the gas which is supplied has different content (ratio of burnable gas and oxigen), and of course you are charged for the energy, but measured by the volume.... 😉

lofty fjord
slow bridge
#

Yes, you should use .GAS

lofty fjord
#

do I return a float?

#

I think float is not accurate? like 0.1+0.2 == 0.3 will return false

#
>>> 0.1 + 0.2 == 0.3
False
>>> 0.1 + 0.2
0.30000000000000004
slow bridge
#

Does it really matter?

#

You are returning the value what the meter provides, right?

lofty fjord
#

maybe not but I just want to make sure what kind of variable it accepts

#

like the data type

slow bridge
#

I cannot really help with that.

lofty fjord
#

the meter provides the data as a byte that is human readable 😅

#

like if the meter reads as 123.45 cubic feet, it will return b'\x00\x01\x23\x45'

slow bridge
#

I assume that your meter is likely measuring down to two decimals.

lofty fjord
#

yes 2 decimals

#

it is a battery powered device with BLE attached to a dumb meter by the gas company

slow bridge
#

What device is it? And meter do you have?

lofty fjord
#

I have no idea as it is branded with the gas company name

#

I mean the BLE device

#

presumably a custom device I think

#

but the meter is a Zenner meter

slow bridge
#

Is it a G4S like on your picture?

lofty fjord
#

Zenner Atmos U6(V) Class 1.5

slow bridge
lofty fjord
#

right

#

still figuring out how to present it to home assistant

#

I just finished the BLE device selection based on the generic bt integration

#

I have no idea how to present an entity to home assistant yet, still looking into it

slow bridge
#
LINE TODAY

經常「大頭蝦」忘記熄火的人外出時毋須再「心掛掛」了!香港中華煤氣自行研發智能控制器、智慧熱水爐等產品,採用物聯網(IoT)技術,用戶可經手機遙距監察煮食爐情況,亦能緊急熄火,或者調節熱水爐的出水溫度等。公司期望能利用科技,全面保障用戶家居安全。而3項智能產品已在樂富領展可持續未來館展出。 煤氣公司介紹,今日(3日)起至明年5月底在可持續未來館展覽的「適得『耆』所」專題展區中,展出3項自行研發的智能產品,包括最新推出的智慧熱水爐應用IoT技術,令用戶的手機可遙距開關爐具和調節出水溫度,並可監察每天用氣及用水量,安全便捷。 同樣使用IoT技術的智能控制器則可連接用家現有煮食爐,透過手機監察煮食爐情

lofty fjord
#

looks like it

slow bridge
#

Those are cubic feet models.

#

On one of the pictures it is visible clearly the flow rate description.

#

"clearly"

lofty fjord
#

I did say cubic feet

paper bane
#

If you are in metro Atlanta area using Atlanta Gas Light, you can use a SDR USB doggie to receive the gas meter data from 915MHz. The rtl_433 addon and its discovery supports it right out of the box, though you will need to modify the Consumption entity by adding device class ("gas") and unit of measurement (CF). Let me know if you need more details.

#

It is updated every 2-9 minutes.

wet gyro
paper bane
wet gyro
paper bane
wet gyro