Draft
Conversation
Co-authored-by: Apollon77 <11976694+Apollon77@users.noreply.github.com>
Co-authored-by: Apollon77 <11976694+Apollon77@users.noreply.github.com>
Co-authored-by: Apollon77 <11976694+Apollon77@users.noreply.github.com>
Co-authored-by: Apollon77 <11976694+Apollon77@users.noreply.github.com>
Co-authored-by: Apollon77 <11976694+Apollon77@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add support for MQTT v5 in implementation
Add MQTT v5 protocol version support
Oct 17, 2025
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR adds support for MQTT v5 (protocol version 5) while maintaining full backward compatibility with the existing MQTT v3.1.1 (protocol version 4) implementation.
Closes #[issue number]
Problem
The adapter was hard-coded to use MQTT v3.1.1 (protocol version 4), preventing users from taking advantage of MQTT v5 features such as:
Reference:
ioBroker.mqtt/lib/securityChecker.js
Line 24 in 6d9dc1f
Solution
Added a configurable
protocolVersionoption that allows users to select between MQTT v3.1.1 and MQTT v5:Admin UI Configuration
Client Mode
The adapter's MQTT client now respects the configured protocol version when connecting to external brokers:
Server Mode
The adapter's MQTT broker automatically supports both protocol versions simultaneously. The
mqtt-connectionlibrary handles protocol negotiation automatically based on each client's connection request, so no configuration is needed - the server accepts both MQTT v3.1.1 and v5 clients out of the box.Security Checker
The public IP accessibility checker now uses the configured protocol version to ensure security checks work correctly with both protocol versions.
Technical Details
mqtt(v5.14.1) andmqtt-connection(v4.1.0) fully support MQTT v5Testing
test/testProtocolVersion.jsto verify protocol version configurationFiles Changed
admin/jsonConfig.json- Added protocol version selectoradmin/i18n/*.json- Added translations (11 languages)lib/client.js- Use configurable protocol versionlib/server.js- Added documentation commentlib/securityChecker.js- Accept protocol version parametermain.js- Pass protocol version to security checkertest/testProtocolVersion.js- New tests for protocol version functionalityMigration
No migration needed - the adapter defaults to MQTT v3.1.1 (protocol version 4) for backward compatibility. Users who want to use MQTT v5 can simply select it in the adapter configuration.
Original prompt
Fixes #487
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.