Sending request to NodeMcu from Cloud server

Hi,

I want to identify my NodeMcu over the internet, so that can directly command it to do something.

Right now I am using firebase and every second I am checking the values whether they are changed or not from NodeMcu to perform the operation, so I want to reduce the network calls making calls every second is no convenient option I guess.

so I there any way to directly connect to NodeMcu from cloud server?

Also how home automation companies are connecting their devices directly.?

so I there any way to directly connect to NodeMcu from cloud server?

Forget the "cloud server" crap for now. Your real question is "Can I connect to the ModeMCU from the internet?". And the answer to that is maybe. How is your NodeMCU connected to the internet? Typically, that is through a router that has a public IP address. If you dedicate the ModeMCU to a port, and enable port forwarding on your router, then requests to the Public.IP.Add.Ress:DedicatedPort will get forwarded to the ModeMCU.

Of course, your ISP (internet service provider) may not like you doing that. And, your ISP may change the public IP address of your router at will.

You pay extra, reasonably, for a static IP address.

you have your own application in cloud? let the request wait until you have something to respond