Template: Don't see the virtual sensor

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?

If this is the first time you have used the template integration you need to restart home assistant. You can use the reload after that first restart.

Any time you add a new integration you need to restart.

Ah, thanks, that helped :slight_smile: