Hello everyone,
I'm new en node-red and I need create flows dynamically at runtime, it's possible?
Thank you in advance
Hello everyone,
I'm new en node-red and I need create flows dynamically at runtime, it's possible?
Thank you in advance
Hi Jasper
Nearly everything is possible in life but what you want would be very tricky to accomplish, it would be very messy and there is almost certainly better ways of achieving your end goal
And even harder for someone new to to Node-RED
What is it that your actually wanting to do?
Thank you for your answer cymplecy.
I want to control weather of several habitats, and the number of habitats depends of the user. For example, when a new device is paired on the system by the user , a temperature and humidity sensor, I would need to dynamically create the dashboard that shows the data of that sensor.
Several questions come to mind
You should to do some searching thru the forum about the perils of opening your system to the internet. That said, you could use something like Telegram to communicate between the devices, store the data in a database id by a unique device ID and th database could list the devices. The user could select on and you could display it's data.
But this would not be creating flows dynamically, just displaying data dynamically
Hello zenofmud.
I will try answer all your questions.
Q: how will the sensors send data to NR?
A: Sensors send data to NR via MQTT
Q: Is there going to be more than one user?
A:No, only one user, I know that dashboard is shared amoung all users, thank you for the note.
Q:are the sensors at remote locations?
A: No, sensors will be at near location of server were will run NR.
Q: You say you want the user to 'control' the sensor - what does that mean?
A: The user will can watch the values given by the sensors throught Internet.
Q: You should to do some searching thru the forum about the perils of opening your system to the internet.
A: I know them, I'm new in NR, but I ain`t new on the development of IoT apps and NR can be secured.
Q: That said, you could use something like Telegram to communicate between the devices, store the data in a database id by a unique device ID and th database could list the devices. The user could select on and you could display it's data.
A: Yes I could, but then I wouldn't show the data on a NR dashboard gauge for all sensor and do it on unique screen, according to them are added by the user.
The way I've done things like this is the past is to create a single Dashboard that shows all the data for a single sensor. The you can add a "selection" list to present all the sensors currently known to the system. So for instance, the Dashboard currently shows Sensor A -- when the user selects Sensor B, then the flows retrieve the historical data for that new sensor and populate the charts/graphs, and begin listening on that new topic for any new data coming in realtime.
There would also be a section on the dashboard that allows a new Sensor C to be added. After gathering the info for the new sensor (name, location, mac/ip addr, type, whatever) this info is added to a stored list of sensors (like a db table), and the Dashboard view is switched to show data for the newly created sensor -- since there is not any historical data yet, the widgets would be empty, but immediately start updating once the new connection is made.
If you need to show more than 1 sensor (or group of sensors) on the Dashboard, you will need to dynamically create them based on user input (which is not possible with the ui_*
dashboard nodes). In that case, I would look at using ui_builder
and creating my own control panel (i.e. "dashboard") viewer.
Thank you very much, It was a clear and precise answer.