I have been able to get the template sensor example on the home assistant website to show up, however this follows a different syntax, and I do not know how to get this to link with the rest of the setup in the reddit post linked above.
So if I uderstand correctly the state of the following entity is a number of m3 (consumption or number of m3 for a certain period of time):
input_number.gas_meter_m3
How frequently this entity is refreshed ? Is it the consumption since the last update ? or the consumption since the beginning of the day or hour ?
The formula that you have in your template transforms I think that consumption in kW or kWh
template:
- sensors:
- name: "gas meter kW"
unit_of_measurement: "kW"
state_class: measurement
device_class: power
state: "{{ states('input_number.gas_meter_m3') | float(default=0) * 1.02264 * 39.2 / 3.6 }}"
More details is required to understand your project...
Thanks browetd for the suggestions.
Yes the template was to transform kW into kWh, and it is refreshed every time there was an update to the kWh reading.
I have now actually round the reason the template sensor wasn’t showing up. I had two sections of template sensors in my configuration.yaml which needed to be grouped under one template: all the template sensors together otherwise one lot of the sensors would show up. Thanks for your help!