wemos d1 minis static IP addresses?

I am going to program some of these d1 mini esp2866 boards as clients. I have a Linux computer which will host a server with a GUI and I wand the D1s to act as client and listen for data.

For instance when my wifi alarm clock goes off, it must send a byte to the server which then sends a byte to the thermostate which will heat my house. And I want to use my smartphone or monitor which is hooked up on the server to controll the color of my RGB ledstrips.

For all this to work I figured that static IP addresses for all wifi boards would be a good Idea. But how do I do this in code exactly?

use WiFiManager and look at examples with static IP configuration

Do you realize that the server cannot send data to a client? The client has to initiate the connection to the server.
Take a look at MQTT.

You don't need static IP addresses either, just use DNS or mDNS.

Pieter

thank you I will try it out