Autocomplete MQTT topics in Node-RED
Story
As a Node-RED Developer I want to have my MQTT topics autocompleted So that I can build solutions integrating with my MQTT broker faster and more efficiently.
Details
There is likely to be a couple of child components here:
- Work in Node-RED
- Work in FlowFuse to pass context/information to the Node-RED Editor
Fundamentally, we want to provide auto-complete functionality in the MQTT nodes when running on FlowFuse. The autocomplete should provide suggestions from the Team's known broker hierarchy.
The technical challenge here comes in two places:
- The MQTT nodes providing a way to plugin auto-complete suggestions
- Only apply those suggestions if they have a config node selected related to a broker we know about.
Item 1 will require work in the core of Node-RED. Item 2 will require the plugin api provided by Node-RED to provide information on the broker selected, and for us to implement such a plugin that can retrieve valid completions from the platform.
I'm going to get the Node-RED side of this done now so that it is in the 4.1 release. Plugging it into the FlowFuse side can then follow, but at least we have the NR side released.
The Node-RED piece is provided by https://github.com/node-red/node-red/pull/5194
The remaining tasks are:
- Pick API from the platform to get the list of available topics for a given broker. Big open question on how we correlate the MQTT broker config with the brokers we know about on the platform.
- Create NR plugin to access that API and plugin to the mqtt node (via the work done in the PR linked above)
I estimate 2-3 story points remain on this task
@knolleary we had discussed earlier this week about us using a FF-own "MQTT/Realitime" node, alongside a pending "Tables" node too for the future. Assuming given the status update here that was decided against, at least for now?
@joepavitt no decision has been made either way - nothing has been discussed or issues raised for it. But I knew if the Node-RED side of this missed 4.1 it would then delay when it could be shipped. So for the sake of an hour's work, I got the NR side done.
Taking the "epic" label off of this as we've agreed to pivot in the direction of https://github.com/FlowFuse/node-red/issues/40
@gstout52 I think we can close this out given the move in direction elsewhere? I think the sizing can also drop to a 1 or 2, given that scale of work that Nick needed to do in Node-RED core, and then we've now assigned into other issues.
Closing this issue as we have pivoted in the direction of https://github.com/FlowFuse/nr-project-nodes/issues/114