# ethan-z11/z11_console_ha architecture

> Architecture diagram of the GitHub repository ethan-z11/z11_console_ha, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ethan-z11/z11_console_ha
- Repository: https://github.com/ethan-z11/z11_console_ha
- Video tour (about a minute): https://gitdiagram.com/ethan-z11/z11_console_ha/video

## Overview

Z11 Console is a Home Assistant dashboard: users sign in, view and control room devices, and configure the shared dashboard and HA connection. The browser talks to the console service over HTTP and WebSocket; the service manages HA access and supplies device state, control, and supporting features such as cameras, weather, almanac, and automations. Some backend and UI modules were not sampled, so their documented or indexed relationships are shown only where evidence supports them.

Main entry points: [`z11_console/server/home_console_server/app.py`](https://github.com/ethan-z11/z11_console_ha/blob/main/z11_console/server/home_console_server/app.py) (HTTP and WS Server), [`z11_console/src/App.tsx`](https://github.com/ethan-z11/z11_console_ha/blob/main/z11_console/src/App.tsx) (Dashboard App), [`z11_console/src/consoleApi.ts`](https://github.com/ethan-z11/z11_console_ha/blob/main/z11_console/src/consoleApi.ts) (HTTP API Client), [`z11_console/src/useHome.ts`](https://github.com/ethan-z11/z11_console_ha/blob/main/z11_console/src/useHome.ts) (Home State Hook)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Dashboard UI"]
  node_dashboard["Dashboard App<br/>[App.tsx]"]
  node_authui["Sign-in Setup<br/>[AuthPages.tsx]"]
  node_deviceui["Device and Room Views<br/>[DeviceCards.tsx]"]
  node_cameraui["Camera Board<br/>[CameraBoard.tsx]"]
  node_settingsui["Settings<br/>[SettingsPage.tsx]"]
  node_customui["Dashboard Customization"]
  node_weatherui["Weather View<br/>[Weather.tsx]"]
end

subgraph group_client["Browser Runtime"]
  node_authapi["HTTP API Client<br/>[consoleApi.ts]"]
  node_wsclient["WebSocket Client<br/>[consoleClient.ts]"]
  node_homehook["Home State Hook<br/>[useHome.ts]"]
  node_adapter["HA State Adapter<br/>[haAdapter.ts]"]
  node_commands["Device Commands<br/>[deviceCommands.ts]"]
  node_selectors["Device Selectors<br/>[selectors.ts]"]
end

subgraph group_service["Console Service"]
  node_server["HTTP and WS Server<br/>[app.py]"]
  node_store[("Persistent Settings<br/>[store.py]")]
  node_auth["Session Authentication<br/>[auth.py]"]
  node_discovery["Device Discovery<br/>[discovery.py]"]
  node_ha["Home Assistant Access<br/>[ha.py]"]
end

subgraph group_features["Home Features"]
  node_automations["Automation Management<br/>[automations.py]"]
  node_camera["Camera Services<br/>[cameras.py]"]
  node_onvif["ONVIF and PTZ<br/>[onvif.py]"]
  node_motion["Motion Detection<br/>[motion.py]"]
  node_go2rtc["Camera Streaming<br/>[go2rtc.py]"]
  node_weather["Weather Data<br/>[weather.py]"]
  node_almanac["Almanac<br/>[almanac.py]"]
  node_season["Season Rules<br/>[season.py]"]
end

node_resident(("Resident"))
node_ha_service["Home Assistant"]

node_resident -->|"uses"| node_dashboard
node_dashboard -->|"renders"| node_authui
node_dashboard -->|"renders"| node_deviceui
node_dashboard -->|"renders"| node_cameraui
node_dashboard -->|"renders"| node_settingsui
node_dashboard -.->|"renders"| node_customui
node_dashboard -.->|"renders"| node_weatherui
node_authui -->|"calls"| node_authapi
node_dashboard -->|"saves layout"| node_authapi
node_settingsui -->|"updates settings"| node_authapi
node_cameraui -->|"requests camera data"| node_authapi
node_dashboard -.->|"connects"| node_wsclient
node_homehook -->|"builds live state"| node_adapter
node_homehook -->|"applies commands"| node_commands
node_homehook -->|"selects devices"| node_selectors
node_authapi -->|"HTTP requests"| node_server
node_wsclient -->|"WebSocket requests"| node_server
node_server -->|"reads and writes"| node_store
node_server -->|"uses sessions"| node_auth
node_server -->|"uses discovery"| node_discovery
node_server -->|"uses HA access"| node_ha
node_server -->|"manages"| node_automations
node_server -->|"uses camera service"| node_camera
node_server -->|"sends PTZ commands"| node_onvif
node_server -->|"requests snapshots"| node_motion
node_server -->|"uses streaming"| node_go2rtc
node_server -->|"serves weather"| node_weather
node_server -->|"serves almanac"| node_almanac
node_server -->|"maintains season rules"| node_season
node_ha -.->|"connects to"| node_ha_service
node_automations -.->|"controls automations"| node_ha_service
node_weatherui -.->|"gets forecast"| node_weather

click node_dashboard "https://github.com/ethan-z11/z11_console_ha/blob/main/z11_console/src/App.tsx"
click node_authui "https://github.com/ethan-z11/z11_console_ha/blob/main/z11_console/src/components/AuthPages.tsx"
click node_deviceui "https://github.com/ethan-z11/z11_console_ha/blob/main/z11_console/src/components/DeviceCards.tsx"
click node_cameraui "https://github.com/ethan-z11/z11_console_ha/blob/main/z11_console/src/components/CameraBoard.tsx"
click node_settingsui "https://github.com/ethan-z11/z11_console_ha/blob/main/z11_console/src/components/SettingsPage.tsx"
click node_customui "https://github.com/ethan-z11/z11_console_ha/blob/main/z11_console/src/components/CustomizeSettings.tsx"
click node_weatherui "https://github.com/ethan-z11/z11_console_ha/blob/main/z11_console/src/components/Weather.tsx"
click node_authapi "https://github.com/ethan-z11/z11_console_ha/blob/main/z11_console/src/consoleApi.ts"
click node_wsclient "https://github.com/ethan-z11/z11_console_ha/blob/main/z11_console/src/consoleClient.ts"
click node_homehook "https://github.com/ethan-z11/z11_console_ha/blob/main/z11_console/src/useHome.ts"
click node_adapter "https://github.com/ethan-z11/z11_console_ha/blob/main/z11_console/src/haAdapter.ts"
click node_commands "https://github.com/ethan-z11/z11_console_ha/blob/main/z11_console/src/deviceCommands.ts"
click node_selectors "https://github.com/ethan-z11/z11_console_ha/blob/main/z11_console/src/selectors.ts"
click node_server "https://github.com/ethan-z11/z11_console_ha/blob/main/z11_console/server/home_console_server/app.py"
click node_store "https://github.com/ethan-z11/z11_console_ha/blob/main/z11_console/server/home_console_server/store.py"
click node_auth "https://github.com/ethan-z11/z11_console_ha/blob/main/z11_console/server/home_console_server/auth.py"
click node_discovery "https://github.com/ethan-z11/z11_console_ha/blob/main/z11_console/server/home_console_server/discovery.py"
click node_ha "https://github.com/ethan-z11/z11_console_ha/blob/main/z11_console/server/home_console_server/ha.py"
click node_automations "https://github.com/ethan-z11/z11_console_ha/blob/main/z11_console/server/home_console_server/automations.py"
click node_camera "https://github.com/ethan-z11/z11_console_ha/blob/main/z11_console/server/home_console_server/cameras.py"
click node_onvif "https://github.com/ethan-z11/z11_console_ha/blob/main/z11_console/server/home_console_server/onvif.py"
click node_motion "https://github.com/ethan-z11/z11_console_ha/blob/main/z11_console/server/home_console_server/motion.py"
click node_go2rtc "https://github.com/ethan-z11/z11_console_ha/blob/main/z11_console/server/home_console_server/go2rtc.py"
click node_weather "https://github.com/ethan-z11/z11_console_ha/blob/main/z11_console/server/home_console_server/weather.py"
click node_almanac "https://github.com/ethan-z11/z11_console_ha/blob/main/z11_console/server/home_console_server/almanac.py"
click node_season "https://github.com/ethan-z11/z11_console_ha/blob/main/z11_console/server/home_console_server/season.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_dashboard,node_authui,node_deviceui,node_cameraui,node_settingsui,node_customui,node_weatherui toneBlue
class node_authapi,node_wsclient,node_homehook,node_adapter,node_commands,node_selectors toneAmber
class node_server,node_store,node_auth,node_discovery,node_ha toneMint
class node_automations,node_camera,node_onvif,node_motion,node_go2rtc,node_weather,node_almanac,node_season toneRose
class node_resident,node_ha_service toneIndigo
```

## Components

### Dashboard UI

- [Dashboard App](https://github.com/ethan-z11/z11_console_ha/blob/main/z11_console/src/App.tsx): `z11_console/src/App.tsx`
- [Sign-in Setup](https://github.com/ethan-z11/z11_console_ha/blob/main/z11_console/src/components/AuthPages.tsx): `z11_console/src/components/AuthPages.tsx`
- [Device and Room Views](https://github.com/ethan-z11/z11_console_ha/blob/main/z11_console/src/components/DeviceCards.tsx): `z11_console/src/components/DeviceCards.tsx`
- [Camera Board](https://github.com/ethan-z11/z11_console_ha/blob/main/z11_console/src/components/CameraBoard.tsx): `z11_console/src/components/CameraBoard.tsx`
- [Settings](https://github.com/ethan-z11/z11_console_ha/blob/main/z11_console/src/components/SettingsPage.tsx): `z11_console/src/components/SettingsPage.tsx`
- [Dashboard Customization](https://github.com/ethan-z11/z11_console_ha/blob/main/z11_console/src/components/CustomizeSettings.tsx): `z11_console/src/components/CustomizeSettings.tsx`
- [Weather View](https://github.com/ethan-z11/z11_console_ha/blob/main/z11_console/src/components/Weather.tsx): `z11_console/src/components/Weather.tsx`

### Browser Runtime

- [HTTP API Client](https://github.com/ethan-z11/z11_console_ha/blob/main/z11_console/src/consoleApi.ts): `z11_console/src/consoleApi.ts`
- [WebSocket Client](https://github.com/ethan-z11/z11_console_ha/blob/main/z11_console/src/consoleClient.ts): `z11_console/src/consoleClient.ts`
- [Home State Hook](https://github.com/ethan-z11/z11_console_ha/blob/main/z11_console/src/useHome.ts): `z11_console/src/useHome.ts`
- [HA State Adapter](https://github.com/ethan-z11/z11_console_ha/blob/main/z11_console/src/haAdapter.ts): `z11_console/src/haAdapter.ts`
- [Device Commands](https://github.com/ethan-z11/z11_console_ha/blob/main/z11_console/src/deviceCommands.ts): `z11_console/src/deviceCommands.ts`
- [Device Selectors](https://github.com/ethan-z11/z11_console_ha/blob/main/z11_console/src/selectors.ts): `z11_console/src/selectors.ts`

### Console Service

- [HTTP and WS Server](https://github.com/ethan-z11/z11_console_ha/blob/main/z11_console/server/home_console_server/app.py): `z11_console/server/home_console_server/app.py`
- [Persistent Settings](https://github.com/ethan-z11/z11_console_ha/blob/main/z11_console/server/home_console_server/store.py): `z11_console/server/home_console_server/store.py`
- [Session Authentication](https://github.com/ethan-z11/z11_console_ha/blob/main/z11_console/server/home_console_server/auth.py): `z11_console/server/home_console_server/auth.py`
- [Device Discovery](https://github.com/ethan-z11/z11_console_ha/blob/main/z11_console/server/home_console_server/discovery.py): `z11_console/server/home_console_server/discovery.py`
- [Home Assistant Access](https://github.com/ethan-z11/z11_console_ha/blob/main/z11_console/server/home_console_server/ha.py): `z11_console/server/home_console_server/ha.py`

### Home Features

- [Automation Management](https://github.com/ethan-z11/z11_console_ha/blob/main/z11_console/server/home_console_server/automations.py): `z11_console/server/home_console_server/automations.py`
- [Camera Services](https://github.com/ethan-z11/z11_console_ha/blob/main/z11_console/server/home_console_server/cameras.py): `z11_console/server/home_console_server/cameras.py`
- [ONVIF and PTZ](https://github.com/ethan-z11/z11_console_ha/blob/main/z11_console/server/home_console_server/onvif.py): `z11_console/server/home_console_server/onvif.py`
- [Motion Detection](https://github.com/ethan-z11/z11_console_ha/blob/main/z11_console/server/home_console_server/motion.py): `z11_console/server/home_console_server/motion.py`
- [Camera Streaming](https://github.com/ethan-z11/z11_console_ha/blob/main/z11_console/server/home_console_server/go2rtc.py): `z11_console/server/home_console_server/go2rtc.py`
- [Weather Data](https://github.com/ethan-z11/z11_console_ha/blob/main/z11_console/server/home_console_server/weather.py): `z11_console/server/home_console_server/weather.py`
- [Almanac](https://github.com/ethan-z11/z11_console_ha/blob/main/z11_console/server/home_console_server/almanac.py): `z11_console/server/home_console_server/almanac.py`
- [Season Rules](https://github.com/ethan-z11/z11_console_ha/blob/main/z11_console/server/home_console_server/season.py): `z11_console/server/home_console_server/season.py`

### Other components

- **Resident**
- **Home Assistant**

## Connections

- Resident → Dashboard App: uses
- Dashboard App → Sign-in Setup: renders (evidence: `z11_console/src/App.tsx`)
- Dashboard App → Device and Room Views: renders (evidence: `z11_console/src/App.tsx`)
- Dashboard App → Camera Board: renders (evidence: `z11_console/src/App.tsx`)
- Dashboard App → Settings: renders (evidence: `z11_console/src/App.tsx`)
- Dashboard App → Dashboard Customization: renders
- Dashboard App → Weather View: renders (evidence: `z11_console/src/App.tsx`)
- Sign-in Setup → HTTP API Client: calls (evidence: `z11_console/src/components/AuthPages.tsx`)
- Dashboard App → HTTP API Client: saves layout (evidence: `z11_console/src/App.tsx`)
- Settings → HTTP API Client: updates settings (evidence: `z11_console/src/components/SettingsPage.tsx`)
- Camera Board → HTTP API Client: requests camera data (evidence: `z11_console/src/components/CameraBoard.tsx`)
- Dashboard App → WebSocket Client: connects
- Home State Hook → HA State Adapter: builds live state (evidence: `z11_console/src/useHome.ts`)
- Home State Hook → Device Commands: applies commands (evidence: `z11_console/src/useHome.ts`)
- Home State Hook → Device Selectors: selects devices (evidence: `z11_console/src/useHome.ts`)
- HTTP API Client → HTTP and WS Server: HTTP requests (evidence: `z11_console/src/consoleApi.ts`)
- WebSocket Client → HTTP and WS Server: WebSocket requests (evidence: `z11_console/src/consoleClient.ts`)
- HTTP and WS Server → Persistent Settings: reads and writes (evidence: `z11_console/server/home_console_server/app.py`)
- HTTP and WS Server → Session Authentication: uses sessions (evidence: `z11_console/server/home_console_server/app.py`)
- HTTP and WS Server → Device Discovery: uses discovery (evidence: `z11_console/server/home_console_server/app.py`)
- HTTP and WS Server → Home Assistant Access: uses HA access (evidence: `z11_console/server/home_console_server/app.py`)
- HTTP and WS Server → Automation Management: manages (evidence: `z11_console/server/home_console_server/app.py`)
- HTTP and WS Server → Camera Services: uses camera service (evidence: `z11_console/server/home_console_server/app.py`)
- HTTP and WS Server → ONVIF and PTZ: sends PTZ commands (evidence: `z11_console/server/home_console_server/app.py`)
- HTTP and WS Server → Motion Detection: requests snapshots (evidence: `z11_console/server/home_console_server/app.py`)
- HTTP and WS Server → Camera Streaming: uses streaming (evidence: `z11_console/server/home_console_server/app.py`)
- HTTP and WS Server → Weather Data: serves weather (evidence: `z11_console/server/home_console_server/app.py`)
- HTTP and WS Server → Almanac: serves almanac (evidence: `z11_console/server/home_console_server/app.py`)
- HTTP and WS Server → Season Rules: maintains season rules (evidence: `z11_console/server/home_console_server/app.py`)
- Home Assistant Access → Home Assistant: connects to
- Automation Management → Home Assistant: controls automations
- Weather View → Weather Data: gets forecast
