# satnitfver/cyd_hass_buttons architecture

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

- Interactive diagram: https://gitdiagram.com/satnitfver/cyd_hass_buttons
- Repository: https://github.com/satnitfver/cyd_hass_buttons

## Overview

This is an ESP32 touchscreen MQTT button panel. A user touches a virtual button; the device detects the touch and publishes the configured MQTT message, while providing display feedback and low-power sleep. The README documents WiFi, MQTT, customizable buttons, TFT/XPT2046 support, and wake-on-touch sleep. The main sketch and Home Assistant sample were not excerpted, so their internal wiring and the sample’s precise role cannot be verified; edges below reflect README-level relationships.

Main entry points: [`main.ino`](https://github.com/satnitfver/cyd_hass_buttons/blob/main/main.ino) (Panel firmware)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_device["Panel device"]
  node_firmware["Panel firmware<br/>[main.ino]"]
  node_display_config["Display configuration<br/>[User_Setup.h]"]
  node_touchscreen["Touchscreen"]
  node_display["TFT display"]
  node_sleep["Deep sleep<br/>[main.ino]"]
end

subgraph group_network["Network and messaging"]
  node_wifi["WiFi network"]
  node_mqtt["MQTT broker"]
end

subgraph group_examples["Configuration examples"]
  node_button_config["Button definitions"]
end

node_user(("Panel user"))

node_user -->|"touches"| node_touchscreen
node_touchscreen -->|"sends input"| node_firmware
node_firmware -->|"updates display"| node_display
node_firmware -->|"connects via"| node_wifi
node_firmware -->|"publishes messages"| node_mqtt
node_firmware -->|"enters on inactivity"| node_sleep
node_touchscreen -->|"wakes device"| node_sleep

click node_firmware "https://github.com/satnitfver/cyd_hass_buttons/blob/main/main.ino"
click node_button_config "https://github.com/satnitfver/cyd_hass_buttons/blob/main/Sample_HASS/Sample_button_announcement.yaml"
click node_display_config "https://github.com/satnitfver/cyd_hass_buttons/blob/main/User_Setup.h"
click node_sleep "https://github.com/satnitfver/cyd_hass_buttons/blob/main/main.ino"

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_firmware,node_display_config,node_touchscreen,node_display,node_sleep,node_user toneBlue
class node_wifi,node_mqtt toneAmber
class node_button_config toneMint
```

## Components

### Panel device

- [Panel firmware](https://github.com/satnitfver/cyd_hass_buttons/blob/main/main.ino): `main.ino`
- [Display configuration](https://github.com/satnitfver/cyd_hass_buttons/blob/main/User_Setup.h): `User_Setup.h`
- **Touchscreen**
- **TFT display**
- [Deep sleep](https://github.com/satnitfver/cyd_hass_buttons/blob/main/main.ino): `main.ino`

### Network and messaging

- **WiFi network**
- **MQTT broker**

### Configuration examples

- [Button definitions](https://github.com/satnitfver/cyd_hass_buttons/blob/main/Sample_HASS/Sample_button_announcement.yaml): `Sample_HASS/Sample_button_announcement.yaml`

### Other components

- **Panel user**

## Connections

- Panel user → Touchscreen: touches (evidence: `readme.md`)
- Touchscreen → Panel firmware: sends input (evidence: `readme.md`)
- Panel firmware → TFT display: updates display (evidence: `readme.md`)
- Panel firmware → WiFi network: connects via (evidence: `readme.md`)
- Panel firmware → MQTT broker: publishes messages (evidence: `readme.md`)
- Panel firmware → Deep sleep: enters on inactivity (evidence: `readme.md`)
- Touchscreen → Deep sleep: wakes device (evidence: `readme.md`)
