Home Assistant
Home Assistant
Section titled “Home Assistant”Summary
Section titled “Summary”The container feature in RouterOS enables running Home Assistant directly on your MikroTik router, eliminating the need for a separate dedicated server. Home Assistant is a popular open-source platform for smart home automation, supporting hundreds of integrations with IoT devices, sensors, and services.
Home Assistant images are available for ARM32, ARM64, and AMD64 architectures. The recommended minimum requirements are 2 GB RAM and 32 GB storage. However, testing is possible on devices with 512+ MB RAM for basic operations.
Prerequisites
Section titled “Prerequisites”Ensure the following before starting:
- RouterOS device with Container package installed
- External USB storage (minimum 32 GB recommended) for container data
- At least 512 MB free RAM (2 GB recommended)
- Network connectivity for pulling the Docker image
Container Mode
Section titled “Container Mode”Enable container mode on your device:
/system/device-mode/update container=yesConfirm by pressing the reset button (x86 devices require cold reboot).
Networking Configuration
Section titled “Networking Configuration”Create a virtual Ethernet interface for the container:
/interface/veth/add name=veth2 address=172.19.0.2/24 gateway=172.19.0.1Create a bridge for container networking:
/interface/bridge/add name=ha/ip/address/add address=172.19.0.1/24 interface=ha/interface/bridge/port/add bridge=ha interface=veth2Port Forwarding (Optional)
Section titled “Port Forwarding (Optional)”Forward TCP port 8123 for external access to Home Assistant:
/ip firewall nat add action=dstnat chain=dstnat dst-address=192.168.88.1 dst-port=8123 protocol=tcp to-addresses=172.19.0.2 to-ports=8123Adjust dst-address to match your router’s LAN IP.
Storage and Environment
Section titled “Storage and Environment”Create a mount for Home Assistant configuration files:
/container mounts add dst=/config name=ha_config src=/usb1/ha_configSet the timezone environment variable:
/container/envs/add list=ha_env key=TZ value=America/Los_AngelesAdjust the timezone value to match your location.
Pulling the Image
Section titled “Pulling the Image”Configure the Docker registry and pull the Home Assistant image:
/container/config/set registry-url=https://registry-1.docker.io tmpdir=/usb1/pull/container/add remote-image=homeassistant/home-assistant:latest interface=veth2 root-dir=/usb1/ha mounts=ha_config envlist=ha_env logging=yesMonitor the extraction process:
/container/printWait until the status changes to status=stopped before proceeding.
Starting the Container
Section titled “Starting the Container”Start the container once image extraction is complete:
/container/start 0Verify container status:
/container/printInitial Setup
Section titled “Initial Setup”Access the Home Assistant web interface at http://<router-ip>:8123. The setup wizard guides you through creating an administrator account and configuring initial integrations.
Follow the Home Assistant onboarding guide for detailed instructions.
Resource Usage
Section titled “Resource Usage”Home Assistant typically uses 300-500 MB of RAM at idle on ARM devices. Monitor resource usage:
/system resource printConsider these resource requirements when running additional services alongside Home Assistant.