Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow setting MQTT ClientId in moonraker.conf #883

Open
antlu65 opened this issue Jul 5, 2024 · 1 comment
Open

Allow setting MQTT ClientId in moonraker.conf #883

antlu65 opened this issue Jul 5, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@antlu65
Copy link

antlu65 commented Jul 5, 2024

Is your feature request related to a problem? Please describe

Moonraker instance connects to MQTT broker using empty ClientId. There does not appear to be any option to set the ClientId in Moonraker configuration. MQTT broker is responsible for assigning clientId to Moonraker MQTT client.

Describe the solution you'd like

A configuration option 'clientid' under the [mqtt] section in moonraker.conf. The Moonraker instance will connect to MQTT broker using specified clientId. If not specified, default value may be specified 'instance name' under the same section. If instance name not specified, default clientId may be device host name.

Describe alternatives you've considered

No response

Additional information

No response

@antlu65 antlu65 added the enhancement New feature or request label Jul 5, 2024
@antlu65
Copy link
Author

antlu65 commented Jul 12, 2024

I have zero experience working in Python, but I imagine it would look something like this:

(mqtt.py)
class MQTTClient(APITransport):
def init(self, config: ConfigHelper) -> None:
...
self.client_id = config.get('client_id', socket.gethostname())
(validation checks here)
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant