Start a new topic

Sonoff basic switch status - simulated or feedback

Hi, I'd like to use a sonoff basic to monitor the status of my gate, willing to sacrifice a device but need to know if the on/off status on the app is simulated or if it's an input from the basic? That way I can just connect my sensor to the input and read the status on the app as on/off for open/close

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.

OK, so if I would like to monitor my gate using the on/off status how would I go about? Can't connect my sensor to the physical button as this will keep the button pressed. Would be great if I can connect to one if the pins and fool the device that it's on or off

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.

But if there's no input into the controller stating if its on or off the feedback is simulated then? Otherwise I could have just modified that input to the controller to connect my switch? Saying simulated but derived from the logic and not from actual feedback

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.

Yes so the logic reads the state of the output pin and reports that as either on or off (simulated and not a physical input that I can manipulate) sorry if I'm using the wrong wording maybe but it's all done in the logic. Was hoping there is a seperate input that goes high or low to get the state

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.

It's clear you don't understand, let's leave it at that... Can't go around in circles

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.

I wanted to get the same result (i.e. using a sonoff switch as a relay status monitor) without reflashing the sonoff and used an Arduino board. On both the external relay (in my case it was a thermostat relay) and the Sonoff relay I connected the COM input to GND and the NC (or NO) pins to a couple of digital inputs of the Arduino. I connected a digital output to the input of a photomos AQY212EH (with a series resistor of course and the other input connected to GND) and the output of the photomos  in parallel to the sonoff pushbutton (soldering two wires). The program on Arduino continuously monitor the status of the relays and, if different, send a 100ms ON pulse to the photomos (and goes high for 1 second afer that), that closes the sonoff pushbutton. The sonoff toggles on the pushbutton opening.

The status of the sonoff switch can be read with eWeLink and a scene can be created to control a second sonoff (sonoff#1 ON -> sonoff#2 ON; sonoff#1 OFF -> sonoff#2 OFF).

I used this method to create a remote thermostat.

Note that you cannot add a sonoff#3 and link it to sonoff#2 via another scene. For some reason the scene works only if the "source" sonoff is controlled by the physical pushbutton and not with a scene. To overcome this limitation you need another sonoff mirrored to the #2 with an Arduino as explained above.
The chain looks like:
relay -> Arduino <-> Sonoff#1 -> eWeLink scene -> Sonoff#2 -> Arduino <-> Sonoff#3 -> eWeLink scene -> Sonoff#4 etc. etc.


Login or Signup to post a comment