Keeping houseplants healthy can be challenging, especially when juggling a busy schedule. Thankfully, with Home Assistant and the Home Assistant Plant Integration, you can automate plant care and receive timely alerts when your plants need attention.

🧰 Prerequisites

Before setting up the automation, ensure you have:

  • Home Assistant is installed and running.
  • The Home Assistant Plant Integration by Olen is installed. This integration allows you to monitor various plant parameters like moisture, temperature, light, and more.

The Automation: Keep Your Plants Healthy Automatically

We’ll create an automation that triggers when any plant goes into a “problem” state, and then sends a detailed notification about what’s wrong with the plant. This includes:

  • The plant’s name (e.g., Plant 1)
  • The area where the plant is located (e.g., Living Room)
  • What’s wrong (e.g., moisture is low, temperature is too high)

Here’s how you can set it up:

⚙️ The Automation

This automation monitors multiple plants and sends a notification when any of them report a problem. The notification includes:

  • The plant’s name.
  • The area where the plant is located.
  • Specific issues detected (e.g., low moisture, high temperature).

Here’s how to set it up:

1. Define the Trigger

The automation triggers when any specified plant entity changes its status to ‘problem’:

trigger:
  - platform: state
    entity_id:
      - plant.plant_1
      - plant.plant_2
      - plant.plant_3
    to: 'problem'

Replace plant.plant_1, plant.plant_2, etc., with your actual plant entity IDs.

2. Configure the Action

The action sends a notification detailing the plant’s issues:

action:
  - service: notify.mobile_app_your_phone  # Change to your notification service
    data:
      title: "Plant Problem 🌿"
      message: >
        {% set entity_id = trigger.entity_id %}
        {% set plant_name = state_attr(entity_id, 'friendly_name') or entity_id %}
        {% set area = area_name(entity_id) or 'unknown area' %}
        {% set problems = [] %}

        {% if state_attr(entity_id, 'moisture_status') not in ['ok', 'OK'] %}
          {% set problems = problems + ['Moisture: ' ~ (state_attr(entity_id, 'moisture_status') or 'unknown')] %}
        {% endif %}
        {% if state_attr(entity_id, 'temperature_status') not in ['ok', 'OK'] %}
          {% set problems = problems + ['Temperature: ' ~ (state_attr(entity_id, 'temperature_status') or 'unknown')] %}
        {% endif %}
        {% if state_attr(entity_id, 'conductivity_status') not in ['ok', 'OK'] %}
          {% set problems = problems + ['Conductivity: ' ~ (state_attr(entity_id, 'conductivity_status') or 'unknown')] %}
        {% endif %}
        {% if state_attr(entity_id, 'illuminance_status') not in ['ok', 'OK'] %}
          {% set problems = problems + ['Light Level: ' ~ (state_attr(entity_id, 'illuminance_status') or 'unknown')] %}
        {% endif %}

        The plant {{ plant_name }} in {{ area }} has the following issues:
        {{ problems | join('\n') }}

Ensure you replace notify.mobile_app_your_device with your actual notification service.

3. Complete Automation

Combine the trigger and action into a full automation:

alias: Notify Plant Issues
trigger:
  - platform: state
    entity_id:
      - plant.plant_1
      - plant.plant_2
      - plant.plant_3
    to: 'problem'
action:
  - service: notify.mobile_app_your_phone  # Change to your notification service
    data:
      title: "Plant Problem 🌿"
      message: >
        {% set entity_id = trigger.entity_id %}
        {% set plant_name = state_attr(entity_id, 'friendly_name') or entity_id %}
        {% set area = area_name(entity_id) or 'unknown area' %}
        {% set problems = [] %}

        {% if state_attr(entity_id, 'moisture_status') not in ['ok', 'OK'] %}
          {% set problems = problems + ['Moisture: ' ~ (state_attr(entity_id, 'moisture_status') or 'unknown')] %}
        {% endif %}
        {% if state_attr(entity_id, 'temperature_status') not in ['ok', 'OK'] %}
          {% set problems = problems + ['Temperature: ' ~ (state_attr(entity_id, 'temperature_status') or 'unknown')] %}
        {% endif %}
        {% if state_attr(entity_id, 'conductivity_status') not in ['ok', 'OK'] %}
          {% set problems = problems + ['Conductivity: ' ~ (state_attr(entity_id, 'conductivity_status') or 'unknown')] %}
        {% endif %}
        {% if state_attr(entity_id, 'illuminance_status') not in ['ok', 'OK'] %}
          {% set problems = problems + ['Light Level: ' ~ (state_attr(entity_id, 'illuminance_status') or 'unknown')] %}
        {% endif %}

        The plant {{ plant_name }} in {{ area }} has the following issues:
        {{ problems | join('\n') }}
mode: single

📱 Example Notification

When a plant reports an issue, you’ll receive a notification like:

Plant Problem 🌿
The plant Ficus in Living Room has the following issues:
Moisture: Low
Light: Insufficient


This prompt alert allows you to take immediate action to care for your plant.

📝 Conclusion

With this automation, you can ensure your plants receive timely care, enhancing their health and longevity. Integrating smart technology into plant care simplifies maintenance and brings peace of mind.

Feel free to customize the automation further to suit your specific needs, such as adding more plants or integrating additional sensors.

By Lars

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.