I try to make a simple push button with an esp32. What i want to do is when I push the button the relay give a signal to an relay step by step and turns the light on.
The problem is that ... when I write the code the relay is energized ... and it turns the light on or off. What i must do to eliminate the energhize
My code …
output:
- platform: gpio
id: relay_output1
pin:
number: 17 # GPIO pin connected to relay 1
inverted: false
- platform: gpio
id: relay_output2
pin:
number: 18 # GPIO pin connected to relay 2
inverted: false
switch:
- platform: gpio
id: id1
pin:
number: 16
inverted: true
restore_mode: DISABLED
name: "Relay 1 Switch" # Name for the switch controlling relay 1
on_turn_on:
- output.turn_on: relay_output1
- delay: 100ms
- output.turn_off: relay_output1
on_turn_off:
- output.turn_on: relay_output1
- delay: 100ms
- output.turn_off: relay_output1
- platform: gpio
id: id2
pin:
number: 19 # Replace this with the GPIO pin for the second switch
inverted: true
restore_mode: DISABLED
name: "Relay 2 Switch" # Name for the switch controlling relay 2
on_turn_on:
- output.turn_on: relay_output2
- delay: 100ms
- output.turn_off: relay_output2 # Turn off relay 2 when switch is deactivated
on_turn_off:
- output.turn_on: relay_output2
- delay: 100ms
- output.turn_off: relay_output2
You can physically wire the button to the relay and trigger it through physical means or you can do it all through code in Esphome, and you can do it so both options are usable to you…
I see a relay module connected to another relay with a button or sensor connected to it.
What would you like this setup to do? Is that Finder some come kind of sequence-relay?
I don’t want to integrate another module for lights. So I use the switch as a push button, and the relay. I can use it mechanical … or with the relay. In this mode the relay I use give just an impulse to the finder (step by step relay 27.01.8.230 code). This way nothing is under tension and the lifespan is longer.
But my problem is the esp. I think I can use the ESP8266 … I read that is not having the restart on boot
Your description is borderline gibberish. If English is a challenge (it sometimes is for me, too). Just list the steps you want to accomplish one line at a time and indicate where the circuit doesn’t do what you want it to.
For my opinion the circuit it is ok. What is not ok for me, is when I update the code in ESP, it gives an impulse to the relay. What I want, is to change the code to stop the relay for operating when I update/modify the code.
And i’m asking the experienced persons for an advice.
I’m not experienced person and my english is bad as well, but if you only have one relay like on your circuit drawing you only need one gpio switch and nothing else. No gpio output needed.