This will work with any meter that have a pulse on a specific quantity, the calculations need to be modified to that but the idea will work. Gas, water, energy, wind speed, what ever thing you can think of.
Maybe this can solve your issue:
Is it possible to also get instantaneous usage value out of it somehow? Like for example how majority of electricity meters make it possible. It would be nice to plot some nice graph out of it on my dashboard.
i want to try thisā¦
value_template: "{{ states ('counter.gas_counter') | float * 0.01}}"
is that what defines it?
ProTofik - can be calculated but you need to add a time component, like how many meters of gas/minute. The gas meter is not sending the impulse fast to calculate /second. You can see anyway in HA Energy how much gas you consumed /hour so it dos not make sense for me to create an sensor like this.
david1David - the template only calculates the real value on your gas meter in m3, basically the automation increase āhelper counterā and the template makes the real number on your gas meter. I done this so I can sync the meter reading outside with the one in HA. In my country you need to read the meter monthly and report it to the gas company, this way you can send the reading directly form HA, no need to get to the meter and check the numbers there.
Hello,
Iām a new greenhorn in HA, but since Iām sick at home 2 Weeks, I worked hard the last days to understand it.
I integrated the gas counter without problems 3 days ago. Ok, finding the right position for contact was really difficult.
It worked fine for 2 days, but yesterday it doesnāt count any more in the energie dashboard and the sensor.gas_meter says problems. The gas counter works fine, but in the statistics of sensor.gas_meter there are no updates.
So I checked the customize.yaml and it says failure because āstate_Classā is doubled in lineā¦
So I removed the āstate_Class: total_increasingā Now it said ok.
But in statistics, the sensor doesnāt worked. So I added the state_Class: total_increasing again. But it also doesnāt worked.
OK, then I removed the Sensor long therm statistics and the sensor and hoped, that it will now create a new one with restart from HA.
It created, but there wasnāt a button for the sensor.gas_meter to edit and see the statistic data anymore. It Also didnāt count in the energie dashboard again, but it seems to count in the detail view of the sensor itself.
Ok, it seems I totally messed it up.
So, I now set it up complete new with changed sensor names in all yamlās to sensor.gas_meter2 to create a complete new sensor to start from blank.
After restart, the sensor appeared and seems to count in history, but again, there is no edit button and no counting in energie dashboard. But it says no issue.
Then I remembered I installed node red addon and integration, maybe this caused Problems.
So I removed it, but nothing changed. And yes, I didnāt made a backup before installing node red, wasnāt clever.
So, here I am. Maybe some of you has an idea. When I have to set up HA complete new, it would be annoying for 3 day work, but tough luck!
Here is my customize.yaml
sensor.gas_meter2:
state_class: measurement
state_Class: total_increasing
last_reset: ā2021-08-20T06:43:36.740703+00:00ā
Counter Part from automations.yaml
- id: '1665776988103'
alias: GaszƤhler
description: ''
trigger:
- type: not_opened
platform: device
device_id: 578a59cedd92754eb53baae541a21deb
entity_id: binary_sensor.shellydw2_6f2c13_door
domain: binary_sensor
condition: []
action:
- service: counter.increment
data: {}
target:
entity_id: counter.gas2
mode: single
and configuration.yaml
# Loads default set of integrations. Do not remove.
default_config:
# Text to speech
tts:
- platform: google_translate
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
http:
ssl_certificate: /ssl/fullchain.pem
ssl_key: /ssl/privkey.pem
cors_allowed_origins:
- https://google.com
- https://www.home-assistant.io
ip_ban_enabled: true
login_attempts_threshold: 5
homeassistant:
customize: !include customize.yaml
sensor:
- platform: template
sensors:
### Gas meter template from counter
gas_meter2:
friendly_name: Gas Meter2
value_template: "{{ states ('counter.gas2') | float * 0.1}}"
unit_of_measurement: "mĀ³"
icon_template: "mdi:fire"
device_class: gas
# Example configuration.yaml entry with all entry types (delete/comment out as necessar
- platform: systemmonitor
resources:
- type: disk_use_percent
arg: /config
- type: disk_use
- type: disk_free
- type: memory_use_percent
- type: memory_use
- type: memory_free
- type: swap_use_percent
- type: swap_use
- type: swap_free
- type: processor_use
- type: processor_temperature
- type: last_boot
Many thanks
Timo
Oh,
I had an mistake in writing with the state_class: total_increasing I wrote it with upper C
So now, there are no attributes at Gas Meter2, but here is the failure I said before, with the duplicated state_class
it says duplicated mapping key
Edit:
It seems I solved it. It was the upper C
Now i created a third meter witch worked, then I deleted all added code, restart, now adding the original code, restartā¦
Now the previous sensor.gas_meter has itās edit button back. Only the previous data is goneā¦ so far.
The only thing now, it seems that there is no graph in the energie dashboard. Just the numbers in the circle and in the calculation under the graph
Edit 2
OK,
it seems to work fine now.
Sorry, if someone had already work with it.
Regards
Timo
Hi, another new comer here and I can promise you Iāve read all of the above posts and still I canāt get the Gas meter into my Energy Dashboard.
A slight change in my setup is that I have used Shelly Plus i4 to get the signal from my gas meter which is a U6P Diaphragm Gas Meter which was installed in 2015.
It has a Pulse Module & Lead for Gas Meter P/N 21423 which was installed with the meter:
I have wired up the Shelly i4 to use channel 2 as a switch for the pulse signal from the Pulse module and I can see that in the Shelly app I am getting signals
Using the Shelly integration I have integrated the i4 and have enabled the Binary Input Sensor and also see that I am getting a signal for each pulse
Using the code from above with the suggested recent modifications I have created the helper
I have added the automation
- id: '1667311475048'
alias: Gas pulse counter
description: Count gas meter pulses
trigger:
- platform: state
entity_id:
- binary_sensor.shellyplusi4_a8032ab0eb98_input_2
from: 'off'
to: 'on'
- platform: state
entity_id:
- binary_sensor.shellyplusi4_a8032ab0eb98_input_2
from: 'on'
to: 'off'
condition: []
action:
- service: counter.increment
data: {}
target:
entity_id: counter.gas_counter
mode: single
I have added the configuration.yaml components:
sensor:
- platform: template
sensors:
gas_meter:
friendly_name: Gas Meter
value_template: "{{ states ('counter.gas_counter') | float * 0.01}}"
unit_of_measurement: "m3"
icon_template: "mdi:fire"
device_class: gas
and have entered the customize.yaml requirements
sensor.gas_meter:
state_class: total_increasing
I can see that stats m3in Developers tools
I have checked the config in developers tools and restarted the HA server but still I donāt see the sensor in the Energy dashboard:
Any assistance would be greatly appreciated.
You are missing some attributes in customize.yaml
sensor.gas_meter:
state_class: measurement
state_class: total_increasing
last_reset: ā2021-08-20T06:43:36.740703+00:00ā
Hi @mpetcu when I add those lines to my customize.yaml I get the below error:
And going by previous replies to this thread it was suggested that last_reset was no longer required.
And after adding those lines I still get no sensor in the Energy Dashboard:
This may be one of the issues - HA may be filtering by the measurement units above that entity selector for the gas consumption. It may literally need to be mĀ³ and not m3. Iād clear the measurement and stats history for the entity too after changing it as Iāve found in the past that the old history with mixed units can keep it from cleanly switching over.
Hi Beatle,
Thank you for posting all this information here. While youāre looking for solutions to your step of the problem, you may have helped me with mine, sort ofā¦
This page:
has this:
Suffix P indicates a meter with a pulse facility; a pulse module and lead is not supplied with this meter.
Which is quite significant for me, as my gas meter here in Australia which looks identical to yours is conspicuously labeled U8. It took my mind back to the email from the Aussie meter supplier EDMI who said that they hadnāt supplied meters with pulse capability because there wasnāt enough demand for them from the gas companies here. And I was confused at the time, because I said I could see the little magnet going around on the cog. But now Iām wondering if itās just a piece of metal or plastic to keep the mass of the cog within specs. And if so, itās no wonder Iām having such trouble detecting it with a reed switch - thereās no blooming magnet!!
In any case, Iāve since tried just the guts of the aqara door sensor, without success, and my next attempt is going to be a hall effect sensor + esp32. If it isnāt a magnet attached to that cog, I can only hope its ferrous metal so I have a chance of picking up a wiggleā¦
@teleksterling you beauty, that fixed it for me but I had to go on a big learning curve to get this working as I had to clear the stats from the SQLite3 DB which doesnāt seem to be well documented, so I might just do that myself.
Now I have a Gas meter sensor:
And in the stats itās showing properly too:
Now just to wait for the Energy dashboard to start reflecting the Gas consumption with pricing and Iām all sorted
Hi all. Any Aussies have an itron branded meter? Could be a European brand too by the look of it?
I canāt detect anything with my aqara sensor so far.
Iāve tried sensing the last wheel which has a silver reflective section on the 0 position and also the dial that spins below the meter numbers. The clear plastic housing might be stopping me getting close enough.
I have all the code working, just triggering the sensor manually with a magnet for testing.
Check my initial post and stop the meter in the constant impuls state and try to find the position of the sensor, your meter has the marking 1 imp / 10dm3, witch means the second red number is the one that is sending the impulse.
Thankyou. Iāve tried stopping it as close as possible before and after 0 as pictured.
Iāve also tried taping the sensor in various locations and just running the gas to find anything. So far no pulses detected except with me manually using a magnet to ensure it works in the location network-wise.
Am I incorrect to assume the wheel at the bottom is what Iām meant to be detecting? Or is there actually a signal that gets transmitted only at the right time?
Edit Iām not opposed to drilling through the bottom of thatās going to work. i.e if the plastic is too thick?
As in the first post, the last number must be between 9 and 0, not exactly at 9 or 0.
The meter has an magnet so no fancy anything, if it has the impulse check meter instructions for the position of the original sensor. The magnet is closest to the original area when last digit is 9-0, that is the best time to detect his magnetic field.
Someone on the forum reported that his meter had a faulty magnet and the gas company replaced the meter with the same model and it worked after.
The manual for the meter says the pulse system is a cyble target. this is the rotating dial below the numbers. it rotates at the same rate at the last red wheel.
These Cyble sensors are purchasable but very expensive.
So this isnt using the meter numbers (wheels) at all. If there is a magnet on the second red wheel Iād need to cover the numbers in order to get close to it.
Edit, just saw that the target is non-magnetic so no good looking underneath near that. itās numbers or bust
From your information the meter has a different type of registering the pulse, not using a magnet. You can use a hall sensor and ESP board to figure out a way, but will not be easy as the Aquara sensor.