Building on the post [Gas meter from Xiaomi/Aqara door sensor (ZigBee)
(Gas meter from Xiaomi/Aqara door sensor (ZigBee))
My utility company is converting over to smart meters. For electricity and water they have replaced the meters. But, for the gas, they retrofit the meter. The retrofit added a device that attaches to it with reed switches and a magnet. The magnet attaches to the two feet dial, which for one complete rotation it used 2 cubic feet.
The biggest problem I had was attaching the sensor and external reed switch. So I designed and printed a bracket.
This is the reed Switch:
This is the door sensor:
Link to Thingiverse:
I am still working on this so please use, update as need, and add any suggestions and mods.
config.yaml
homeassistant:
customize: !include meters/customize.yaml
sensor:
- platform: template
sensors:
### Gas meter template from counter
gas_meter:
unique_id: 000000000000000001
friendly_name: Gas Meter
value_template: "{{ states ('counter.gas_meter_binary') | float * 2 }}"
unit_of_measurement: "ft³"
icon_template: "mdi:fire"
device_class: gas
customize.yaml
sensor.gas_meter:
state_class: measurement
state_class: total_increasing
last_reset: '2024-11-28T11:00:00.000000'
#last_reset: '2024-05-04T11:00:00.010644+00:00'
sensor.gas_meter_binary:
state_class: measurement
state_class: total_increasing
last_reset: '2024-11-28T11:00:00.000000'
#last_reset: '2024-05-04T11:00:00.010644+00:00'
Automation
alias: Gas Counting
description: ""
triggers:
- entity_id:
- binary_sensor.aqara_sensor_magnet_aq2_opening
trigger: state
from: "on"
to: "off"
conditions: []
actions:
- action: counter.increment
data: {}
target:
entity_id: counter.gas_meter_binary
mode: single