How haier-ha/ha_haier_home works
Haier Home is a Home Assistant integration for authorizing Haier accounts and exposing supported air conditioners and cloud scenes. The main workflow is account setup and home selection, fetching device metadata, constructing device models, then presenting climate controls and synchronized scenes; coordinator-managed WebSocket updates refresh state and route commands. The graph reflects the README and sampled source; some wiring for scenes, config flow, and cloud API methods is documented but not shown in excerpts.
Main entry points: coordinator.py State Coordinator · __init__.py Integration Setup · config_flow.py Account Wizard · climate.py Climate Platform
Components 18
Account Setup
- Account Wizard
custom_components/haier_home/config_flow.py - OAuth2 Flow
custom_components/haier_home/haier/oauth2.py - App Credentials
custom_components/haier_home/application_credentials.py - Flow Text
custom_components/haier_home/haier/flow_i18n.py - Integration Setup
custom_components/haier_home/__init__.py
Cloud Runtime
- REST Client
custom_components/haier_home/haier/http_client.py - State Coordinator
custom_components/haier_home/haier/coordinator.py - WebSocket Client
custom_components/haier_home/haier/websocket_client.py - Command Debouncer
custom_components/haier_home/haier/command_debouncer.py - Persistent Cache
custom_components/haier_home/haier/storage.py
Home Assistant Entities
- Device Entity Base
custom_components/haier_home/entity.py - Climate Platform
custom_components/haier_home/climate.py - Scene Platform
custom_components/haier_home/scene.py
Device Domain
- Device Models
custom_components/haier_home/device.py - PID Extensions
custom_components/haier_home/extend
Other components
- Home Assistant User
- Home Assistant
- Haier Cloud
Connections 28
- Home Assistant User → Account Wizard: configures
- Account Wizard → Flow Text: loads translations
- Account Wizard → App Credentials: uses credentials
- Account Wizard → OAuth2 Flow: authorizes account
- OAuth2 Flow → Haier Cloud: exchanges tokens
- Account Wizard → Integration Setup: creates entry
- Integration Setup → REST Client: fetches account data
- REST Client → Haier Cloud: requests REST data
- Integration Setup → Persistent Cache: reads and writes
- Integration Setup → Device Models: builds devices
- Integration Setup → State Coordinator: starts runtime
- Integration Setup → Climate Platform: forwards platform setup
- Integration Setup → Scene Platform: forwards platform setup
- State Coordinator → REST Client: loads cloud data
- State Coordinator → WebSocket Client: manages connection
- WebSocket Client → Haier Cloud: syncs messages
- WebSocket Client → State Coordinator: delivers pushes
- State Coordinator → Device Models: updates state
- State Coordinator → Command Debouncer: debounces commands
- State Coordinator → REST Client: sends commands
- Climate Platform → Device Entity Base: extends
- Scene Platform → State Coordinator: uses runtime state
- Climate Platform → State Coordinator: reads state; sends controls
- Device Entity Base → Device Models: reads attributes
- Device Entity Base → State Coordinator: dispatches commands
- Climate Platform → PID Extensions: selects PID overrides
- Home Assistant → Climate Platform: displays entities
- Home Assistant → Scene Platform: displays entities