Skip to content

Guides

These guides walk through common HaClient workflows. They focus on how to use the client effectively rather than enumerating every parameter — see the API Reference for that.

Getting started

Reacting to state

Extending the client

Domain workflows

Design philosophy

HaClient is not a thin wrapper over the Home Assistant REST and WebSocket APIs. It deliberately reshapes them into something more consistent and more Pythonic:

  • Use the high-level domain methods (light.set_brightness(...), cover.set_position(...), media_player.play()) as the normal path. They normalise domain quirks, validate inputs, and pick the right transport.
  • Drop to client.services.call(...) only for services that no domain method covers, or when you need very specific routing.
  • Map entity events to domain-specific listener decorators (@light.on_brightness_change, @timer.on_finished) before reaching for the generic on_state_change.