You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(mqtt): add Home Assistant MQTT auto-discovery support (#1749)
* feat(mqtt): add Home Assistant MQTT auto-discovery support
Implements Home Assistant MQTT Discovery protocol for automatic device
and sensor registration. This allows BirdNET-Go to automatically appear
in Home Assistant without manual configuration.
Features:
- Bridge device representing the BirdNET-Go instance
- Per-source devices linked via via_device
- Sensors: species, confidence, scientific name, sound level
- LWT (Last Will and Testament) for availability tracking
- OnConnect handler for automatic discovery on reconnection
- Proper cleanup via RemoveDiscovery
Configuration:
- realtime.mqtt.homeassistant.enabled: Enable/disable discovery
- realtime.mqtt.homeassistant.discovery_prefix: Topic prefix (default: homeassistant)
- realtime.mqtt.homeassistant.device_name: Base device name
Closes#1717
* fix(mqtt): address code review feedback
- Extract publishInternal helper to eliminate duplication between
Publish and PublishWithRetain methods (~100 lines reduced)
- Add RegisterHomeAssistantDiscovery exported method for reconfiguration
- Register HA discovery handler in handleReconfigureMQTT so discovery
messages are published after MQTT reconnection/reconfiguration
---------
Co-authored-by: tphakala <tphakala@users.noreply.github.com>
0 commit comments