Toggle Switch to toggle state

Hi everyone,

I have a problem that im not sure how to fix or even where to begin. I plan on making a smart connected switch to kickstart my smart home experience. However to keep with my current homes look i plan to keep my current light switches and just modify them to work with an esp8266 and a relay module. My problem is that the current switches in my house are toggle switches much like the one attached in this post. My problem is that i dont know how to use these to control an arduino of sorts. So my question is this, how do i either use the toggle switch to do as i say above or how can i use it that each time it toggles it turns the light on if its off regardless of the state (so say someone turned the light on at the switch, then off via the esp8266 over the internet, then turned it back on via the switch being in the opposite position to its original.)

Thank you all in advance for your replies
Tim

switch1.jpg

Given that your wall switches are changeover, the circuit appended will work

regards

Allan

swrel.pdf (15.4 KB)