Hi Marius. Great project. Was struggling with using an esp-01 where the Aqara is in your project. Failed miserably! I’ve followed your instructions and other snippets in this blog to the letter and although I’m getting the open/closed status from the Aqara and I’m able to insert the counter into the Energy dashboard, I don’t seem to be getting any increments when I know I’m using gas. I too am using the Zigbee Dongle and getting a linkquality of about 10. I’m also getting messages in Node-Red but I can’t seem to filter out the ‘closed’ status to use the data elsewhere. I’ve gone over the instructions numerous times but still unable to make it fully work. Any advice?
Hello, my take is to dich all RedNode staff and just follow my automation for incrementing the counter.
Is just a simple automation can be created in the visual editor. If you get the open Open/Closed status you may need to replace it in the automation. My is based to on/off status.
Hi. You’re right regards Node-RED. I need to get the counter incrementing first! When I select Automations via Configuration there doesn’t seem to be one. So what’s the Counter created in Helper doing? Also I have cleared all references to the project in Config, customization and automation yaml’s and started again. In your Automation yaml you show line entity_id 0x158d000etc. Is the hex address unique to you as my door sensor has a slightly different 08a09f_contact. Is this relevant? Thanks for your advice, very welcome.
Found the Error. The underscore in counter.gas_counter is not allowed. Changed everything to counter.gas and it started working.
It’s counting but I don’t know if it is all set and done yet.
Is there a way to add my total m3 gas used (number from my analog gas meter) in a sensor and add the counter to that sensor too to see my total gas used on the go?
Eventually got this working. Binned Node_RED. Good call!. I have a request from any member of the forum: how can I create a counter in Lovelace which mimics the actual gas meter reading, example 23456.021? I understand that floats and counters per say don’t do decimals, so is my plan even possible? Anyone tried?
I have received today my aqara door sensor, but I have problems to get the counter correct into HA.
I have added the following into my configuration.yaml:
- platform: template
sensors:
### Gas meter template from counter
gas_meter:
friendly_name: Gas Meter
value_template: "{{ states ('counter.gaszaehler') | float * 0.01}}"
unit_of_measurement: "m³"
icon_template: "mdi:fire"
device_class: gas
When I check my configuration under server control everything is ok until here.
Hey everyone, great project, looking into this as well. What’s your experiences with battery life so far? Thinking about trying it with the Lidl window contact, and replacing the AAAs with AAs.
From my experience until now and my calculations if you are a “home user” and your average consumption per month is about 250m3 of gas in winter and about 10m3 in summer.
Your sensor will open/close about 800 times per day in winter for about 3-5 months the rest we can assume is normal usage for the sensor, battery of Xiaomi sensor is rated one year (cr2032) with normal usage so determined that the normal battery will last no more then 3-4 months in winter.(not taking in consideration the cold temperature that will just destroy the CR2032)
I have added an AA 3.2V Feo4 rechargeable battery and since 4 months is still at 100% but the reading of the sensor is made for the CR2032 voltage curve so I do not trust the status.
If the Lidl sensor has AAA battery’s from the start I will not bother replacing them just test and see how much it lasts.
New user here, so I’m still on the steep learning curve.
I have an Aqara sensor that I want to use to read my Landis and Gyr 750 meter (earlier post from another Aussie said that it will work (thanks mate!))
I have created everything, when I swipe the magnet past the sensor the counter increments. The Gas symbol displays on my energy dashboard, but I’m not reading any usage. I’m trying to get the working on the bench before moving to the Gas meter cabinet (which will be fun because it’s metal).
I have:
counter.gascounter
sensor.gasmeter
So after all that preamble here’s my setup in home assistant (which runs on a PI with an external HDD).
Automations:
================================================================
- id: '1645368831245'
alias: Gas Counting
description: Gas Meter Consumption
trigger:
- platform: state
entity_id: binary_sensor.lumi_lumi_magnet_acn001_60c22500_ias_zone
id: Aqara Gas Meter
from: 'off'
to: 'on'
condition: []
action:
- service: counter.increment
target:
entity_id: counter.gascounter
mode: single
configuration.yaml
================================================================
# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:
# Text to speech
tts:
- platform: google_translate
group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
homeassistant:
customize: !include customize.yaml
sensor:
- platform: template
sensors:
### Gas meter template from counter
gasmeter:
friendly_name: Gas Meter
value_template: "{{ states ('counter.gascounter') | float * 0.01}}"
unit_of_measurement: "m³"
icon_template: "mdi:fire"
device_class: gas
customize.yaml
================================================================
sensor.gasmeter:
state_class: total_increasing
last_reset: '2021-08-20T06:43:36.740703+00:00'
I’m obviously doing something wrong, but I can’t figure out what.