The MQTT Export Integration allows publishing device events and receiving device commands over MQTT, a lightweight IoT messaging protocol. In some sense, this integration is similar to Maker API but works over MQTT instead of HTTP.
NOTE: The MQTT Export Integration app is currently in beta. As such, you may encounter occasional bugs, breaking changes, features that temporarily differ from documentation, or other issues. If you wish to provide feedback, we suggest visiting the Community forum.
To install:
- Navigate to Apps.
- Select Add App or Add Built-In App.
- Select MQTT Export Integration from the list.
To enable, select the Enable link at the top of the MQTT Export Integration app. If you no longer wish to use the app, it can be disabled using a similar link at the top of the app (your settings will be preserved if re-enabled later) or removed (which will also erase all settings besides removing the app).
To use the MQTT Export integration:
- Decide whether you want to use an external MQTT broker (recommended) or enable the built-in MQTT broker (this may make sense if Hubitat is your only use for the MQTT broker).
- If using an external MQTT broker, provide the host (e.g., 192.168.1.5), port (often 1883 for plain or 8883 for SSL/TLS), and — if necessary for your MQTT broker — the username and password.
- If you prefer to use the internal MQTT broker, enable the Use built-in MQTT service option. The integration will be automatically configured to use the built-in broker if enabled. The broker will also be accessible on your network for other uses at the provided IP address and credentials. (Keep in mind that the built-in broker will also be restarted when your hub reboots.)
- If you wish to publish device states over MQTT or control devices over MQTT, select devices from either the Select read only devices or Select CONTROLLABLE devices list. Controllable devices will also publish events (i.e., provide read access), but read-only devices will not acceept commands over MQTT.
- If you wish to view or set hub mode or hub variables over MQTT, enable the corresponding option.
Examples of the required formats are provided in the app UI. Note that while the integration is in beta, additional options may be added or formats may change.
- Publish Home Assistant MQTT device discovery info: will additionally publish device events in Home Assistant MQTT discovery format, allowing exporting Hubitat devices into Home Assistant using the built-in Home Assistant MQTT integration. (At the moment, only the default
homeassistant topic is supported.)
Select Save app settings and reconnect after changing any of the above settings to apply them.