Hello, first post on this forum so I don’t quite know the ins and outs here yet.
I was thinking almost the same as this video:
I want to be able to connect my dumb garage port to my home assistant rpi installation. from the youtube video I got a parts list but I got kind of confused as to why he chose what he chose.
In his video he uses 2 magnetic contact sensors, one of them is normally closed and the other is normally open, is there a reason he bought 2 different types instead of just 2 pcs of the same?
My guess is probably just so that the state of the fully open and fully closed sensors is natively as you would expect at the hardware level for the use case.
Or maybe it’s that if a device spends most of its time in one position (garage door is closed) then it is better practice to have both the sensors in an open position for this state. I think…
I’m not certain but I don’t think it really matters. You can just invert them as required at the software level.
They used 2 different ones because you need them to essentially be opposite for the cover logic to work properly. Its hard to explain and honestly i dont fully understand the reasons but, I banged my head for days trying to get my door to keep the open,opening,closed,closing states to stay in sync and thats how you have to do it. you can either buy 2 different ones or you will need to invert one of your binary sensors.
The code from that project is kind of weird IMO. He made a crude attempt at doing the door logic and Esphome has really good options for different covers that are far better than that and you don’t need to manually program the logic like that anymore, it’s done for you in the Feedback Cover — ESPHome
READ THE DOCUMENTATION!
The worst thing you can do is just copy/paste code you find on the internet and cross your fingers, hoping that it will work. Make an investment in yourself and try to understand it and learn it. It’s not that hard.
You can use my door config as a reference but, try to make your own.
what cant you figure out? You can do it with 1 reed but, I wouln’t. It’s going to be harder to keep track of the door states and therefore less reliable. Do you reside in the Sahara desert or somewhere that doesn’t have online shopping? If not, you can order reed switches for very little money…10$
Seriously? What’s the point of doing the project if you’re only going to do it half-way?
The other and arguably best option would be to just buy a Shelly2.5 relay. This will work as the relay to trigger the door, it also has 2 DC current monitoring inputs and through current it knows exactly when the door starts/stops, if it’s open/closed and the exact % it’s open.
The problem with the old esp8266 w/relay and 2 reed switches is it doesn’t know when someone pushes the button/s on the wall, it doesn’t know when a car RF remote is used to trigger the door and it doesn’t know if something triggers the laser obstacle sensor which causes the door to stop then open.
Thank you for your reply. I don’t live in the Sahara Desert, and I can easily buy another reed switch. Currently, I am using an ESP32 device running Tasmota with one reed switch, and it is functioning perfectly. However, I am curious to know why ESPHome is unable to perform the same function with just one reed switch.
It can, its just that second reed switch helps keep the correct open’opening’closed,closing states. With only one reed switch, it “assumes” the door position and if its wrong hitting the top or bottom reed will correct the states. Having only one reed, the true door state wont ever update unless it hits your single reed switch.
I would seriously suggest the Shelly2.5 though. That thing will track the door 100% while even with 2 reeds the door state can get out of whack.
In case someone comes along to read this like I did, yes, this is very possible. While the other poster is correct in that having 2 makes things better, it is by no means as “required” as they make it out to be.
If all you care about is “open (at all)” vs “closed (completely)” a single reed switch will work just fine.