Using AC712 and relays with NearBus Cloud Server

Hello everyone, I’m new here and I hope I’m using the forum the right way.

I’ve set up the Nearbus server to switch on and of a relay, and it’s working. I’ve connected a light switch and a light bulb with my relay and now I have a problem. The server registers when relay changes state, but not when the light switch turns the light on. I understand that I need a sensor to make this work but I don’t know how to make the server read the state of the A0 pin and still turn on and of the relay via D3 pin.
The Nearbus code is attached.

Can someone help me with this?

Hello_World_Ether.ino (12 KB)