I'm trying to make one more smart curtains.
I read several similar topics and tried to repeat it.
But something went wrong.
I have a curtain switch with two push buttons, Wemos D1 mini and two relays. I connect these push buttons to ground and to pins D1 and D2 with 20 cm wires. I also connected external 10k pull-up resistor to pins D1, D2 and 5V.
Settings for Switch1 and Switch2 shown in the picture below. The second switch has the same settings, but have GPIO D2.
And pin status
Relays control contacts connect to D6 and D7.
My rules. When i press the button, the relay should work for 10 seconds.
Code: Select all
On Curtains_open#State=1 do
timerSet,1,10 //set Timer1 for 10 seconds
gpio,13,1
gpio,14,1
Endon
On Curtains_close#State=1 do
timerSet,1,10 //set Timer1 for 10 seconds
gpio,14,1
Endon
On Rules#Timer=1 do //when Timer1 expires, do
gpio, 13,0
gpio, 14,0
Endon
On the arduino, I deal with noises/interferences by soldering the capacitor between the ground pin and the button pin.
If I solder a 1 μF (or 10 μF) capacitor to ground and button pins, then i need to press button two times for relay turn on.
I understand that somewhere I was mistaken. But I can't find my mistake.
Help me, please!