Auto-entities templating list of plants that need watering or fertilizer

The new auto-entities (https://github.com/thomasloven/lovelace-auto-entities) release with templating opens up a new world of possibilities.

Here’s how to show a list of moisture or conductivity sensors for plants that are in problem state:

card:
  show_header_toggle: false
  type: entities
filter:
  template: |
    {% for plant in states.plant %}
      {% if 'moisture low' in plant.attributes.problem %}
        {{ plant.attributes.sensors.moisture }}
      {% endif %}
      {% if 'conductivity low' in plant.attributes.problem %}
        {{ plant.attributes.sensors.conductivity }}
      {% endif %}
    {% endfor %}
type: 'custom:auto-entities'

There are some limitations. Mainly that they won’t automatically update on state changes unless the view is refreshed. You can add entity_ids to it to fix this as documented on thomas’ page.

1 Like