Doghouse wrote: ↑Mon Dec 24, 2018 3:27 pm
Is it possible to connect a Pi to the router (either wireless or via Ethernet cable) to control WiFi switches to control the lighting?
You can connect the Pi to the router, but whether you can control your Wi-Fi devices depends on whether they can be controlled locally or will only accept commands via the internet.
Most sensible home automation products will allow local control or everything stops working when the internet connection goes down but some devices do require an internet connection.
You'll also need software to control the devices. Details of the devices, any product information, will help get you an answer on what that software would be and the protocols used.