So I am trying to use my nodemcu with my slide gate remote. I have soldered the wires, and have them connected at D2 and GND. I create the node in esp home (code below) and it appears as the device and entity when I upload via USB to the nodemcu. However, when I click on the entity, the gate does not open (the gate remote has a small red led, which flashes when pressing the button physically or when I disconnect one of the pins from nodemcu and reconnect it again). What am I doing wrong here?
I tried using GPOI id: 4, instead of the id: D2. I tried installing the node without the change of BAUD rate, but still no result (I have it set to 9600, because it says so on the actual nodemcu).
Did you measured the voltage across the button? Maybe it needs more than 3.3 volts. Otherwise you could bridge the button with a relay and control the relay with the esp. That should work in almost every case.
Yes, there is enough voltage. The button led does light up when I disconnect and reconnect either of the pins to the nodemcu, and the gate starts opening. It just does not control from HA, I feel like I am missing something in the configuration, but I do not know what. I have also tried multiple nodemcu’s, same result.
The fact that the remote is only triggering if you reconnect the cable could have many reasons. For example a capacitor that charges up if you disconnect the cable, and discharges if you connect again. But if you have the cable connected it can’t charge.
You can try to bridge the button to test if a relay would work.
Also some pictures of the remotes circuit could help.
I meant that you could connect the cable from (remote > D2) to (remote > 3.3v).
But as the D2 pin lights up the led that shouldn’t work either.
How would i try to bridge the button to test? I am sorry I am probably annoying you, but this is my first ever try with a nodemcu and its confusing as hell.
Also I don’t know if those two are the right ones as there are 5 pins.
Another attempt would be to install the esp directly to the receiver sou you don’t have to use the remote at all.
You dont see the other ends of the wires, but i can connect them there with another double pin wire. Same thing happens - led turn on for about 5 seconds and the gate starts opening, then the led shuts off. If i disconnect and reconnect the wire its all the same again.
I assume by receiver you mean inside the gate motor. I will try that only as a last resort because I would break my warranty.
As a stupid solution i thought of this - i power the nodemcu via usb brick, put that brick into a smart outlet that is off. Then make an automation that turns on the outlet, delay 1sec, turn off outlet. It would work, but not the best solution
Connect one relay to the first button and the other to the other button.
Each relay has 3 terminals:
NC > (normally closed) you don’t need this one
COM > one cable of a button
NO > (normally opened) other cable of the button
At the other side you have 4 pins:
GND > (ground) to gnd on the node mcu
IN1 > to D2 Pin or any other digital output
IN2 > to D3 Pin or any other digital output
VCC > to 5v of the mcu
With the thre pins VCC, VCC, GND you can change if the relay turns on if there ist voltage at the IN pin or, when it is pulled to ground. You can leave it to VCC, VCC
As an alternative you could use a sonoff 2CH/dual channel and use it with the sonoff integration or flash it with ESPhome. You don’t need your nodemcu for this solution as an esp is already build in, but the relay solution is cheaper and easier. (Flashing with an UART/FTDI adapter isn’t hard as well)
I only need the one button because I only have the slide gate and no garage or anything like that. Anyway thank you very much kind sir for your help. I think I will either buy a sonoff wifi switch and just control it outside HA or just use my stupid solution with the socket
Thank you for the help. I ended up ordering a couple 5v single channel relays. When you said connect vcc to the 5v of nodemcu, you mean the vin on the nodemcu is the 5v, right?
Battery is 12v. Yes of course it gives reaction. The led lights up, gates start opening, led lights off after like 5-6 seconds. These are definitely the correct wires because no other two pins give out any reaction.
I’d find a 12V adapter and buy a shelly. Power the remote and the shelly from the 12V supply, and hook the wires up to the relay. Costs you like 15$.