Why is this sensor showing greyed out and 'unavailable?

I’ve added two sensors:

      friendly_name: Calculated feeds per day
      value_template: '{{ ((states.sensor.sunminutes.state | int / 60)) | int }}'

      friendly_name: Amount per dose at 20
      value_template: '{{ ((states.input_number.feed_amount_20 | int) / (states.sensor.calculated_feeds_per_day | int)) | int }}'

The first one shows up in the front end fine, but the second, feed_amount_per_dose, shows up as greyed out and unavailable.

Why would this be?

In the settings it shows:

This entity ("sensor.feed_amount_per_dose_20") does not have a unique ID, therefore its settings cannot be managed from the UI. See the [documentation](https://www.home-assistant.io/faq/unique_id) for more detail.

You can overwrite some attributes in the [entity customizations]( section.

I don’t have another with the same name. Is it badly defined in my YAML?

The first one works because it requests the state value of states.sensor.sunminutes like this:


The other two fail because they aren’t requesting the state value and attempt to use states.input_number.feed_amount_20 and states.sensor.calculated_feeds_per_day directly.

Modify the template so each one refers to the state value.

1 Like


Thank you so much.