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

Unable to set remote mqtt username and password #14

Open
iFloris opened this issue Sep 8, 2022 · 2 comments
Open

Unable to set remote mqtt username and password #14

iFloris opened this issue Sep 8, 2022 · 2 comments

Comments

@iFloris
Copy link

iFloris commented Sep 8, 2022

Hello, thanks for building this great local alternative!

I am trying to get this working with the docker install version, as I already have Mosquitto broker running on my home assistant install with other MQTT tools.

However, I am having trouble getting pethublocal to talk to my Home Assistant Mosquitto broker.
I do not know how to tell pethublocal to use a username and password for MQTT. As such, I am getting the following:

2022-09-08T06:52:23.901221299Z INFO:pethublocal:MQTT: Init MQTT Host 192.168.1.x
2022-09-08T06:52:23.902791369Z INFO:pethublocal:Error "[code:5] The connection was refused.". Reconnecting in 3 seconds.

I tried to edit the pethubconfig.json, inserting a username and password as a test (which I also added as a user in home assistant):

        "MQTT": {
            "Host": "192.168.1.x",
            "Username": "pethublocal",
            "Password": "pethublocal"
        },

But that does not seem to work.

How can I get pethublocal to use a username and password when connecting to a remote MQTT server?

@En3myNightmare
Copy link

You must use "ClientUsername" and "ClientPassword". This is how it is defined in Frontend.py.

@fpschrisiom
Copy link

fpschrisiom commented Oct 21, 2023

Just to clarify for anyone, in your pethubconfig.json you set your MQTT user/pass that is in home assistant, like this:

        "MQTT": {
            "Host": "YOUR_HA_IP",
            "ClientUsername": "WHATEVER_MQTT_USER_YOU_HAVE_IN_HA",
            "ClientPassword": "WHATEVER_MQTT_PASS_YOU_HAVE_IN_HA"
        },

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

No branches or pull requests

3 participants