Client to connect states to MQTT Broker
npm install iobroker.mqtt-client!Logo


!node-lts
!Libraries.io dependency status for latest release
!GitHub
!GitHub repo size
!GitHub commit activity
!GitHub last commit
!GitHub issues
!GitHub Workflow Status
Publish and subscribe ioBroker states to MQTT Brokers
on connect message` is published to the `on connect topic` every time the client connects or reconnects to the server.$3
The `on disconnect message` is published to the `on disconnect topic` when the adapter stops gracefully.$3
The `last will message` is published to the `last will topic` every time the client connects or reconnects to the server.
The Server will store this message and send it to its subscribers when the client disconnects unexpectedly.$3
Comma separated list of topics that are not covered by existing states.
Received messages are converted to states within the adapter's namespace (e.g. mqtt.0) and subscribed.
You can remove topics after all states have been created.$3
When publishing this will be prepended to all topics.
Default is empty (no prefix).$3
When subscribing this will be prepended to all topics.
Default is empty (no prefix).State Settings
!State$3
Enables or disables the mqtt-client functionality for this state.
Disabling will delete any mqtt-client settings from this state.$3
The topic this state is published to and subscribed from.
default: state-ID converted to a mqtt topic.$3
* `enable` state will be published
* `changes only` state will only be published when its value changes
* `as object` whole state will be published as object
* `qos` see
* `retain` see $3
* `enable` topic will be subscribed and state will be updated accordingly
* `changes only` state will only be written when the value changed
* `as object` messages will be interpreted as objects
* `qos` see
* `ack` on state updates the ack flag will be set accordingly#### Note
* when ack is set to true it will overwrite objects ack, see
`as object`
* to prevent message loops, if both publish and subscribe are enabled `changes only`` is always on for subscribeCopyright (c) 2025 iobroker-community-adapters
Copyright (c) 2016-2023 Pmant
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.