I have an IoT device that is connected to a WiFi network. Currently, the IoT device runs a small HTTP server, and send RF signals when it receives POST requests via the internet from HTTP clients. To make this work, I have to enable port forwarding on my WiFi router, and the HTTP clients have to connect to the IP address of the router. This seems like a bad way to go about it.
I notice there are devices that work from within WiFi network - like Ring doorbell, Wink devices, etc, that does not require port forwarding, etc. I am wondering how this is done.
I am guessing that these devices are actually HTTP clients and connect to outside servers. Then, the server actually sends the commands to the client (IoT) devices.
If this is so, would you please give some guidance on how to create the server (in Python), how to connect the IoT device to the server (HTTP connection), and how to send the commands from the server to the client (cannot use POST as this is the wrong direction).