# tritue2011/imou-homeassistant architecture

> Architecture diagram of the GitHub repository tritue2011/imou-homeassistant, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tritue2011/imou-homeassistant
- Repository: https://github.com/tritue2011/imou-homeassistant

## Overview

Assist Camera is a Home Assistant integration that turns supported cameras into speakers, phone-to-camera intercom endpoints, and optional Assist satellites. The main flow captures camera microphone audio, feeds Home Assistant’s Assist pipeline, then plays the response through the camera speaker. Setup and device controls are included alongside the distinct speaker, intercom, and Assist paths. The README documents entity and remote-access capabilities beyond the sampled implementation; edges are limited to wiring established by the excerpts and documentation.

Main entry points: [`custom_components/dahua_talk/speaker.py`](https://github.com/tritue2011/imou-homeassistant/blob/main/custom_components/dahua_talk/speaker.py) (Speaker playback), [`custom_components/dahua_talk/__init__.py`](https://github.com/tritue2011/imou-homeassistant/blob/main/custom_components/dahua_talk/__init__.py) (Camera runtime entry), [`custom_components/dahua_talk/assist_satellite.py`](https://github.com/tritue2011/imou-homeassistant/blob/main/custom_components/dahua_talk/assist_satellite.py) (Assist satellite), [`custom_components/dahua_talk/config_flow.py`](https://github.com/tritue2011/imou-homeassistant/blob/main/custom_components/dahua_talk/config_flow.py) (Integration setup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_setup["Setup and entities"]
  node_config["Integration setup<br/>[config_flow.py]"]
  node_entry["Camera runtime entry<br/>[__init__.py]"]
  node_controls["Mic and wake controls<br/>[switch.py]"]
  node_gain["Microphone gain<br/>[number.py]"]
  node_selection["Assistant selection<br/>[select.py]"]
end

subgraph group_audio["Camera audio"]
  node_media["Speaker media entity<br/>[media_player.py]"]
  node_speaker["Speaker playback<br/>[speaker.py]"]
  node_talk["Imou talk session<br/>[talk.py]"]
  node_http["Imou HTTP talk<br/>[http_talk.py]"]
  node_rtsp["RTSP talk session<br/>[rtsp_talk.py]"]
  node_hik["Hikvision talk session<br/>[hik_talk.py]"]
end

subgraph group_assist["Assist satellite"]
  node_satellite["Assist satellite"]
  node_wakeword["Vietnamese wake word"]
end

subgraph group_intercom["Phone intercom"]
  node_service["Intercom source service<br/>[__init__.py]"]
  node_server["RTSP intercom server<br/>[rtsp_intercom.py]"]
  node_http_intercom["HTTP intercom receiver<br/>[intercom.py]"]
end

node_user(("Home Assistant user"))
node_ha["Home Assistant"]
node_camera["Camera mic and speaker"]
node_phone(("Phone microphone"))
node_go2rtc["go2rtc"]
node_pipeline["Assist pipeline"]

node_user -->|"configures camera"| node_config
node_config -->|"creates entry"| node_entry
node_entry -->|"initializes speaker"| node_speaker
node_entry -->|"forwards platform setup"| node_satellite
node_entry -->|"registers service"| node_service
node_controls -->|"updates mic settings"| node_entry
node_gain -->|"sets gain"| node_entry
node_selection -->|"selects pipeline"| node_satellite
node_camera -->|"streams microphone audio"| node_satellite
node_satellite -->|"accepts audio and runs"| node_pipeline
node_pipeline -->|"returns speech output"| node_satellite
node_satellite -->|"plays spoken response"| node_speaker
node_wakeword -.->|"provides wake-word model"| node_pipeline
node_user -->|"requests playback"| node_media
node_media -->|"plays media"| node_speaker
node_speaker -->|"opens selected session"| node_talk
node_speaker -->|"opens selected session"| node_http
node_speaker -->|"opens selected session"| node_rtsp
node_speaker -->|"opens selected session"| node_hik
node_talk -->|"sends audio"| node_camera
node_http -->|"sends audio"| node_camera
node_rtsp -->|"sends audio"| node_camera
node_hik -->|"sends audio"| node_camera
node_phone -->|"sends microphone audio"| node_go2rtc
node_go2rtc -->|"forwards Opus RTP"| node_server
node_server -->|"decodes and feeds audio"| node_speaker
node_service -->|"returns stream source"| node_go2rtc
node_go2rtc -.->|"posts audio stream"| node_http_intercom
node_http_intercom -->|"feeds PCM audio"| node_speaker

click node_config "https://github.com/tritue2011/imou-homeassistant/blob/main/custom_components/dahua_talk/config_flow.py"
click node_entry "https://github.com/tritue2011/imou-homeassistant/blob/main/custom_components/dahua_talk/__init__.py"
click node_controls "https://github.com/tritue2011/imou-homeassistant/blob/main/custom_components/dahua_talk/switch.py"
click node_gain "https://github.com/tritue2011/imou-homeassistant/blob/main/custom_components/dahua_talk/number.py"
click node_selection "https://github.com/tritue2011/imou-homeassistant/blob/main/custom_components/dahua_talk/select.py"
click node_media "https://github.com/tritue2011/imou-homeassistant/blob/main/custom_components/dahua_talk/media_player.py"
click node_speaker "https://github.com/tritue2011/imou-homeassistant/blob/main/custom_components/dahua_talk/speaker.py"
click node_talk "https://github.com/tritue2011/imou-homeassistant/blob/main/custom_components/dahua_talk/talk.py"
click node_http "https://github.com/tritue2011/imou-homeassistant/blob/main/custom_components/dahua_talk/http_talk.py"
click node_rtsp "https://github.com/tritue2011/imou-homeassistant/blob/main/custom_components/dahua_talk/rtsp_talk.py"
click node_hik "https://github.com/tritue2011/imou-homeassistant/blob/main/custom_components/dahua_talk/hik_talk.py"
click node_satellite "https://github.com/tritue2011/imou-homeassistant/blob/main/custom_components/dahua_talk/assist_satellite.py"
click node_wakeword "https://github.com/tritue2011/imou-homeassistant/tree/main/wakeword"
click node_service "https://github.com/tritue2011/imou-homeassistant/blob/main/custom_components/dahua_talk/__init__.py"
click node_server "https://github.com/tritue2011/imou-homeassistant/blob/main/custom_components/dahua_talk/rtsp_intercom.py"
click node_http_intercom "https://github.com/tritue2011/imou-homeassistant/blob/main/custom_components/dahua_talk/intercom.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_config,node_entry,node_controls,node_gain,node_selection,node_user toneBlue
class node_media,node_speaker,node_talk,node_http,node_rtsp,node_hik toneAmber
class node_satellite,node_wakeword toneMint
class node_service,node_server,node_http_intercom toneRose
class node_ha,node_camera,node_phone,node_go2rtc,node_pipeline toneIndigo
```

## Components

### Setup and entities

- [Integration setup](https://github.com/tritue2011/imou-homeassistant/blob/main/custom_components/dahua_talk/config_flow.py): `custom_components/dahua_talk/config_flow.py`
- [Camera runtime entry](https://github.com/tritue2011/imou-homeassistant/blob/main/custom_components/dahua_talk/__init__.py): `custom_components/dahua_talk/__init__.py`
- [Mic and wake controls](https://github.com/tritue2011/imou-homeassistant/blob/main/custom_components/dahua_talk/switch.py): `custom_components/dahua_talk/switch.py`
- [Microphone gain](https://github.com/tritue2011/imou-homeassistant/blob/main/custom_components/dahua_talk/number.py): `custom_components/dahua_talk/number.py`
- [Assistant selection](https://github.com/tritue2011/imou-homeassistant/blob/main/custom_components/dahua_talk/select.py): `custom_components/dahua_talk/select.py`

### Camera audio

- [Speaker media entity](https://github.com/tritue2011/imou-homeassistant/blob/main/custom_components/dahua_talk/media_player.py): `custom_components/dahua_talk/media_player.py`
- [Speaker playback](https://github.com/tritue2011/imou-homeassistant/blob/main/custom_components/dahua_talk/speaker.py): `custom_components/dahua_talk/speaker.py`
- [Imou talk session](https://github.com/tritue2011/imou-homeassistant/blob/main/custom_components/dahua_talk/talk.py): `custom_components/dahua_talk/talk.py`
- [Imou HTTP talk](https://github.com/tritue2011/imou-homeassistant/blob/main/custom_components/dahua_talk/http_talk.py): `custom_components/dahua_talk/http_talk.py`
- [RTSP talk session](https://github.com/tritue2011/imou-homeassistant/blob/main/custom_components/dahua_talk/rtsp_talk.py): `custom_components/dahua_talk/rtsp_talk.py`
- [Hikvision talk session](https://github.com/tritue2011/imou-homeassistant/blob/main/custom_components/dahua_talk/hik_talk.py): `custom_components/dahua_talk/hik_talk.py`

### Assist satellite

- [Assist satellite](https://github.com/tritue2011/imou-homeassistant/blob/main/custom_components/dahua_talk/assist_satellite.py): `custom_components/dahua_talk/assist_satellite.py`
- [Vietnamese wake word](https://github.com/tritue2011/imou-homeassistant/tree/main/wakeword): `wakeword`

### Phone intercom

- [Intercom source service](https://github.com/tritue2011/imou-homeassistant/blob/main/custom_components/dahua_talk/__init__.py): `custom_components/dahua_talk/__init__.py`
- [RTSP intercom server](https://github.com/tritue2011/imou-homeassistant/blob/main/custom_components/dahua_talk/rtsp_intercom.py): `custom_components/dahua_talk/rtsp_intercom.py`
- [HTTP intercom receiver](https://github.com/tritue2011/imou-homeassistant/blob/main/custom_components/dahua_talk/intercom.py): `custom_components/dahua_talk/intercom.py`

### Other components

- **Home Assistant user**
- **Home Assistant**
- **Camera mic and speaker**
- **Phone microphone**
- **go2rtc**
- **Assist pipeline**

## Connections

- Home Assistant user → Integration setup: configures camera
- Integration setup → Camera runtime entry: creates entry
- Camera runtime entry → Speaker playback: initializes speaker
- Camera runtime entry → Assist satellite: forwards platform setup
- Camera runtime entry → Intercom source service: registers service
- Mic and wake controls → Camera runtime entry: updates mic settings
- Microphone gain → Camera runtime entry: sets gain
- Assistant selection → Assist satellite: selects pipeline
- Camera mic and speaker → Assist satellite: streams microphone audio
- Assist satellite → Assist pipeline: accepts audio and runs
- Assist pipeline → Assist satellite: returns speech output
- Assist satellite → Speaker playback: plays spoken response
- Vietnamese wake word → Assist pipeline: provides wake-word model
- Home Assistant user → Speaker media entity: requests playback
- Speaker media entity → Speaker playback: plays media
- Speaker playback → Imou talk session: opens selected session
- Speaker playback → Imou HTTP talk: opens selected session
- Speaker playback → RTSP talk session: opens selected session
- Speaker playback → Hikvision talk session: opens selected session
- Imou talk session → Camera mic and speaker: sends audio
- Imou HTTP talk → Camera mic and speaker: sends audio
- RTSP talk session → Camera mic and speaker: sends audio
- Hikvision talk session → Camera mic and speaker: sends audio
- Phone microphone → go2rtc: sends microphone audio
- go2rtc → RTSP intercom server: forwards Opus RTP
- RTSP intercom server → Speaker playback: decodes and feeds audio
- Intercom source service → go2rtc: returns stream source
- go2rtc → HTTP intercom receiver: posts audio stream
- HTTP intercom receiver → Speaker playback: feeds PCM audio
