MQTT garage door opener with Node-RED

Hi All,

i'm trying to use ESP8266 NodeMCU (planning to use Tasmota for 2 reasons one HTTP as back up and more GUI, also able to use few relays and sonoffs so far with MQTT already)

Does anyone have a basic similar build 'flow' that can help.

trying to keep it simple like just open/close/stop

I think you'll find that this category is for people to SHARE projects that they have made.

[Edit] I can see the category have been changed to 'General'

If you do a search on the forum you should find quite a few responses as this topic has come up many times.

Thanks Dave. I saw it too on other platforms, just these gates have become such a pain.

hopefully you'd understand approx 300 kgs 2 gates on both sides i have to pull and push everyday when get in/out with my car :grinning:

Woo - those are BIG gates. But great for your fitness campaign (ha,ha).

Being serious now - there are at least four issues to consider.
1.How to operate the gates with a powerful electric motor and limit switches/detectors.
2.The control logic
4. Safety

  1. I'm assuming the gates move laterially on maybe on a track?? Please confirm/explain.
  2. A Raspberry Pi (RPi-Z-W) running Node-RED or maybe a rule-set in the Wemos ESP8266 should be able to handle the control sequences. You mentioned MQTT, so I'm assuming 'distance' is involved.
    I assume there is power (electricity) where the gates are located?
  3. How do you propose to control the system (keypad, push-buttons, keyfob, mobile-phone ???)
  4. As those gates sound to be very heavy, you need to consider how to maintain personal and visitor safety - last thing you want is a law-suit for injury.

Note that is absolutely vital if you use powered gates that they have a safety mechanism to prevent the crushing of people if they get in the way. There have been several incidents of children killed by such gates.

agreed Colin. safety comes first.
it's just that i'm certain to use kill switches and visual+sound alarm(buzzer) before and during the all movement.

Which part of the system don't you know how to do?

well, i'm willing to do few things
1-add some sensors/photocells for motion-detection and instructing the gate to open.
2-put one kill switch near to the gate, in case mobile-phone doesn't catch the Wi-Fi
3-inside node-red i saw one option to audio out, for example when gates open if some audio alarm can be played or flash message notification

gates are sliding manually as of now. just not motorized.

yes you're right. i thought about it a lot. trying to put all safety measures in place.

pushing these gates is like push-starting a car.

[{"id":"ad39963d.ea598","type":"tab","label":"Motor","disabled":false,"info":""},{"id":"b57a7eb0.293e2","type":"Sonoff device Enhanced","z":"ad39963d.ea598","mode":"0","broker":"b650332e.d12ee","device":"Utanki","name":"Utanki","onValue":"ON","offValue":"OFF","toggleValue":"toggle","cmdPrefix":"cmnd","statPrefix":"stat","telePrefix":"tele","x":390,"y":200,"wires":[[]]},{"id":"ade4cb79.1136f8","type":"ui_switch","z":"ad39963d.ea598","name":"MOTOR","label":"MOTOR","tooltip":"","group":"a5146bf8.bcab5","order":1,"width":0,"height":0,"passthru":true,"decouple":"false","topic":"/home/Utanki","style":"","onvalue":"on","onvalueType":"str","onicon":"<i class=\"fas fa-faucet\"></i>","oncolor":"","offvalue":"off","offvalueType":"str","officon":"<i class=\"fas fa-faucet\"></i>","offcolor":"","x":140,"y":200,"wires":[["b57a7eb0.293e2"]],"icon":"font-awesome/fa-bolt","info":"# मोटर"},{"id":"b650332e.d12ee","type":"mqtt-broker","z":"","name":"pi","broker":"","port":"1883","clientid":"","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"a5146bf8.bcab5","type":"ui_group","z":"","name":"MOTOR","tab":"4bf5eaa5.38967c","disp":true,"width":"8","collapse":false},{"id":"4bf5eaa5.38967c","type":"ui_tab","z":"","name":"MOTOR","icon":"dashboard","order":1,"disabled":false,"hidden":false}]

This is my current setup. Have 2 sonoff(s)-tasmotized doing the water-tank-motor+alarm job

motorising gates is going to be the second project which is getting too heavy considering 2-3 times minimum these big gates open

Off the top of my head - one thing you could do to reduce the risk factor, is make the system a manually activated system. i.e. Have an electric motor, with all the safety measurements, and a key-switch so only the person with the key can operate the gates. This means the gates wouldn't be activated or operated unless the key-holder was present.

that's already done. my plan is to use motorized gate only when in front of it instead of getting out and pushing/pulling by using securely connected wifi only on my mobile phone.

Have a look at 'telegram' - a great way to send/receive information to/from a mobile phone.
You can send inline keyboard layouts to your phone to improve the user-interface.

I use it to switch on/off the power supply for a printer-server from my phone, send messages to my phone when my infra-red detectors are triggered, etc..

I also use it at my IoT Club to shut-down the Raspberry Pi towers ( 2 towers of six Pi-Zeros) from my phone.

i already have my raspeberry-pi3 running a VPN server role in case i need to connect from outside to send messages. but that isn't major items on my list.

seems like telegram is useful for non-vpn scenarios.

Quite a few people on the forum use 'telegram' including @TotallyInformation (whose is a security expert) and may offer their/his view on Telegram.

He may do :grinning:

Telegram is about the easiest way to set up a "bot" service over a reasonably secure channel that requires minimal setup. It is easy enough to set up 2-way text-based comms between the bot and Node-RED. and you can configure easy to use commands for input in the Telegram app (mobile or web).

In many ways, this is preferred to a VPN since VPN's extend your private network offsite and this itself can be a security problem. As an experiment, set up a private network with a VPN connection, set up a sacrificial laptop with the VPN on it and take a scenic visit to Moscow, leaving the laptop in your hotel room. :smiling_imp: Works best if you are a government or health employee travelling on business but I think you get the idea. A VPN is only as secure all of the remote end-points.

Of course, for most people this is probably not a large issue but it is certainly not zero risk especially with so many people now working from home over hastily constructed remote connections.

You can reduce the risk further if using a VPN by creating a "DMZ" in your home network. It isn't that hard but it is possibly beyond the scope of this forum.

More realistically, you can create a limited, HTTPS "VPN" using a service such as NGROK. I use that occasionally but I don't leave it turned on. I have a command I can give to my Telegram bot that turns it on and off (via Node-RED of course). So I have the best of both worlds but retain maximum security.

Admittedly, my local security needs may be somewhat higher than yours :wink:

Thanks Julian,

appears to be very correct and off-topic. :smile:

All i was looking for is some flow export that help me progress further with adding sensors,kill-switches, photocells etc to a heavy gate and slide motorised.

Maybe but then you probably don't want random hackers opening your garage door! :scream:


Again thanks Julian

i can picture hackers in a van parked outside my premises. i'm going to power-off the grid to the house...ROFL