[Beta] MQTT beta 3d (released 5th July)

Thanks Trent - much appreciated - expresso now and a beer later to celebrate my code survival

LOL I'd toast to that!

I'm longing for the days where work travel resumes and can get back to the UK for a proper pint. Beer is better than it has ever been in the US, but I still prefer the pubs in the UK.

3 Likes

Different port on the Ethernet switch?

Yes and it's a reasonable quality switch (Ubiquiti) - when I look at it now it's auto-negotiating on all devices connected to that port to 10Mbps half duplex. Ping works though !. All other ports are fine - and it was working fine on that port for months.

Doh. I've had individual ports go bad on ubiquiti switches (more than once), but never all of them like that.

This is only one port on a switch... but any devices connected to that port fail (so it's a single duff port)

Oh, gotcha. That's annoying.

> mqtt:
>   broker: 192.168.2.112
>   username: mqtt
>   password: ohieigqz
>   discovery: true
>   discovery_prefix: homeassistant

My HA config looks almost the same.
I believe the deprecated MQTT broker you're thinking of is the MQTT Server & Web Client. The Mosquito broker is the recommended one for HA and installed directly through the HASS add-on store.

I know it's working with HA because I connected my ring alarm to it yesterday and the devices published right away. Like I said, I'm sure it's something simple I'm missing here.

These are the settings in the MQTT app. It seems pretty straight forward.


In MQTT explorer Closet light is showing up in 3 locations. hub mode is only showing up under homie though (this is the one thing I'm really hoping to pull into HA)

And as I mentioned, it's showing up in the mqtt log
1590609198: New connection from 192.168.2.12 on port 1883.
1590609199: New client connected from 192.168.2.12 as Hubitat_hubitat-mqtt (p2, c1, k60, u'mqtt').

Just nothing for closet light and nothing for hub mode showing up in HA.

Well I don't know what happened. I made this post, cooked some macaroni for the kid, came back and closet light is now there. Hub mode isn't, but the light came through. Didn't change any settings at all

Magic... it likes macaroni too.

Ahh - I didn't know Mosquitto was available via the add-on store.

Anyway I suspect hub mode doesn't show up there but it could do - I'll add it into the next hot fix for beta3

You have another 'homeassistant' topic on your broker with a blank topic before
/homeassistant
at the bottom of your tree - is that intended ?
You can delete it if not by clicking on it and selecting the trash icon in MQTT Explorer as it's probably retained on there as HA MQTT discovered devices is 'Remember' (correct)

That's what the M in MQTT stands for right? Macaroni? LOL

Not intended. I'll clean it up after I get a bit more familiar with MQTT :slight_smile:

I have posted the first hotfix .. named beta3a. I'm pretending it's June already.
Link is in the first post

Fixes:

motion topic
virtual Garage Door close/closed support and loop avoid
undefined topics reduced
illuminance
contact
modes now work again
HomeAssistant supports multiple entities for compound devices again
some speed improvements - more to come
various other bug fixes and code refinements
additional devices slowly being added
contact sensors with switch support added (thanks Jeff)

child MQTT driver error messages still there on install but workaround does work. I know what it is now...

If I've missed something give me a nudge....

2 Likes

Just a quick recap of something mentioned above for new users...

If you have difficulty connecting to MQTT the first time you install the app (as you likely will) then delete the MQTT Client driver device and run the application again. You do not need to delete the driver code.

I mistakenly thought that 'adding' an application 'installed' it but I've since learned it is only installed after you click 'done' the first time. I create the device driver before that and so it is not being created as a child device to my app. Hence the issue.

A good indication that it is wrong is if you look in the device details it will not be 'in use' by MQTT. i.e. it is not a child device

image

Not sure if this is important, but I am seeing these logs repeating:
dev:1132020-06-02 05:24:00.180 am traceMQTT> Received this message from homie [homie, hubitathub, $implementation, heartbeat] [4, none]

dev:1132020-06-02 05:24:00.075 am debugMQTT> Tx: heartbeat [4] none

dev:652020-06-02 05:23:59.495 am infoMQTT> Connecting as Hubitat_temporary to MQTT broker null

dev:652020-06-02 05:23:59.487 am infoMQTT> MQTT> client null temporary

dev:652020-06-02 05:23:49.481 am infoMQTT> MQTT connect failed attempt:[null], try again in 10 secs

dev:652020-06-02 05:23:48.459 am infoMQTT> Connecting as Hubitat_temporary to MQTT broker null

dev:652020-06-02 05:23:48.451 am infoMQTT> MQTT> client null temporary

What are devices 113 and 65 ? They both look like MQTT Client drivers but you should only ever have one such device present on your system and it should be a child device. They are conflicting in their MQTT access.

Also you are at TRACE and DEBUG level in your logging on device 113 which is much more verbose than the norm.

device 113 seems connected OK but device 65 is wrong - probably not a child device of the MQTT app.

MQTT> client null temporary shows its not talking to the MQTT app.

I have now come across a third instance where the command does not match the status . It was easy whth on/on and 55/55 but close/closed open/opened and now arm/armed are cropping up in a few places so I need to rethink this.

I am leaning towards an 'advanced' or 'split' checkbox for each device to enable both a _Cmd [MAP] and _Topic [MAP] for attributes or as is now just the _Topic [MAP] shared by both. Default will be to hide the _Cmd ones.

You can work around this but it requires two devices instead of one

I wonder how many are caused by the '...ed' ending .. maybe I could just ignore those last two characters ... problematic methinks.

I managed to break the app while messing around with virtual switches. I plan on removing and reinstalling everything fresh. Need/want any logs before I do so?

How is it broken ? Does it error on entering the virtual devices page ?
If so manually delete the last virtual device you created.

No, it errors when I try to open the app:

Unexpected Error

An unexpected error has occurred trying to load the app. Check Logs for more information.