It is read by the app from the device. Easy enough to test. Turn it on and off with the physical button on the device and note that the app sees the changes.
As far as I know there is no other input enabled on the basic. It might be possible to interface something external like a micro switch or magnetic reed switch that would provide a pulse when the gate passes by it. One problem with that is that you would not know for sure which way the gate was since it could get out of sync. You could go with one of the better Sonoff's with a current sensor and connect say a switch that closes when the gate is open with a high value resistor (light bulb maybe) in series with it. Then you would know the status of the gate by checking to see if it was drawing current.
Huh? I don't follow any of that. The app reads the state of the basic (on or off) and reports it. The state of the basic (on or off) is an active, not simulated output from the basic and an input to the app. The only physical input to the basic is the button on it.
You lost me. If you want to read the state of the device at the device just connect to the relay! Nothing is "simulated". The app reads the state of the device on your phone, the relay contacts are open or closed at the device. The state can be changed either by sending a signal from the app or pressing the button on the device.
There is no input on the basic that you can manipulate other than the pushbutton switch. GPIO14 is available on the header but not implemented in the standard firmware or app. As I said earlier go with something like the POW and connect a reed switch in series with a fixed resistor to. If you already have a high/low output from the gate control you can use a simple transistor switch and a resistor to produce two different "current" readings.
There is no input you can manipulate on the basic other than the push button with the current firmware and app.