MQTT Topics Documentation¶
Introduction¶
This document describes the MQTT topics published by the Genius Gateway. The gateway supports both Home Assistant auto-discovery and custom MQTT topics for integration with other home automation systems connecting to a MQTT broker.
MQTT Configuration¶
MQTT functionality is mainly configured via web frontend or HTTP API endpoints:
- Framework MQTT Settings:
/rest/mqttSettings- Basic MQTT connection settings - Gateway MQTT Settings:
/rest/mqtt-settings- Genius Gateway specific publishing options
Framework MQTT Topics (ESP32 SvelteKit)¶
Device Status Topic (LWT)¶
Topic
device-mac format
device-mac is the device's MAC address with lowercase hex digits and without any delimiters.
E.g.: 1A:2B:3C:4D:5E:6F 1a2b3c4d5e6f
Description: Framework device online/offline status using MQTT Last Will and Testament (LWT)
QoS: 1
Retain: true
Payloads
Published when device connects to MQTT broker:
Published automatically by broker when device disconnects (LWT message):
Genius Gateway MQTT Topics¶
Home Assistant Auto-Discovery¶
The gateway supports Home Assistant's MQTT Discovery protocol for automatic device integration.
Configuration Topic¶
Topic (Default)
Description: Device configuration for Home Assistant auto-discovery
QoS: 0
Retain: true
Payload
{
"~": "homeassistant/binary_sensor/genius-12345678",
"name": "Genius Plus X",
"unique_id": "12345678",
"device_class": "smoke",
"state_topic": "~/state",
"schema": "json",
"value_template": "{{value_json.state}}",
"entity_picture": "http://192.168.1.100/hekatron-genius-plus-x.png",
"device": {
"identifiers": "12345678",
"manufacturer": "Hekatron Vertriebs GmbH",
"model": "Genius Plus X",
"name": "Rauchmelder",
"serial_number": "12345678",
"suggested_area": "Living Room"
}
}
Payload Fields
~- Topic prefix (base path for relative references)name- Entity name shown in Home Assistantunique_id- Unique identifier (smoke detector serial number)device_class- Device class (smokefor smoke detectors)state_topic- Relative path to state topic (expands to{prefix}{sn}/state)schema- Payload format (json)value_template- Jinja2 template to extract state from JSONentity_picture- URL to device icon (only included if gateway has valid IP)device- Device information objectidentifiers- Device identifier for grouping entitiesmanufacturer- Device manufacturermodel- Device model namename- Device nameserial_number- Serial numbersuggested_area- Suggested Home Assistant area/room
Publishing Behavior
- Published when smoke detector is first created or imported
- Re-published when MQTT connection is established
- Re-published when MQTT settings change
- Published only if device publishing is enabled
Home Assistant Integration
- Automatically creates binary sensor entity
- Adds icon and plenty of metadata (manufacturer, model, serial number, etc.)
- Can be used in automations and scenes
State Topic¶
Topic (Default)
Description: Current alarm state of individual smoke detector
QoS: 0
Retain: true
Payload
Published when device is not alarming:
Published when device is alarming:Payload Fields
state- Alarm state"OFF"- Smoke detector not alarming"ON"- Smoke detector actively alarming
Publishing Behavior
- Published when device alarm state changes
- Re-published when MQTT connection is established
- Re-published when device configuration changes (location, etc.)
- Published only if device publishing is enabled
Home Assistant Integration
- Automatically updates binary sensor entity
- Entity shows as "Clear" (OFF) or "Smoke detected" (ON)
- Can be used in automations and scenes
Global Alarm State Topic¶
Topic (Default)
Description: Global alarm state aggregated from all smoke detectors
QoS: 0
Retain: true
Payload:
Published if all devices are in standby:
Published when two smoke detectors are alarming (example):
Payload Fields
isAlarming- Global alarm state (boolean)true- At least one smoke detector is alarmingfalse- No smoke detectors alarming
numAlarmingDevices- Number of smoke detectors currently in alarm state (integer)
Publishing Behavior
- Published whenever any device alarm state changes
- Re-published when MQTT connection is established
- Published only if simple alarm publishing is enabled
Integration
This topic enables integration with all smart home systems that support MQTT.