Components¶
Each component maps to one Home Assistant MQTT platform. Configuration options below use the full option names from the Home Assistant MQTT documentation; the library serializes them as the abbreviated keys Home Assistant expects (~ is replaced by the base topic at setup).
Common options available on every component (settable as fields):
| Option | Field | Description |
|---|---|---|
| name | name |
Constructor argument; pass "" to inherit the device name |
| device_class | deviceClass |
Constructor argument on supporting platforms |
| icon | icon |
Constructor argument or field |
| entity_category | category |
Category::CONFIG or Category::DIAGNOSTIC |
| default_entity_id | (auto) | Auto-suggested as <platform>.<device_id>_<id> unless overridden |
| enabled_by_default | enabledByDefault |
std::optional<bool> |
| unique_id | uniqueId |
Auto-suggested as <device_id>_<id> unless overridden |
| availability_topic | availabilityTopic |
See Availability |
| discovery topic | configTopic |
Full discovery topic override, including /config |
The list of supported platforms and their YAML/discovery capabilities is in the Home Assistant MQTT documentation.
Component pages:
- Button
- Switch and Outlet
- Select
- Text
- Number
- Climate
- Cover
- Fan
- Date / Time / Datetime
- Notify
- Siren
- Valve
- Humidifier
- Lock
- Water Heater
- Device Tracker
- Light
- Sensors (Value, State, Gauge, Counter, Total, Enum)
- Update