So I've been putting together something that can read my gas meter - I'm using a hall effect sensor with the meter, and that seems to read off pulses (great). Now, the energy panel seems to require that I provide it with a sensor which reads incrementally increasing consumption (gas readout as if I were reading the numbers). So I need to turn a pulse reader into something that can sum up consumption and expose that. I've been looking at some example templates:
sensor:
- platform: template
name: "Gas used"
device_class: gas
unit_of_measurement: "m³"
state_class: "total_increasing"
icon: "mdi:fire"
accuracy_decimals: 2
lambda: |-
return id(total_pulses) * 0.01;
I do wonder however where the state for this is kept? Is it on the esphome node (seems unlikely), or in HA?