Documentation

Automation

Build powerful automations by combining triggers, actions, and sequences to create responsive garden systems.

Overview

Automation in MudPi follows a simple pattern: an event is detected, a trigger evaluates the condition, and an action is executed. By chaining these together, you can build complex, responsive systems that manage your garden automatically.

Basic Automation

The simplest automation connects a soil moisture sensor to a water pump. When moisture drops below a threshold, the pump turns on:

JSON
Click to expand code…

Adding Safety with Trigger Groups

Real-world systems need safety checks. You can use trigger groups to ensure multiple conditions are met before taking action. For example, adding a float sensor to prevent the pump from running when the water tank is empty:

JSON
Click to expand code…

Warning

Never automate pumps or valves without safety triggers. A stuck pump can cause flooding or burn out. Use float sensors, timers, and trigger groups to protect your system.

Complex Multi-Sensor Automation

You can build sophisticated automations that monitor multiple environmental factors. Here's an example that manages a greenhouse with temperature, humidity, and light control:

JSON
Click to expand code…

Automation Sequences

Sequences allow you to chain multiple actions together with timing and conditions between each step. This is useful for multi-step processes like watering routines that need to run in a specific order with delays.

Each step in a sequence can have a duration (how long to wait before the next step) and optional thresholds that must be met to proceed:

JSON
Click to expand code…

Tip

Combine sequences with cron triggers to run watering routines on a schedule. Use thresholds within sequence steps to skip watering zones that are already moist.