[SOLVED] Dry contact switch items in OH2

Only 1 pin needed?

Certainly

17:53:57 MQT: stat/gate/RESULT = {“GPIOs1”:[“0 (None)”,“1 (DHT11)”,“2 (AM2301)”,“3 (SI7021)”,“4 (DS18x20)”,“5 (I2C SCL)”,“6 (I2C SDA)”,“7 (WS2812)”,“8 (IRsend)”,“9 (Switch1)”,“10 (Switch2)”,“11 (Switch3)”,“12 (Switch4)”,“13 (Button1)”,“14 (Button2)”,“15 (Button3)”,“16 (Button4)”,“17 (Relay1)”,“18 (Relay2)”,“19 (Relay3)”,“20 (Relay4)”]}
17:53:57 MQT: stat/gate/RESULT = {“GPIOs2”:[“21 (Relay5)”,“22 (Relay6)”,“23 (Relay7)”,“24 (Relay8)”,“25 (Relay1i)”,“26 (Relay2i)”,“27 (Relay3i)”,“28 (Relay4i)”,“29 (Relay5i)”,“30 (Relay6i)”,“31 (Relay7i)”,“32 (Relay8i)”,“33 (PWM1)”,“34 (PWM2)”,“35 (PWM3)”,“36 (PWM4)”,“37 (PWM5)”,“38 (Counter1)”,“39 (Counter2)”,“40 (Counter3)”,“41 (Counter4)”]}
17:53:57 MQT: stat/gate/RESULT = {“GPIOs3”:[“42 (PWM1i)”,“43 (PWM2i)”,“44 (PWM3i)”,“45 (PWM4i)”,“46 (PWM5i)”,“47 (IRrecv)”,“48 (Led1)”,“49 (Led2)”,“50 (Led3)”,“51 (Led4)”,“52 (Led1i)”,“53 (Led2i)”,“54 (Led3i)”,“55 (Led4i)”,“56 (MHZ Tx)”,“57 (MHZ Rx)”,“58 (PZEM Tx)”,“59 (PZEM Rx)”,“60 (SAir Tx)”,“61 (SAir Rx)”,“62 (SPI CS)”,“63 (SPI DC)”]}
17:53:57 MQT: stat/gate/RESULT = {“GPIOs4”:[“64 (BkLight)”]}

GPIO9 = Switch1?

Sorry can you do it again but now without an s at the end
stat/gate/gpio

Sure

18:24:40 MQT: stat/gate/RESULT = {“GPIO1”:“0 (None)”,“GPIO2”:“0 (None)”,“GPIO3”:“0 (None)”}

That means that the available pins for use with tasmotta are 1,2 and 3.
Unfortunately not 9… Mmmmhhh…
Now where are these pins on the boards???
Good news :smile:
The SDA pin I highlighted is NOT GPIO9 but GPIO2 so we can use it.
Good good good

Now on the tasmota screen can you change the GPIO2 to a switch?

image

1 Like

haha! im glad you know what you’re doing :stuck_out_tongue:

Changes done!

18:33:08 MQT: stat/gate/RESULT = {“GPIO1”:“0 (None)”,“GPIO2”:“9 (Switch1)”,“GPIO3”:“0 (None)”}

Next, you will need a multimeter and find you what is going on on those wires that your guy set up.
Now there are two possibilities

  1. There is a voltage when the light is on or off and that’s bad news because we are gonig to have to convert that voltage to 3.3v (You can test that by setting your multimeter to VDC)
  2. It’s just a contact (like a switch) and the circuit on the wire is either opened or closed (You can test that by setting your multimeter to resistance (Ohms)

Which is it? Time to grab the tools and go outside I am afraid!!

hahah! Multimeter… uh oh…i think ive got one. Let me go see!

Sorry I don’t have one. Let’s just try it anyway :slight_smile:

No!!! :scream:
You might fry your board…
Get a cheap multimeter and come back to me
It’s a very useful tool that you will need again if you are going to tinker again

Seriously it’s fine. A multi I won’t get access to for a while and a new board is cheaper. Let’s give it a go.

Your board, no mine.
The two wires, one should be ground. Connect that to the bottom pin on the programming header. Connect the other one to the top pin as shown above.
Don’t forget to isolate the power before doing anything.

Ok no worries.

Temporarily or permanently?

We are testing so temporarely, always.
When the setup is good and reliable then we do it permanent.
That’s what breadboards are for, testing, testing and re-testing.

Ok… done. When connected it triggered the door.

What do you mean, it triggered the door?
Is your sonoff still working?

Yes sonoff working. Basically now the door won’t close properly with the wires connected like that. Its half open

When I remove the wires the door operates normally.

I have WhatsApp if it’s faster and easier:)

Ok, no problems
Disconnect and change the GPIO2 setting to Button4
Then WITHOUT connecting to your gate, put two wires between ground and GPIO2 and open and close the circuit and monitor your MQTT. What do you get?

I have no button4. Do you mean switch4

No I mean button4