Nowadays, you get very cheap wifi switches based on ESP8266/85 and Tuya IOT services. As Tuya company offers very cheap smart home solution branding, you'll find a huge number of branded switches based on their service.
Only problem with these devices is that they are working with some China based servers. So every time you want to switch-on your light with such a switch, your command need to go to China and come back. In case your internet is down or their server is having trouble (which happens too often) … no light !
This is not exactly what you can call freedom. Hopefully some Open Source firmware like Tasmota are available to liberate your Tuya based IOTs. Once flashed with this firmware, your devices can be configured to connect to any local MQTT broker or Home automation server.
This article explains step by step procedure to flash a Tasmota firmware OTA on most ESP8266/85 Tuya based wifi switches. It typically needs a Raspberry Pi with a Wifi adapter and a Linux computer. Your Wifi adapter should be able to enter in AP mode (which is the case with most recent models).
It has been tested with a Ubuntu 18.04 LTS workstation, an old Raspberry Pi B+ and a D-Link DWA-131 Wifi USB key. TP-Link TL-WN727N has also been used succesfully.