Dynamic Addition of Devices on Web-App MQTT

I have a bunch of devices that can connect to my Mosquitto Broker hosted on an Azure Virtual Machine. I have Node-RED running on a Azure Web-App. Using the UI Builder node I am buidling a user friendly website that allows the user to configure simple rules to controll the devices (a lot like IFTTT).

Each devices has a Device Type parameter (Thermometer per exmple). Now to populate the website I have 2 options

  • Hardcoded a pre-determined amount of devices and their parametres

  • Allow the user to add devices that are connected to the MQTT Broker dynamically

The second option is obviously the best one. However, I have no clue how to do it. I assume I would need a database hosted on my VM to manage the additiona and removal of known devices and to monitor their connection status but other than that I'm pretty lost. Any advice/project where this was implemented?


I use this flow from DeanCording it could give you some ideas, its primarily for sonoff devices but perhaps you could do something similar for your application.


This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.