Is it possible to write an "extension" to an existing binding?

Is it possible to create an extension to an existing binding? In general, I’m thinking it would be writing a new thing for existing binding. I’m especially interested in doing this with the MQTT binding.

The MQTT binding has existing extensions for Homie and HomeAssistant discovery. I’m not sure how good models they would be for complying with guidelines for such things.

I’m looking to write a “custom app specific” MQTT interface just as there is a Homie and HomeAssistant. In other words, the custom app currently uses MQTT (and other methods), but it would be cleaner for the user to implement if it used the terms used by the app instead of generic MQTT terms as the MQTT Binding would require. I could write a custom binding but with all the talk (on various threads) about using MQTT over writing a new binding, I thought this would be a better solution.

It’s code so obviously anything can be done.

But is your question really asking that if you write it will it be accepted and merged into the baseline? In this case I’m not sure, I’m not one of the developers. But I would ask why you are writing yet another MQTT topic standard instead of using one of the already implemented ones. It smells of “not invented here” so it should (in my opinion) face a higher bar than, for example, adding a new binding that implements a wholly new technology interface.

If all you are looking to do is to rename standard MQTT/openHAB standard stuff then I doubt it would be accepted.

If you are adding something that can automatically discover and create the Things, then what does your standard add over Homie or Home Assistant? Note that if you support either of these standards you become compatible with a whole lot more than just openHAB out-of-the-box. And once the Things are discovered and accepted from the Inbox, it uses the names for things you define so there is no need to change anything to the binding to expose to the users your names for things. In short, once the Thing exists, all the MQTT specific stuff is done and all the user has to do is identify which Channels they want and link them to Items.

I think there might be some bindings that use MQTT under the covers but are implemented as a separate binding because there is some request/response type behaviors that need to be implemented above and beyond just sub/pub. In those cases MQTT is just the transport but there is more involved than just MQTT so a separate binding is warranted.

I’m not worried about it being merged into the baseline.

I’ll take a closer look at Homie and Home Assistant, but my initial look suggested it wasn’t a fit.