# MQTT Broker Configuration

## Overview

The MQTT broker runs in a separate LXC container and serves as the central message bus for the automation system.

## Installation

- **Software**: [Mosquitto, Eclipse, etc.]
- **Version**: [To be filled]
- **Host**: [LXC container name/IP]
- **Port**: [To be filled, typically 1883/8883]

## LXC Container

- **Container Name**: [To be filled]
- **OS**: [To be filled]
- **Resources**: [CPU, RAM, Disk]
- **Network**: [To be filled]

## Configuration

### Broker Settings

- **Port**: [To be filled]
- **TLS/SSL**: [Enabled/Disabled]
- **WebSocket**: [Enabled/Disabled]
- **Persistence**: [Enabled/Disabled]
- **Log Level**: [To be filled]

### Authentication

- **Authentication Method**: [Username/Password, Certificates, etc.]
- **Users**: [List of users if applicable]
- **ACLs**: [Access Control Lists]

## Topic Structure

### Topic Naming Convention

[Document the topic naming convention used]

### Main Topics

| Topic Pattern | Publisher | Subscriber | Description |
|--------------|-----------|------------|-------------|
| `zigbee2mqtt/#` | Zigbee2MQTT | Node-RED, Home Assistant | Zigbee device messages |
| `codesys/#` | Node-RED | CODESYS | CODESYS control messages |
| `homeassistant/#` | Home Assistant | Node-RED | Home Assistant messages |
| `nodered/#` | Node-RED | Various | Node-RED messages |

## QoS Levels

- **Default QoS**: [To be filled]
- **Retained Messages**: [Policy]

## Clients

### Connected Clients

| Client | Type | Topics Subscribed | Topics Published |
|--------|------|-------------------|------------------|
| Zigbee2MQTT | Bridge | [Topics] | `zigbee2mqtt/#` |
| Node-RED | Automation | [Topics] | [Topics] |
| Home Assistant | Dashboard | [Topics] | [Topics] |

## Security

- **Network Isolation**: [To be filled]
- **Firewall Rules**: [To be filled]
- **TLS Configuration**: [If applicable]

## Monitoring

- **Metrics**: [To be filled]
- **Logging**: [To be filled]
- **Health Checks**: [To be filled]

## Backup and Recovery

- **Configuration Backup**: [Procedure]
- **Message Persistence**: [If enabled]

## Troubleshooting

### Common Issues

- **Connection failures**: [Solution]
- **Message delivery issues**: [Solution]
- **Performance problems**: [Solution]

---

**Status**: Template - needs configuration details
