homeassistant
Home Assistant is open source home automation that puts local control and privacy first. Powered by a worldwide community of tinkerers and DIY enthusiasts. Perfect to run on a Raspberry Pi or a local server. Available for free at home-assistant.io
+1 for Shelly as I have or any other drop in relay, all the wiring you'll need to do is behind the switchplate, you can decouple the input switch from the relay output and have HA trigger either output based on some input conditions. My fav config is having two flips of the switch perform a different action
shelly relays will do exactly what you want. just wire them as disconnected switches. i do this to simulate 3-way switches, but it'll work just as well to swap circuit behavior.
you can use a homeassistant action if you’re already using HA, or you can have the shellys call each others web api when it senses the switch.
AliExpress some ZigBee light switches. They arent connected to anything but through Openhab you use them to swtch ZigBee light switches that replace your existing switches.
If you want to skip wiring all together, pick up two Aurora Dimmers and put Hue bulbs in all your sockets. It's not the cheapest or most privacy friendly if you're using their hub. But going this way, you can put the dimmer near the fixture you want to control, you have no wiring whatsoever, connection to HA, and you're completely up and running inside of 30 minutes.
Seconding this, I have two aurora dimmers and they're awesome.
Install Enocean wireless, battery free switches. I've used them for many years, they work awsome. The switches can go anywhere you want (double side tape on any surface) or screw in as normal light switches. The act of pushing the button generates enough energy to send the RF signal to a receiver you install with the light and its powered from AC mains.