I have a vzlogger instance running that posts my gas meters impulses to HA. I am somehow lost now how to convert these impulses to m3 and kwh and how to use the values also as utility meter for the energy dashboard.
pi@rpi-vzlogger:~ $ cat /var/log/vzlogger.log | grep chn2
[Apr 28 07:29:56][chn2] New channel initialized (uuid=...f68014 api=volkszaehler id=Impulse)
[Apr 28 07:30:07][chn2] Adding reading to queue (value=1.00 ts=1651123807015)
[Apr 28 07:31:51][chn2] Adding reading to queue (value=1.00 ts=1651123911626)
[Apr 28 07:32:51][chn2] New channel initialized (uuid=...f68014 api=volkszaehler id=Impulse)
[Apr 28 07:33:01][chn2] Adding reading to queue (value=1.00 ts=1651123981001)
[Apr 28 07:34:12][chn2] Adding reading to queue (value=1.00 ts=1651124052494)
[Apr 28 07:35:24][chn2] Adding reading to queue (value=1.00 ts=1651124123924)
Note: if you want to have an entity in your HA that shows the last update of the MQTT sensor, add this, including the force_update:
- platform: mqtt # not needed, just for displaying in the ui
name: "gas_impulse"
state_topic: "vzlogger/data/chn2/raw"
value_template: "{{ value_json.value | round(0) }}"
force_update: true
Now you can derive the needed values from the counter. The conversion factor from m3 to kWh can be found on your gas bill.