2.2 KiB
Entities
ArduinoHA supports these Home Assistant MQTT discovery entity classes. Choose the focused example where possible; it shows the entity's update or command callback pattern in a runnable sketch.
| Entity | Example |
|---|---|
| Binary sensor | binary-sensor |
| Button | button |
| Camera | esp32-cam |
| Cover | cover |
| Device tracker | Use the API header; no dedicated sketch yet |
| Device trigger | multi-state-button |
| Fan | fan |
| HVAC | hvac |
| Light | light |
| Lock | lock |
| Number | number |
| Scene | scene |
| Select | select |
| Sensor | sensor, sensor-analog, or sensor-integer |
| Switch | led-switch or multi-switch |
| Tag scanner | tag-scanner |
| Text | Use the API header; no dedicated sketch yet |
The library does not currently implement alarm control panels, events, humidifiers, images, lawn mowers, sirens, updates, vacuums, valves, or water heaters. Those are deliberate unsupported surfaces, not configuration switches.
Common lifecycle
Create HADevice, HAMqtt, then entities in that order; create them before mqtt.begin(...). Call mqtt.loop() regularly. Read Getting started for the connection flow and device discovery for discovery settings.
For shared online/offline state, use device.enableSharedAvailability() and device.enableLastWill() before connecting. The availability examples show the simplest setup, while advanced availability covers custom payloads and Last Will behaviour.
Back to the documentation map.