Domovoy: Write Home Assistant automations in pure, type checked Python

I wanted to share a project I’ve been working on called Domovoy. It is a Python-based automation framework for Home Assistant inspired by AppDaemon. It’s been running my own home since 2023, handling hundreds of automations on an instance with 5,000+ entities.

Why I built this

My journey with Home Assistant automations started with Node-RED and for a while I was pretty happy with it. But how to represent my automations visually became more complex over time. I wanted to write my automations in pure Python with proper IDE support, type checking, and the ability to use Python’s ecosystem of libraries. AppDaemon was close but I wanted something built from the ground up with modern async/await patterns and full type checking support.

What makes Domovoy different

Write automations in Python with full IDE support:

from dataclasses import dataclass
from domovoy.applications import AppBase, AppConfigBase
from domovoy.applications.registration import register_app
from domovoy.plugins.hass.types import LightEntity
from domovoy_typing.entities import entities

@dataclass
class SunsetLightConfig(AppConfigBase):
    light: LightEntity | list[LightEntity]
    brightness: int = 200


class SunsetLight(AppBase[SunsetLightConfig]):
    async def initialize(self):
        self.callbacks.run_daily_on_sun_event(
            self.turn_on_light,
            "sunset",
        )
        self.log.info("Sunset light automation ready!")

    async def turn_on_light(self):
        await self.hass.services.light.turn_on( # Service calls are fully typed, so no need to go back to Home Assistant to figure out the parameters
            entity_id=self.config.light,
            brightness=self.config.brightness,
        )


register_app(
    app_class=SunsetLight,
    app_name="porch_sunset_light",
    config=SunsetLightConfig(light=entities.light.porch), # This will get type checked, so if you mistyped the name or rename the entity_id, the type checker will let you know.
)

Key features:

  • ServEnts Integration - Create HA entities directly from Python code. Need a sensor to track something? Create it in code, no YAML helpers needed.

  • Type Safety - Auto-generated type stubs for your specific HA instance. Get autocomplete for all your entities (entities.light.living_room) and services with parameter hints. Catch typos before runtime.

  • Hot Reload - Edit your code, save, and changes apply instantly. No restarts needed during development.

  • High Performance - Built with async/await throughout. Runs efficiently even with complex automations.

  • Plugin Architecture - Clean APIs for state management, scheduling, event listening, and more.

Real-world usage

This isn’t a toy project - it’s been the backbone of my smart home for over two years:

  • 5,000+ entities in Home Assistant
  • Hundreds of automations handling everything from lighting scenes to pool equipment to HVAC optimization
  • Complex integrations like Telegram bots, label printers, calendar-based automations
  • Rock solid stability with automatic recovery

Getting started

The easiest way to try it is with the starter template. Clone it, add your HA credentials, and run with Docker:

docker run -d \
  --name domovoy \
  -v ~/domovoy:/config \
  ghcr.io/carlos-sarmiento/domovoy:latest

Links


The project is in beta but stable. I’d love feedback from anyone who tries it out. Happy to answer questions!

2 Likes