M-UI documentation

Build an automation that works.

M-UI Studio is a local-first visual editor for Home Assistant YAML and Node-RED JSON. This guide covers the complete workflow from a blank canvas to a tested export.

Quick start

  1. Open the builder or choose a template.
  2. Add a trigger from the block library. Sensors become triggers automatically; lights and relays become actions.
  3. Add an action, then drag from the trigger’s right handle to the action’s left handle.
  4. Select each node and configure its entity ID and behavior in the inspector.
  5. Run a simulation, review the generated code, and download or copy it.

Your project autosaves in the current browser. It does not sync to another browser or device, and clearing site data removes it. Download JSON for a durable backup.

Nodes & connections

Trigger

Starts an automation. Device triggers support state changes and numeric thresholds. The Schedule block runs daily at a specific time.

Condition

Filters a running path using an entity state or a numeric above/below comparison. Set the entity ID explicitly when using the generic Condition block.

Delay

Waits a configurable number of seconds before the next step. Delays are written into Home Assistant’s action sequence.

Action

Turns a device on or off, toggles it, or sends a notification. Light actions can include brightness.

You can change a node’s role in the inspector. M-UI prevents self-connections, duplicate links, action outputs, trigger inputs, and circular paths.

Validation & simulation

The toolbar reports incomplete or disconnected logic. Open Simulate in the output panel, select a complete trigger-to-action path, and choose Run simulation. The active node is highlighted on the canvas as each step executes.

Simulation checks path structure only. It does not evaluate live entity states and never changes a real device. Use the Home Assistant test control for a real automation trigger.

Save, share & export

  • Save downloads the complete versioned flow as JSON, including node positions and settings.
  • Import restores current and legacy M-UI JSON files. Invalid files show a readable error.
  • Share encodes the complete flow into the page URL. No project data is uploaded to M-UI.
  • Home Assistant YAML creates one automation per complete branch, including conditions, delays, and actions.
  • Node-RED JSON preserves node positions, wiring, configuration metadata, and schedule settings.

Review generated entity IDs before installing an automation. Bundled example devices use placeholder IDs such as binary_sensor.aqara_motion; connected Home Assistant entities use their real IDs automatically.

Home Assistant

Choose Connect HA and enter your server URL and a long-lived access token. Create tokens in Home Assistant under Profile → Security → Long-lived access tokens.

The browser connects directly to your server. The URL and token are stored only in this browser’s local storage. Your server must permit CORS, and an HTTPS M-UI page requires an HTTPS Home Assistant URL.

Direct push with M-UI Bridge

Copy custom_components/m_ui/ into your Home Assistant /config/custom_components/m_ui/ directory, restart Home Assistant, then add the M-UI Bridge integration. Once connected, the export panel enables Push, Reload, and Test.

Push requires the bridge. Reload calls Home Assistant’s automation reload service. Test triggers an existing automation and can change real devices.

Add a device

Create a JSON file in public/devices/ following lib/types.ts, then add its filename to public/devices/index.json. A device defines its identity, capabilities, integration metadata, Home Assistant entity hint, and optional actions.

{
  "id": "my-motion-sensor",
  "brand": "Example",
  "category": "sensor",
  "name": "Hallway Motion",
  "capabilities": ["motion"],
  "inputs": [],
  "outputs": [{ "id": "motion", "type": "binary" }],
  "integrations": {
    "home_assistant": { "domain": "binary_sensor", "platform": "zha" }
  },
  "generator_hints": { "ha_entity": "binary_sensor.hallway_motion" }
}

Keyboard shortcuts

  • Ctrl/Cmd + Z — undo
  • Ctrl/Cmd + Shift + Z — redo
  • Ctrl/Cmd + S — download flow JSON
  • Delete / Backspace — remove the selected node or connection
  • Escape — close dialogs and mobile panels

License

M-UI is available under the MIT License. See the included License file for the full text.