#MQTT basics

1 messages · Page 1 of 1 (latest)

zenith hearth
#

Hey all, I'm trying to get the MMM-HomeAssistant module for MagicMirror2 working, but I'm having considerable trouble wrapping my head around the basics of MQTT in HA.

Does HA provide an MQTT broker, or am I expected to supply my own? I installed the MQTT integration as best as I could, but the port 1883 remains closed on my HA instance.

Some leg up figuring out the basicw would be greatly appreciated.

#

It would appear my client can't connect to the mqtt broker, becasue it needs an user and a password. How do I get those?

mortal mason
#

You added just the standard 'MQTT' integration right? Have you added an entry yet? (this connects to your broker)

#

Something like this??

zenith hearth
#

I have installed the mosquitto addon, and I have an entry under the MQTT integration, yes.

normal rune
#

the addon provides the broker. the integration connects to it

zenith hearth
#

So there should be a broker running now. So far, so good. Now I need to get my client to be able to connect to it. That apparently requires credentials. Where would I find those?

mortal mason
#

inside the configuration for your addon is where you can add 'logins' for an option with username and password

#

the 'network' further down is where you can modify ports

normal rune
#

by default the broker uses HA users to authenticate

#

i have a dedicated user on HA that i use to log into it

mortal mason
zenith hearth
#

So if I create a ha user (not person) and use those credentials, It should work? Let me test that real quick...

#

Ok, device logs say it's talking to the broker. Now, about that auto-discovery, how is that supposed to work? Device pushes to homeassistant/...stuff and I should get a popup in my integrations tab that a new device has been discovered?

normal rune
#

if the data being pushed to the broker includes the home assistant autodiscovery payload and you have the integration connected to the broker then stuff just magically appears

mortal mason
#

Are you sure the mmm module uses auto-discovery?

zenith hearth
#

Well, that doesn't seem to happen yet.

zenith hearth
normal rune
#

in the mqtt integration under the broker select devices and see if they have appeared

zenith hearth
#

Wait, now it popped up.

mortal mason
#

In your mqtt integration click on configure -> configure mqtt options

is discovery enabled?

zenith hearth
#

Seems to have taken a few minutes to realize it had a baby...

mortal mason
#

It be like that sometimes

zenith hearth
#

So long as it eventually works, I'm fine with that.

normal rune
#

yeah its usually pretty quick with new devices once its settled, but sometimes when its just getting going it might be a bit confused at points

#

its been very "set and forget" for me tbh

zenith hearth
#

It WAS the first ever device, so I'm prepared to cut it some slack.

#

Anyways, thanks for your kind help getting me off the ground, I think I should be able to take it from here.

normal rune
#

awesome, good luck with it!

zenith hearth
#

MQTT isn't rocket science after all, just figuring out how THAT dev integrated it in his or her very own way can often be a little challenging.