I have searched the forum and found issues similar to what I'm about to describe but not quite what I am after. There are a few paths I can think of to solve my problem but I'm not sure how to pursue any of them.
My IT department does not allow static IP's or any server/network changes. I am using three raspberry pi's for my project. Because there is the potential for each Pi's IP address to change I can't reliably use them. Hostname seems to be the way to go.
I am wanting to run Node-Red on the "main" Pi and then have the other two Pi's connect to the dashboard. I prefer not to have any Node-Red code running on the two remote Pi's. I have no problem connecting them to the dashboard. But I want to be able to reliably know if they are connected or disconnected from the dashboard. It is important that I have reliable status.
I have been able to use the ui_control node to detect "connect" and "lost" events and I can retrieve the IP address of each event using msg.socketip. However since the IP address could change, I would no longer know which IP address is which Pi. Other desktop or laptop devices might view the dashboard as well but I don't care about their status.
Is there a way I can search by hostname and see what the current IP address is assigned to that hostname? Then I could compare the list of connected IP addresses to the IP addresses associated with the appropriate hostnames?
Am I on the right track?