MQTT Client - Beta


Looks like they needed unique clientid's, which makes sense. Mosquitto was doing this as four different clients w/ the same client id were connecting and reconnecting:

New connection from XX on port 1883
Client hubitat already connected, closing old connection


Are you saying that multiple connections to MQTT are being made by my MQTT HE app using the same clientID ?? This would of course cause problems but I only use one broker connection for all devices, publish topics and subscriptions so this shouldn't happen.

... Or are you saying you were connecting your own external 'distinct devices' to the MQTT broker using the same clientID's, which also wouldn't work ...and so you've now fixed your devices clientID's to be unique ?

Or maybe this is not do with my MQTT app at all ?



I am very interested in beta testing your client. I have a working MQTT Broker (Mosquito) working with OpenHAB and Smartthings. I have the other code listed above working on Hubitat, but is only one-way.
I have written groovy devices/apps for ST, am familar with HE's custom apps and logs. So I should be able to provide some useful feedback.

Apparently, I am too new to be able to PM. Any other means to contact you?


Contact made.. I’ll send you a link to the download shortly. Unfortunately I have reached the community max number of users in a private topic and @chuck.schwer has not been able to raise it so I can’t include any new people in that thread, but the app will be beta and public fairly soon.

Re OpenHAB - they have found a significant issue with their core MQTT libraries and this is not going to be fixed even in OH2.5M2 so I don’t hold out much hope for my app working well with OH via homie discovery. But HomeAssistant discovery, which OH also supports should work fine.


Can I just link it to a Mosquito MQTT Broker? My link from OH to MQTT has been stable.


Of course..

OH promote their own auto discovery protocol for MQTT - but it's broken in OH 2.4 currently.


I want automagic.


Any word on when this will proceed to public beta? I just set my HA to get my ring devices and drop them out to MQTT. Would like to bring them into HE. Currently using a dozen routines in Alexa to update HE but it is ugly. Thanks!


Hi Blake, alpha4 will be the last alpha. A few people are pre-testing this currently and then it (alpha4) will be available to all the alpha group which is about 40 strong.

The next release is then intended to be the beta available to all. If you're keen to test then PM me and join the alpha group.


I have an Arduino (WeMosD1mini) sketch for my Garage with a 'smart' relay (on/off - not toggle), and two GarageDoorSensors
GaragePortSensor1 - triggers when the door is fully closed (0/1)
GaragePortSensor2 - triggers when the door is fully open (0/1)
The sensors are picked up by the MQTT Client, and shows up correctly in Hubitat.
How can I program a GarageTile so that it shows correctly even if I use the physical switch or the key-chain remote on the garage-system not connected to Hubitat?
I'd like to pick up the sensor data (closed), and have the tile turn green, and vice-versa - automatically.
I also have a temp-probe on the Arduino. How can I have this show up on a Tile.
In MQTT I can name the sensors whatever I choose, it that is of any help.



Quick question about the publish parameters based on documentation. I am attempting to execute the following command:

interfaces.mqtt.publish(settings?.topicPub, s, true)

But I am getting errors due to the "true." Based on documentation this should be the retained option boolean of true/false but I get this error in my logs:

dev:28712019-09-11 08:51:29.181 am errorgroovy.lang.MissingMethodException: No signature of method: hubitat.helper.interfaces.Mqtt.publish() is applicable for argument types: (java.lang.String, java.lang.String, java.lang.Boolean) values: [wardhome/salt-tank/delay, 1, true]

Is there a bug in the MQTT client beta?


You are missing a parameter, there are 4 parameters for that call:
void publish(String topic, String payload, int qos = 1, boolean retained = false)

1 - topic
2 - payload
3 - qos
4 - retained

The last 2 are defaults, so if you leave them off they default to 1 and false.. but if you want to change the 4th parameter you also have to pass the 3rd parameter


Oh wow I completely glossed over that. Much appreciated!!