I need to have some “virtual” sensors, so I added some templates, e.g.:
template:
- sensor:
- name: waermepumpe_momentanwirkleistung
unique_id: "waermepumpe_momentanwirkleistung"
unit_of_measurement: 'W'
state: >-
{{(float(states('sensor.stromzaehler_gesamt_momentanwirkleistung')) - float(states('sensor.stromzaehler_haus_momentanwirkleistung')))| round(1) }}
device_class: "power"
I tested the state in the template tab in the development tools and reloaded the whole config, but I don’t find the sensor, even not at the states tab in the development tools. Where is my mistake?