Logic diagram in Details

Automations have their own diagram, but these only show the operations inside a single automation.

I wanted to illustrate how “this” automation fits in with the “other” automations for a given feature set.

In my example, I have four individual automations:

  1. Turn the lights on in the garage when any door opens.
  2. Set a timer to turn off the lights, when all doors are closed.
  3. Add more time to the timer, if motion is detected
  4. Turn off the lights when the timer finishes

Because these are all individual automations it gets a little confusing when thinking about how all these work together.

Mermaid to the rescue. Mermaid is a text-to-visual diagram markdown language. There is a free online editor site at workflow.jace.pro. No affiliation.

When all of the individual automations are working as expected. I goto that website and update the diagram for a particular feature set. Then I copy the raw mermaid markup from the website. In Home Assistant I open the automation → three dot menu button → Rename. In the description block the raw text is inserted between triple backticks, like this:

```mermaid
<replace this line with mermaid text>
```

The site also offers a preformated link already in markdown mode. This link gets pasted into the description block too. And voila notes to help future-me understand a feature set.

Here is what the final version of my “Garage lights on” automation looks like in Home Assistant.

2 Likes