zwave-js-ui icon indicating copy to clipboard operation
zwave-js-ui copied to clipboard

MQTT V5 Protocol support

Open juanjoSanz opened this issue 1 year ago • 7 comments

Is your feature request related to a problem? Please describe. It is not a problem, I just see MQTT protocol is not define in mqtt client code, so I guess it uses v3.

Describe the solution you'd like I think it would be an enhancement if MQTT v5 is supported, as it comes with many interesting features.

Describe alternatives you've considered n/a

Additional context n/a

I understand that for compatibility, MQTT v3 is the default protocol version, I just think adding support to V5 would be a nice to have feature.

juanjoSanz avatar Mar 03 '23 08:03 juanjoSanz

Can I ask you why? I mean I could use mqtt v5 protocol without any problem, it's just a connection parameter, but wondering what specific feature of mqtt5 you are looking for here as all mqtt 5 supported brokers also support v 3.1

robertsLando avatar Mar 03 '23 09:03 robertsLando

In MQTT v5 you can manage persistent connection in a more efficient way, for example defining MQTT 5’s Session Expiry Interval.

It is just an enhancement that I think might be interesting.

juanjoSanz avatar Mar 03 '23 10:03 juanjoSanz

Yeah I know all the MQTTv5 features very well, I'm just curious what in detail you would like to be configurable from settings.

I mean setting the protocol to v5 is easy as mqttjs already supports that but that alone doesn't give you any advantages, when that is selected I should allow you to set session expiry or what else feature you want to use

robertsLando avatar Mar 03 '23 10:03 robertsLando

By the way, about MQTT version, I am not sure if zwave-js-ui uses v3.1 or v.3.1.1

If it is 3.1, there are some brokers that does not support it any more.

Do you know which version is used?

juanjoSanz avatar Mar 03 '23 10:03 juanjoSanz

It uses 3.1.1 by default as documented here: https://github.com/mqttjs/MQTT.js#important-notes-for-existing-users

(very old breaking change BTW before 2.0 version)

Another breaking change is that MQTT.js now defaults to MQTT v3.1.1, so to support old brokers, please read the client options doc.

robertsLando avatar Mar 03 '23 11:03 robertsLando

Thanks for the info.

juanjoSanz avatar Mar 03 '23 11:03 juanjoSanz

For MQTT V5 I would like to utilize the possibility of adding metadata to the messages pr. device ID by userProperty. In addition to the excellent possibilities to customize topics by name and location. Here is an example:

msg.properties = {
   userProperties: {
       "manufacturer": "heatit",
       "product": "multipurpose_relay",
       "tfm": "=5640.002.001%KXZ.001.005"
       };
}

Regards Arne-Olaf

airlabno avatar Mar 14 '23 22:03 airlabno