How to build a multi-step automation: pump control, fish feeder, camera snapshot & AI analysis?

Hi everyone, I’m building a multi-step automation in Home Assistant and I’d like some advice on the best way to structure it.

Here is the workflow I want to achieve:

  1. 7:00 – Turn off the water pump
  2. 7:05 – Turn on the fish feeder for 1 minute, then turn it off
  3. 7:06 – Trigger a camera to take a snapshot of the feeding area
  4. Send the snapshot to an AI Vision service (OpenAI Vision, Gemini, Frigate+LLM, etc.) to check:
  • Whether food has actually dropped into the water
  • Optional: whether fish are gathering around the feeding spot
  1. Based on the AI result, send me a notification (e.g., “Feeding successful” / “No food detected”)
  2. 7:10 – Turn the water pump back on

My questions:

  • What is the best practice to implement this workflow in Home Assistant?
  • Should I break it into multiple automations, scripts, or one large automation?
  • What is the most reliable way to trigger camera snapshots at a precise time (Frigate vs. direct camera integration)?
  • For image analysis, should I use AI Task, LLM Vision, Frigate, or call an external API?
  • How do you recommend handling the AI result (JSON structure, variables, conditions) inside HA automation?

Any tips, example YAML, or recommended architecture would be greatly appreciated.
I want this routine to be stable and accurate because it’s part of a daily smart-aquarium setup.

Thanks in advance!

First make for each step a separate automation. That will simplify things on debugging, control and implementation.
Later, if each step is working as designed then you can think about merging it together although there would be no need for it.

2 Likes

Hello Phạm Quang Sáng,

In addition to what @AshaiRey said, add an action in each of those to set the value of a number helper to 1, then 2, etc at the end of each step and look for the correct number as a condition at the top of the next step. Tweak some logic around that as you will, but it will make sure the prior operation completes before it does the next operation, or optionally notify you of a sequence problem. At the end of the last step set it back to 0.

A way to keep them in order and sequence. Just a suggestion…

1 Like