I want to track how much m3 of gas I consume on heating. I have my heating system connected to a switch, and I have set up a generic thermostat. When heating it consumes 1 m3 per hour.
I set up a utility meter to track consumption but I don’t think is behaving the way I intended. It just adds 1 m3 every time it goes from idle to heating, instead of tracking minutes heating. I made a sensor that returns 1 when the switch is on, and 0 when off, and a utility meter to read that sensor.
Did I get something wrong?
This is my configuration:
utility_meter:
consumo_gas_dia:
source: sensor.calefaccion_central_calentando
cycle: daily
consumo_gas_mes:
source: sensor.calefaccion_central_calentando
cycle: monthly
sensor:
- platform: template
sensors:
calefaccion_central_calentando:
friendly_name: Calentando
unit_of_measurement: 'm3'
value_template: "{% if states('switch.0x00158d000427fce2_switch_l1') =='on' %}1{% else %}0{% endif %}"