# isystemsautomation/homemaster-dev architecture

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

- Interactive diagram: https://gitdiagram.com/isystemsautomation/homemaster-dev
- Repository: https://github.com/isystemsautomation/homemaster-dev

## Overview

HomeMaster is an open, local-first automation system: Home Assistant communicates with ESP32 controllers, which connect RP2350 I/O modules over RS-485 Modbus RTU. Module firmware provides device-specific sensing and control; the README also documents onboard rules, persistent configuration, and browser-based USB-C WebConfig. The tree contains module headers and selected drivers, but not the controller firmware or complete module applications, so those runtime internals are represented only where documented. The estimator is not described in the supplied README excerpt, so its role is left out.

Main entry points: [`_shared/hm-webconfig.js`](https://github.com/isystemsautomation/homemaster-dev/blob/main/_shared/hm-webconfig.js) (USB-C WebConfig), [`ENM-223-R1/Firmware/v0.2.0/default_enm_223_r1/hm_common.h`](https://github.com/isystemsautomation/homemaster-dev/blob/main/ENM-223-R1/Firmware/v0.2.0/default_enm_223_r1/hm_common.h) (Energy Meter), [`RGB-621-R1/Firmware/v0.3.0/default_rgb_621_r1/hm_input_engine.h`](https://github.com/isystemsautomation/homemaster-dev/blob/main/RGB-621-R1/Firmware/v0.3.0/default_rgb_621_r1/hm_input_engine.h) (LED Controller), [`RGB-621-R1/Firmware/v0.3.0/default_rgb_621_r1/hm_pwm_output.h`](https://github.com/isystemsautomation/homemaster-dev/blob/main/RGB-621-R1/Firmware/v0.3.0/default_rgb_621_r1/hm_pwm_output.h) (PWM Output)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_system["Automation System"]
  node_controllers["ESP32 Controllers"]
  node_bus["RS-485 Modbus"]
end

subgraph group_modules["I/O Modules"]
  node_enm["Energy Meter<br/>[hm_common.h]"]
  node_alm["Alarm I/O<br/>[hm_common.h]"]
  node_dim["AC Dimmer<br/>[hm_common.h]"]
  node_aio["Analog I/O<br/>[hm_common.h]"]
  node_rgb["LED Controller<br/>[hm_input_engine.h]"]
  node_pwm["PWM Output<br/>[hm_pwm_output.h]"]
  node_trace["PWM Trace<br/>[hm_trace.h]"]
  node_dio["Digital I/O<br/>[hm_common.h]"]
  node_stair["Staircase LEDs<br/>[hm_stair.h]"]
  node_heat["Heating Control<br/>[hm_heat.h]"]
  node_wld["Leak Detection<br/>[hm_common.h]"]
end

subgraph group_metering["Metering Drivers"]
  node_atm["ATM90E32 Driver<br/>[atm90e32.cpp]"]
  node_modbus["Modbus Register Map<br/>[enm_modbus.cpp]"]
end

subgraph group_config["Module Configuration"]
  node_webconfig["USB-C WebConfig<br/>[hm-webconfig.js]"]
end

node_ha(("Home Assistant"))
node_browser(("Installer Browser"))

node_ha -->|"controls locally"| node_controllers
node_controllers -->|"masters on"| node_bus
node_bus -->|"Modbus RTU"| node_enm
node_bus -->|"Modbus RTU"| node_alm
node_bus -->|"Modbus RTU"| node_dim
node_bus -->|"Modbus RTU"| node_aio
node_bus -->|"Modbus RTU"| node_rgb
node_bus -->|"Modbus RTU"| node_dio
node_bus -->|"Modbus RTU"| node_stair
node_bus -->|"Modbus RTU"| node_wld
node_rgb -.->|"drives outputs"| node_pwm
node_pwm -->|"records changes"| node_trace
node_enm -.->|"measures power"| node_atm
node_browser -->|"configures modules"| node_webconfig
node_webconfig -.->|"sets module options"| node_enm
node_webconfig -.->|"sets module options"| node_alm
node_webconfig -.->|"sets module options"| node_dim
node_webconfig -.->|"sets module options"| node_aio
node_webconfig -.->|"sets module options"| node_rgb
node_webconfig -.->|"sets module options"| node_dio
node_webconfig -.->|"sets module options"| node_stair
node_webconfig -.->|"sets module options"| node_wld

click node_enm "https://github.com/isystemsautomation/homemaster-dev/blob/main/ENM-223-R1/Firmware/v0.2.0/default_enm_223_r1/hm_common.h"
click node_alm "https://github.com/isystemsautomation/homemaster-dev/blob/main/ALM-173-R1/Firmware/v0.2.0/default_alm_173_r1/hm_common.h"
click node_dim "https://github.com/isystemsautomation/homemaster-dev/blob/main/DIM-420-R1/Firmware/v0.2.0/default_DIM_420_R1/hm_common.h"
click node_aio "https://github.com/isystemsautomation/homemaster-dev/blob/main/AIO-422-R1/Firmware/v0.2.0/default_aio_422_r1/hm_common.h"
click node_rgb "https://github.com/isystemsautomation/homemaster-dev/blob/main/RGB-621-R1/Firmware/v0.3.0/default_rgb_621_r1/hm_input_engine.h"
click node_pwm "https://github.com/isystemsautomation/homemaster-dev/blob/main/RGB-621-R1/Firmware/v0.3.0/default_rgb_621_r1/hm_pwm_output.h"
click node_trace "https://github.com/isystemsautomation/homemaster-dev/blob/main/RGB-621-R1/Firmware/v0.3.0/default_rgb_621_r1/hm_trace.h"
click node_dio "https://github.com/isystemsautomation/homemaster-dev/blob/main/DIO-430-R1/Firmware/v0.3.0/default_DIO_430_R1/hm_common.h"
click node_stair "https://github.com/isystemsautomation/homemaster-dev/blob/main/STR-3221-R1/Firmware/v0.2.0/default_str_3221_r1/hm_stair.h"
click node_heat "https://github.com/isystemsautomation/homemaster-dev/blob/main/STR-3221-R1/Firmware/v0.2.0/default_str_3221_r1/hm_heat.h"
click node_wld "https://github.com/isystemsautomation/homemaster-dev/blob/main/WLD-521-R1/Firmware/v0.2.0/default_wld-521-r1/hm_common.h"
click node_atm "https://github.com/isystemsautomation/homemaster-dev/blob/main/ENM-223-R1/Firmware/v0.2.0/default_enm_223_r1/atm90e32.cpp"
click node_modbus "https://github.com/isystemsautomation/homemaster-dev/blob/main/RGB-621-R1/Firmware/v0.1.0/default_rgb_621_r1/src/enm_modbus.cpp"
click node_webconfig "https://github.com/isystemsautomation/homemaster-dev/blob/main/_shared/hm-webconfig.js"

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_controllers,node_bus,node_browser toneBlue
class node_enm,node_alm,node_dim,node_aio,node_rgb,node_pwm,node_trace,node_dio,node_stair,node_heat,node_wld toneAmber
class node_atm,node_modbus toneMint
class node_webconfig toneRose
class node_ha toneIndigo
```

## Components

### Automation System

- **ESP32 Controllers**
- **RS-485 Modbus**

### I/O Modules

- [Energy Meter](https://github.com/isystemsautomation/homemaster-dev/blob/main/ENM-223-R1/Firmware/v0.2.0/default_enm_223_r1/hm_common.h): `ENM-223-R1/Firmware/v0.2.0/default_enm_223_r1/hm_common.h`
- [Alarm I/O](https://github.com/isystemsautomation/homemaster-dev/blob/main/ALM-173-R1/Firmware/v0.2.0/default_alm_173_r1/hm_common.h): `ALM-173-R1/Firmware/v0.2.0/default_alm_173_r1/hm_common.h`
- [AC Dimmer](https://github.com/isystemsautomation/homemaster-dev/blob/main/DIM-420-R1/Firmware/v0.2.0/default_DIM_420_R1/hm_common.h): `DIM-420-R1/Firmware/v0.2.0/default_DIM_420_R1/hm_common.h`
- [Analog I/O](https://github.com/isystemsautomation/homemaster-dev/blob/main/AIO-422-R1/Firmware/v0.2.0/default_aio_422_r1/hm_common.h): `AIO-422-R1/Firmware/v0.2.0/default_aio_422_r1/hm_common.h`
- [LED Controller](https://github.com/isystemsautomation/homemaster-dev/blob/main/RGB-621-R1/Firmware/v0.3.0/default_rgb_621_r1/hm_input_engine.h): `RGB-621-R1/Firmware/v0.3.0/default_rgb_621_r1/hm_input_engine.h`
- [PWM Output](https://github.com/isystemsautomation/homemaster-dev/blob/main/RGB-621-R1/Firmware/v0.3.0/default_rgb_621_r1/hm_pwm_output.h): `RGB-621-R1/Firmware/v0.3.0/default_rgb_621_r1/hm_pwm_output.h`
- [PWM Trace](https://github.com/isystemsautomation/homemaster-dev/blob/main/RGB-621-R1/Firmware/v0.3.0/default_rgb_621_r1/hm_trace.h): `RGB-621-R1/Firmware/v0.3.0/default_rgb_621_r1/hm_trace.h`
- [Digital I/O](https://github.com/isystemsautomation/homemaster-dev/blob/main/DIO-430-R1/Firmware/v0.3.0/default_DIO_430_R1/hm_common.h): `DIO-430-R1/Firmware/v0.3.0/default_DIO_430_R1/hm_common.h`
- [Staircase LEDs](https://github.com/isystemsautomation/homemaster-dev/blob/main/STR-3221-R1/Firmware/v0.2.0/default_str_3221_r1/hm_stair.h): `STR-3221-R1/Firmware/v0.2.0/default_str_3221_r1/hm_stair.h`
- [Heating Control](https://github.com/isystemsautomation/homemaster-dev/blob/main/STR-3221-R1/Firmware/v0.2.0/default_str_3221_r1/hm_heat.h): `STR-3221-R1/Firmware/v0.2.0/default_str_3221_r1/hm_heat.h`
- [Leak Detection](https://github.com/isystemsautomation/homemaster-dev/blob/main/WLD-521-R1/Firmware/v0.2.0/default_wld-521-r1/hm_common.h): `WLD-521-R1/Firmware/v0.2.0/default_wld-521-r1/hm_common.h`

### Metering Drivers

- [ATM90E32 Driver](https://github.com/isystemsautomation/homemaster-dev/blob/main/ENM-223-R1/Firmware/v0.2.0/default_enm_223_r1/atm90e32.cpp): `ENM-223-R1/Firmware/v0.2.0/default_enm_223_r1/atm90e32.cpp`
- [Modbus Register Map](https://github.com/isystemsautomation/homemaster-dev/blob/main/RGB-621-R1/Firmware/v0.1.0/default_rgb_621_r1/src/enm_modbus.cpp): `RGB-621-R1/Firmware/v0.1.0/default_rgb_621_r1/src/enm_modbus.cpp`

### Module Configuration

- [USB-C WebConfig](https://github.com/isystemsautomation/homemaster-dev/blob/main/_shared/hm-webconfig.js): `_shared/hm-webconfig.js`

### Other components

- **Home Assistant**
- **Installer Browser**

## Connections

- Home Assistant → ESP32 Controllers: controls locally
- ESP32 Controllers → RS-485 Modbus: masters on
- RS-485 Modbus → Energy Meter: Modbus RTU
- RS-485 Modbus → Alarm I/O: Modbus RTU
- RS-485 Modbus → AC Dimmer: Modbus RTU
- RS-485 Modbus → Analog I/O: Modbus RTU
- RS-485 Modbus → LED Controller: Modbus RTU
- RS-485 Modbus → Digital I/O: Modbus RTU
- RS-485 Modbus → Staircase LEDs: Modbus RTU
- RS-485 Modbus → Leak Detection: Modbus RTU
- LED Controller → PWM Output: drives outputs
- PWM Output → PWM Trace: records changes (evidence: `RGB-621-R1/Firmware/v0.3.0/default_rgb_621_r1/hm_pwm_output.h`)
- Energy Meter → ATM90E32 Driver: measures power
- Installer Browser → USB-C WebConfig: configures modules
- USB-C WebConfig → Energy Meter: sets module options
- USB-C WebConfig → Alarm I/O: sets module options
- USB-C WebConfig → AC Dimmer: sets module options
- USB-C WebConfig → Analog I/O: sets module options
- USB-C WebConfig → LED Controller: sets module options
- USB-C WebConfig → Digital I/O: sets module options
- USB-C WebConfig → Staircase LEDs: sets module options
- USB-C WebConfig → Leak Detection: sets module options
