Skip to main content
This quickstart guide will help you get Home Assistant Core running locally for development and walk you through creating a simple integration.

Prerequisites

Before you begin, ensure you have:
  • Python 3.14.2 or later installed
  • Git for cloning the repository
  • A Linux, macOS, or Windows (WSL) system
  • Basic knowledge of Python and asyncio
Home Assistant Core requires Python 3.14.2 or later. Earlier versions are not supported.

Quick Setup

1

Clone the Repository

Clone the Home Assistant Core repository:
2

Create a Virtual Environment

Create and activate a Python virtual environment:
Using a virtual environment is highly recommended to isolate dependencies.
3

Install in Development Mode

Install Home Assistant in editable mode with development dependencies:
This installs the hass command and all core dependencies.
4

Run Home Assistant

Start Home Assistant for the first time:
Home Assistant will:
  • Create a default configuration directory at ./config
  • Generate configuration.yaml with default settings
  • Start the web server on http://localhost:8123

Understanding the Command Line

The hass command (defined in homeassistant/__main__.py) provides several useful options:

Accessing the Web Interface

Once Home Assistant is running:
  1. Open your browser to http://localhost:8123
  2. Complete the onboarding process:
    • Create an owner account
    • Set your home location
    • Configure basic settings
  3. Explore the dashboard
Use the --open-ui flag to automatically open the browser when Home Assistant starts.

Creating Your First Integration

Let’s create a simple “Hello World” integration to understand the basics.

Integration Structure

Create a new directory for your integration:

Manifest File

Create manifest.json to define your integration:
manifest.json

Integration Code

Create __init__.py with the setup logic:
__init__.py

Add to Configuration

Add your integration to config/configuration.yaml:
configuration.yaml

Restart and Test

1

Restart Home Assistant

Stop Home Assistant (Ctrl+C) and restart it:
2

Call Your Service

Open the Developer Tools in the web UI (http://localhost:8123/developer-tools/service) and call your service:
3

View the State

Check the States tab in Developer Tools to see hello_world.greeting with the value “Hello, Developer!”

Understanding the Code

Let’s break down what’s happening:

The async_setup Function

This is the entry point for YAML-configured integrations. Home Assistant calls this during bootstrap.

The HomeAssistant Object

The hass object provides access to:
  • hass.services - Service registry
  • hass.states - State machine
  • hass.bus - Event bus
  • hass.data - Shared data storage
  • hass.config - Configuration access

Registering Services

This registers a service that can be called from automations, scripts, or the UI.

Setting States

States are how Home Assistant tracks entity values. Each state has:
  • entity_id - Unique identifier (format: domain.object_id)
  • state - The current value (string, max 255 chars)
  • attributes - Dictionary of additional data

Adding a Sensor Platform

Let’s extend our integration with a sensor that shows random numbers. Create sensor.py:
sensor.py
Update configuration.yaml to enable the sensor:
configuration.yaml

Next Steps

Now that you have a working development environment:

Installation Guide

Learn about detailed installation options and requirements

Configuration

Explore Home Assistant configuration options

Developer Docs

Read the comprehensive developer documentation

Integration Development

Deep dive into creating integrations

Common Issues

Python Version Mismatch: Ensure you’re using Python 3.14.2+. Check with python3 --version.
Port Already in Use: If port 8123 is taken, Home Assistant will fail to start. Stop other services or configure a different port.
Use hass --debug for detailed logs when troubleshooting issues.