Add MQTT token pairing for GX device - #126
Merged
Merged
Conversation
philipptrenz
added a commit
to philipptrenz/ha-victron-mqtt
that referenced
this pull request
Aug 13, 2026
Owner
|
Can you add some tests for this new function? It will also help to show what is the GX device expended output. |
Owner
|
Also, it will be nice to update the README.md file with the new functionaility + sample code. |
tomer-w
reviewed
Aug 13, 2026
tomer-w
reviewed
Aug 13, 2026
Owner
|
Looks good. Just fix the failed check. |
Contributor
Author
|
That should work now. |
Contributor
✅ Static Tests passed |
Owner
|
Thanks @philipptrenz !! |
philipptrenz
added a commit
to philipptrenz/ha-victron-mqtt
that referenced
this pull request
Aug 13, 2026
philipptrenz
added a commit
to philipptrenz/ha-victron-mqtt
that referenced
this pull request
Aug 13, 2026
philipptrenz
added a commit
to philipptrenz/ha-victron-mqtt
that referenced
this pull request
Aug 14, 2026
tomer-w
pushed a commit
to tomer-w/ha-victron-mqtt
that referenced
this pull request
Aug 14, 2026
* Improve GX device config flow - Add SSDP detection of X_MqttTokenPairing from GX device discovery - Add automatic token pairing flow: when a GX device advertises token pairing support, retrieve MQTT credentials via HTTPS POST to /auth/generate-token/ instead of prompting for manual password entry - Show pairing instructions in the UI, prompting the user to enable pairing mode on the GX device before submitting - Try SSL (port 8883) first during SSDP discovery, fall back to plain MQTT (port 1883) if unavailable - Simplify SSDP auth form: hardcode username to remoteconsole, rename password field to "GX Password", default SSL to on - Add second SSDP matcher for X_MqttTokenPairing=1 so discovery triggers even when X_MqttOnLan is disabled; issuing a token automatically enables "Paired devices only" access on the GX - Add PairingError exception and pairing_failed error string - Add CONF_MQTT_TOKEN_PAIRING constant, stored in config entry data when token pairing is used - Add translations for all new UI elements in en, de, fr, ca, sk - Add tests for token pairing success, HTTP error, connection error, MQTT validation failure, and fallback to manual auth * Move request_pairing_token function to victron_mqtt package; depends on tomer-w/victron_mqtt#126 * Refactor config_flow: make mqtt_token_pairing transient flow state * Refactor: move HTTP session creation into request_pairing_token; depends on tomer-w/victron_mqtt#127 * Refactor: remove aiohttp import from config_flow
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.
Related to tomer-w/ha-victron-mqtt#483