-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevent relay trigger on boot or reset with esphome code #24
Comments
@davidusb-geek what model or relay are you using (T-Relay, T-Relay 8, or T-Relay S3)? |
I'm using the t-relay 8. |
Sad to hear that. |
Oh man, I've just solved this after months looking for a solution! First define the output pins:
Then I define my switch for the garage door like this:
And that's it, works like charm. |
@davidusb-geek thank you for sharing the solution :) |
Wait! I spoke too soon! |
Yes I'm using DIN rail. I'll post the aliexpress link for that piece. It is a shame that I have this issue because the board quality is very good. |
These DIN supports work fine: 1 Pair DRG-01 PCB Mounting Brackets Screws Green For DIN 35 Mounting Rails Adapter Replacements Parts |
Relay4/realy8 should not have this problem, but there is indeed a chance that this problem will occur on realy6 |
Ok I will try the INPUT_PULLUP option on relay4 or relay8 and see how it goes. |
I just tested it on relay 4 (ie. GPIO12), still doesn't works. |
@lewisxhe could you please say more about relay6 (T-Relay S3)? I need to be 100% sure that the relays won't switch on/off after power loss. I want to control my garage door, so if this issue occurs my garage will open! |
So I completely misinterpreted this reply. |
I'm not sure if I understand it right. I'm assuming it was related to product types and not to relay in T-Relay 8 |
Ok, got it working now! Tested it for real and everything is working fine and as expected. I tested many options and finally got it working with this configutaion:
The switch part of the yaml code is the same that I posted earlier in this issue. Cheers!!! |
@davidusb-geek thank you for sharing a solution. Yesterday I ordered a T-relay 8 board, it should arrive in about 3-4 weeks so I'll also test all the options. |
I got it working with an easier method, the sn74hc595:
- id: "sn74hc595_hub"
data_pin: 7
clock_pin: 5
latch_pin: 6
sr_count: 2
# Individual outputs
switch:
- platform: gpio
# SN74HC595 Pin #0
name: "Switch 1"
pin:
sn74hc595: sn74hc595_hub
# Use pin number 0
number: 0
inverted: false
mode: OUTPUT
id: relay1 |
Hey mate, I really like this board but the relays triggering on boot is killing me. What's the issue and how did you deal with it? I'm using ESPHome on the Lilygo T-Relay with Home Assistant. Thanks a bunch. |
Sorry to hear that. I also liked this board. Of course that requires changing the board. So probably try the solution proposed by @szab0lcs |
@forgotmyprozac Can you please tell me what version of your board is? Can you take a picture of the front of the board for me to see? |
Images below. Thank you. https://i.ibb.co/Hzg5BXc/PXL-20241118-064935332.jpg |
This is an early version and can be solved by adding a resistor, see the picture |
After this change, 74HC595 will be enabled through GPIO4, and only GPIO4 low level can drive the relay |
Thank you very much for the help. What wattage for the resistor and what AWG wire for IO4? What do you mean "after normal power on, set IO4 to LOW" > Do I need to set this in my code? So it will boot up and be high, then the code will pull it low, then relays can be used? How can we tell what version the board is? I have another one coming from Aliexpress and want to know if it will have the same problem. Thank you |
There is no requirement for the resistor wattage since it consumes very little current. ESPHOME:
ARDUINO:
|
I'm using a very similar code to the one here for esphome and Home Assistant.
Everything works fine except that when the board resets or reboot all the relay are triggered.
Very inconvenient when controlling a garage door for example.
Any suggestions to solve this and avoid these relay triggering?
I have tried some solutions using the relay options on esphome (ALWAYS_OFF, etc.) but without success.
Any help will be much appreciated.
The text was updated successfully, but these errors were encountered: