[BETA] MQTT app Home Assistant Discovery and statestream support

Ah ok! Good to know!

The one I grabbed is under the "Official Add-Ons" in the Add-On Store. So, the Community Add-On is replacing the Official one? See, this is why I like this community. That's kind of important stuff to know, and you guys are all over it. Thank you.

But to answer your question about your app connecting to it....

No, it doesn't. But I'm a million percent that this is not the app's fault. HA is having some weird authentication issues going on that I have not dug down to yet. I've tried, but like I said it's weird.

It seems that the broker over there is relying on a user called 'homeassistant' to authenticate. The problem is, I don't have that user anywhere. Not in the HA users, not in any yaml file. Any configuration that I use that uses any other user, breaks the connection between mqtt and node-red.

Worse, the only way I was able to get the homeassistant user to work, in node-red, was by trying, and succeeding (much to my frustration as a cybersecurity guy) to drop the password hash, that populated in the mqtt logs, into the credentials for node-red. I shouldn't be able to inject hashes like that and it work, but here we are.

So, I'm having an entirely separate issue with HA authentication. I don't expect you guys to help me resolve that. That's HA's mess, not Hubitat's.

But, just so I can learn my way around the functionality of the Hubitat App, to start with. Let's try to get my Shelly relay's working with the Hubitat App. Does the App make Hubitat a broker?

No - I think I've got that wrong. But the one they are deprecating is not based on Mosquitto so I'm unsure just now..

No - HE can never be a broker , it's a client and requires an external broker.

1 Like

Just for more background info. Here are my shelly's trying to connect to the HA broker

1592865221: Socket error on client , disconnecting.
1592865266: New connection from 10.0.1.73 on port 1883.
1592865266: Socket error on client , disconnecting.
1592865280: New connection from 10.0.1.96 on port 1883.
1592865280: Socket error on client , disconnecting.
1592865286: New connection from 10.0.1.66 on port 1883.
1592865286: Socket error on client , disconnecting.
1592865330: New connection from 10.0.1.73 on port 1883.
1592865330: Socket error on client , disconnecting.

The IP for my Hubitat is 10.0.1.164 (Don't worry, this is all in a lab environment)

So, the MQTT logs in HA are not seeing that IP even try to authenticate and get rejected. It's not hitting the broker at all.

Now I seem to remember that one of the HA brokers creates and enforces HA users with access via the (maybe now deprecated) HA user logins.

Would you be able to run MQTT Explorer. That will be such a help to you in the future and it's very easy to establish and try login credentials via that ?

Upon your recommendation in the other thread, I went ahead and installed it. I may need to watch a few youtube videos to learn to navigate it though

OK - we can sort that , I kinda know what might have happened there but let's get the broker easily accessible , e.g. to the Shellies or more easily and ideally MQTT-Explorer

1 Like

It's very straightforward and I can help if needed but run it up and enter your broker credentials and 'connect'. We need to establish a 'username' and 'password' that works

1 Like

Looks like we're going!

image

That's good so you have a username and password that is working. Now let's look into my MQTT app. Please find and delete the MQTT Client driver device and then re-run the app through 'done' with a log window open. You can pre configure the MQTT broker details before if you wish but do delete the current driver and let it (re)create a new one.

1 Like

The only problem (if it is a problem) is that the credentials are the login for Home Assistant. Not the mqtt-user I created in Home Assistant and configured in the configuration.yaml.

Is it supposed to work that way? Seems like the customer creds should work, no?

As for the app and client. Only thing installed (freshly) now is your app. :+1:

I'll leave you to sort logins as I don't use the add-on but you can enter the home assistant details in HE for the time being

1 Like

ClearPauseShow Past Logs

search

app:2892020-06-22 06:13:33.760 pm errorjava.lang.NullPointerException: Cannot invoke method reset() on null object on line 1013 (updated)

app:2892020-06-22 06:13:33.753 pm infoMQTT: Waiting for MQTT connection: false

app:2892020-06-22 06:13:33.654 pm infoMQTT: initialising with App count 0

app:2892020-06-22 06:13:33.641 pm errorMQTT: FATAL: No MQTT broker configured

app:2892020-06-22 06:13:33.638 pm infoMQTT: Hubitat hub name is : Hubitat_MQTT

app:2892020-06-22 06:13:33.629 pm errorMQTT: MQTT client failed to create

app:2892020-06-22 06:13:33.617 pm infoMQTT: Creating MQTT client child driver

app:2892020-06-22 06:13:33.612 pm infoMQTT: FYI your MQTT child devices are []

app:2892020-06-22 06:13:33.587 pm infoMQTT: MQTT Updated

Delete the MQTT child driver device and run the app again through 'done' (check there aren't two client devices)

hmmm, soooo

The child device driver is not listed in the devices menu. Looks like a relic remains from when I removed it before.

Reboot HE?

Yes, OK
Then wait for the app to run....
The client device has to be created as a child device but stupidly the app isn't able to do that until it has run once .. this is one of only a couple of known issues that still needs some attention.

Buy me a coffee or PayPal link is at the top of the app code. But it's a free app. Try it for a while and see if it suits.. If you feel I still need a coffee then revisit that.

1 Like

So, while that is rebooting...

Where do I find your "Buy me coffee" link? Gonna owe ya a box of beans before this is done! :smiley:

Same dealio, amigo

app:2892020-06-22 06:23:55.808 pm errorjava.lang.NullPointerException: Cannot invoke method reset() on null object on line 1013 (updated)

app:2892020-06-22 06:23:55.771 pm infoMQTT: Waiting for MQTT connection: false

app:2892020-06-22 06:23:55.349 pm infoMQTT: initialising with App count 0

app:2892020-06-22 06:23:55.290 pm errorMQTT: FATAL: No MQTT broker configured

app:2892020-06-22 06:23:55.286 pm infoMQTT: Hubitat hub name is : Hubitat_MQTT

app:2892020-06-22 06:23:55.257 pm errorMQTT: MQTT client failed to create

app:2892020-06-22 06:23:55.181 pm infoMQTT: Creating MQTT client child driver

app:2892020-06-22 06:23:55.175 pm infoMQTT: FYI your MQTT child devices are []

app:2892020-06-22 06:23:55.092 pm infoMQTT: MQTT Updated

Can you see an MQTT client device created ?
image

If so delete it and re-run the app through 'done'
You do have the driver code installed on HE ??

See, told ya I did something dumb!

I removed it when you said I didn't need to create things. That was my miss understanding.