TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Automating my gate door via a smart relay

79 点作者 farslan11 个月前

6 条评论

kelnos11 个月前
Love stuff like this. Years ago I lived in an apartment building where the main entrance was controlled by an analog phone system with an extra pair of wires. All the handsets in the unit were connected to a speaker&#x2F;microphone outside the door (directly; there was no enable&#x2F;disable when your unit was or was not getting buzzed), and there was an extra pair of wires for activating the door unlock.<p>I wanted to give my partner (and houseguests) the ability to come and go as they pleased without having to give them a building key (I only had one spare key provided by my landlord, and it was expensive to replace if lost). I bought a relay and grabbed an old Raspberry Pi, hooked the relay to the Pi&#x27;s GPIO pins, and opened up the intercom phone and found the wires that activated the door unlock. Wrote a little HTTP server in python that would enable the GPIO pins for 10 seconds to unlock the door, and wired that up to my home automation system (openHAB). I got a Twilio phone number, and set it up so it would respond to particular PIN codes from specific phone numbers. When I was hosting someone for a weekend, I&#x27;d generate a random 8-digit PIN code and add that and their phone number to a config file on the Pi.<p>At the time I hadn&#x27;t realized there were smart relays; otherwise this maybe would have required less work. This was 6 years or so ago, though, so maybe they weren&#x27;t really a thing back then.
评论 #40851943 未加载
评论 #40852608 未加载
amluto11 个月前
A couple observations:<p>1. These gate systems usually have dry contact <i>outputs</i> as well, and you can get the gate motor’s idea as to whether the gate is open. You’ll need a smart relay with inputs :)<p>2. Home Assistant’s “cover” entities are a bit silly in that they don’t let you open a cover that is already 100% open. If you have a gate with an automatic close timer, you might want to send the open command even when it’s open to delay closing. You can fudge this by reporting the cover 99% open when it’s open instead of 100% open.
jnaina11 个月前
Took a slightly different approach for my gate, about a decade ago. Took apart one of the RF controller fobs, and wired it using a cheap relay from Aliexpress, and hooked it up to a Rpi&#x27;s GPIO pins. Wrote a simple python code to control the open&#x2F;close using the WiringPi library, with Alexa control achieved via the HA Bridge open source Philips HUE bridge software. Added Siri&#x2F;Homekit control using HomeBridge.<p>Recently added two cheap outdoor cameras from Aliexpress with HLS streaming capabilities (and PoE) and wrote a simple iOS app that offers two different views (inside and outside gate), with a simple toggle button to open&#x2F;close the gate. Backend hosted on a cheap $8 per month OVH instance with secure Tailscale access to the Rpi at home. This way, I can monitor my gate remotely from anywhere and open&#x2F;close as required.
mk_stjames11 个月前
So all it takes to open this model of gate is someone to know to pry off that plastic motor cover thats only held on with 2 little screws, and short two pins of the connector right there on top which looks to be reachable through the bars of the gate from the other side.<p>I feel I&#x27;d want the motor controls in a more secured box if I was the type of person who needed one of these gates.
评论 #40854682 未加载
评论 #40853553 未加载
评论 #40855820 未加载
Animats11 个月前
All that electronics associated with the gate and you can&#x27;t get info back about whether it&#x27;s open, closed, moving, or blocked.
评论 #40851877 未加载
评论 #40851834 未加载
评论 #40851293 未加载
评论 #40852126 未加载
scottwick11 个月前
What happens if the 2nd signal (after the 200ms delay) is never received? Would keeping the relay closed like that cause any issues?<p>I wonder if a more &quot;robust&quot; way to handle this would be a custom microcontroller on the receiving end that receives a single Zigbee signal and implements the 200ms delay internally.
评论 #40857962 未加载