Creating (and Removing) Sensors from an Input_Number

Hi there,

I’m trying to create a sensor so that I can manually input and monitor water usage.
I’ve created a helper (called input_number.water_meter_3) and from this have created a section of the dashboard to manually input readings.

I’m then trying to create a sensor from the input number so I can build it into the energy dashboard but it doesn’t appear to be working. Any ideas from the code below?

Also, any ideas how to delete previous input helpers (which I’ve now disabled). They appear hidden in “entities” but I can’t seem to delete them.

Thanks,

  - platform: template
    sensor:
      name: "Water_Usage"
      unit_of_measurement: "m³"
      value_template: "{{ states.input_number.water_meter_3.state }}"
      state_class: total_increasing
      device_class: water

What isn’t working?

You have defined a Template Sensor using legacy format. This older format doesn’t allow you to specify state_class in its configuration.

I suggest you delete it and create a Template Sensor using modern format (which supports state_class in its configuration).

An alternative is to create a Template Sensor helper.

1 Like