How to press a button for Garage Door?

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
onlize
Normal user
Posts: 44
Joined: 12 Aug 2017, 03:44

How to press a button for Garage Door?

#1 Post by onlize » 15 Aug 2017, 05:20

Hello,

I am new to this. My first project was to read sensors and it went well. It was easy, I configured Devices using Switch Input and I use OpenHAB MQTT to send it to my Home Assistant.

As a second project, I want to configure the garage door opener. Also, I want to read the status of the door open/close.

I guess, the status of the door is easy, the same configuration as my first project. I will configure device using Switch Input. What I cannot understand is how to press the button for garage door open/close. How do I configure ESPEasy? I do not see anything like relay on the list of options for the device.

Can someone help me or, at least, point me to some tutorials that will teach me everything I have to know to configure ESPEasy on NodeMCU ESP8266?

Thank you.

wim16
Normal user
Posts: 88
Joined: 01 May 2017, 20:35

Re: How to press a button for Garage Door?

#2 Post by wim16 » 15 Aug 2017, 16:25


onlize
Normal user
Posts: 44
Joined: 12 Aug 2017, 03:44

Re: How to press a button for Garage Door?

#3 Post by onlize » 15 Aug 2017, 16:44

Thank you for your reply.

This is the list of the hardware that I can use with ESPEasy and I already have the relay that is on that list. I am trying to figure out how to turn on and, in about 30 seconds, to turn off GPIO pin that is connected to my relay. Basically, it will be like press button and released it.

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: How to press a button for Garage Door?

#4 Post by grovkillen » 15 Aug 2017, 16:48

onlize wrote: 15 Aug 2017, 16:44 Thank you for your reply.

This is the list of the hardware that I can use with ESPEasy and I already have the relay that is on that list. I am trying to figure out how to turn on and, in about 30 seconds, to turn off GPIO pin that is connected to my relay. Basically, it will be like press button and released it.
That is done using rules. (Timers are the keyword here.)

https://www.letscontrolit.com/wiki/inde ... rial_Rules
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

randytsuch
Normal user
Posts: 33
Joined: 05 Jun 2017, 05:32

Re: How to press a button for Garage Door?

#5 Post by randytsuch » 15 Aug 2017, 16:58

I'm using domoticz, but I would expect home assistant to have the same type of capability I use in domoticz.

In domoticz, I've made a virtual switch. When I press the switch, it sends out
http://ip address of esp/control?cmd=gpio,5,1

This will set gpio 5 to one. change to 1 to a 0 to set the gpio low.
There is also a toggle command, when you can toggle an output, I forget the exact format, I have it at home.
The toggle command is actually what I use.

For opening/closing a garage door, connect the gpio to a relay. Wire the relay in parallel with the opener switch. I set my output to toggle closed for 0.6 secs and it works fine.

But this is not using mqtt interface, but there must be a similar command with mqtt to toggle/turn on/turn off a gpio output.

EDIT
See this page
https://www.letscontrolit.com/wiki/index.php/GPIO
Use the pulse command.

Randy

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: How to press a button for Garage Door?

#6 Post by grovkillen » 15 Aug 2017, 17:00

You just publish to '<esp name>/cmd' with topic 'gpio,5,1'
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

onlize
Normal user
Posts: 44
Joined: 12 Aug 2017, 03:44

Re: How to press a button for Garage Door?

#7 Post by onlize » 15 Aug 2017, 17:58

Is this how I have to configure Home Assistant:
- platform: mqtt
state_topic "NodeMCU2/GPIO14/Status" ### Read Status of the door using GPIO-14
command_topic: "NodeMCU2/cmd/gpio,12,1" ### Trigger button to close/open garage door connected to GPIO-12
name: "My Garage Door"
qos: 0

This is the example they have on their website and I know it works because I tested it with Raspberry Pi.

How do I setup rules for this? I do not see an example with external connection coming. All examples are either boot or Timer that is configured as one of the rules.

This is my ESPEasy at this time:
Capture.JPG
Capture.JPG (31.63 KiB) Viewed 25319 times

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: How to press a button for Garage Door?

#8 Post by grovkillen » 15 Aug 2017, 18:02

Events are triggered remotely using either HTTP or MQTT.

HTTP:
http://<espeasyip>/control?cmd=event,<event name>

MQTT:
topic: <espeasy name>/cmd
payload: event,<event name>

This is covered in the wiki.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

randytsuch
Normal user
Posts: 33
Joined: 05 Jun 2017, 05:32

Re: How to press a button for Garage Door?

#9 Post by randytsuch » 15 Aug 2017, 18:11

From the wiki page

Example to send an active high pulse on GPIO 2 for 500 mSeconds:

http://<ESP IP address>/control?cmd=Pulse,2,1,500

so you don't need to use rules, send a pulse command instead of setting the gpio high or low.

You may need to experiment with pulsing it high or low, I think I pulse it low, ie

http://<ESP IP address>/control?cmd=Pulse,2,0,600

Also, in your example GPIO12 should not be an input. I don't know if it matters, but I would configure it as an output.

onlize
Normal user
Posts: 44
Joined: 12 Aug 2017, 03:44

Re: How to press a button for Garage Door?

#10 Post by onlize » 15 Aug 2017, 19:06

I am still confused how to do it, but I will try to do it later today when I come back home from work.

There is no output for Switch. What should I use?
Capture.JPG
Capture.JPG (55.27 KiB) Viewed 25305 times

onlize
Normal user
Posts: 44
Joined: 12 Aug 2017, 03:44

Re: How to press a button for Garage Door?

#11 Post by onlize » 15 Aug 2017, 19:22

How can I see logs? I want to see how MQTT topic comes to the device and what are the errors. Is it possible to do?

randytsuch
Normal user
Posts: 33
Joined: 05 Jun 2017, 05:32

Re: How to press a button for Garage Door?

#12 Post by randytsuch » 15 Aug 2017, 19:48

I am using Output MQTT Domoticz Helper

Switches are inputs, not outputs, and you need an output.

For Esp easy logs, you just go to tools then logs.

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: How to press a button for Garage Door?

#13 Post by grovkillen » 15 Aug 2017, 20:26

For MQTT I use the app MQTT Snooper.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

onlize
Normal user
Posts: 44
Joined: 12 Aug 2017, 03:44

Re: How to press a button for Garage Door?

#14 Post by onlize » 16 Aug 2017, 04:07

I was able to make it work, but I have one problem that would stop me from implementing this solution.

Every time when I restart my device, it turns on my relay. Basically, if there is a power failure when I am not home, it will open my garage door.

I added the following rules in my Rules section, but it does not do anything.

on System#Boot do
gpio,12,0 // Turn off relay
endon

I cannot understand why it is coming as 1 instead of 0.

These are my devices:
Capture.JPG
Capture.JPG (35.72 KiB) Viewed 25635 times
GPIO-14 is my Garage Door Sensor and GPIO-12 is the Garage Door Button.

Can you help?

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: How to press a button for Garage Door?

#15 Post by grovkillen » 16 Aug 2017, 06:12

Have you tried to set it under hardware tab, with boot state low?
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

onlize
Normal user
Posts: 44
Joined: 12 Aug 2017, 03:44

Re: How to press a button for Garage Door?

#16 Post by onlize » 16 Aug 2017, 13:53

I tried every option under Hardware for GPIO-12.

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: How to press a button for Garage Door?

#17 Post by grovkillen » 16 Aug 2017, 13:57

In the "system#boot" event, could you add a delay for lets say 10 seconds (before the gpio,12,0) and see what happens?
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

onlize
Normal user
Posts: 44
Joined: 12 Aug 2017, 03:44

Re: How to press a button for Garage Door?

#18 Post by onlize » 16 Aug 2017, 14:05

I added it like this:
On System#Boot do //When the ESP boots, do
timerSet 1,21 // 21 second timer
gpio,12,0 // Turn off GPIO-12
endon

Nothing changed. GPIO-12 stays 1 forever.

onlize
Normal user
Posts: 44
Joined: 12 Aug 2017, 03:44

Re: How to press a button for Garage Door?

#19 Post by onlize » 16 Aug 2017, 14:08

I changed it to this and it is on for 21 seconds:

On System#Boot do //When the ESP boots, do
timerSet 1,21 // 1 second timer
gpio,12,0 // Turn off GPIO-12
endon

on Rules#Timer=1 do
gpio,12,0 // Turn off GPIO-12
endon

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: How to press a button for Garage Door?

#20 Post by grovkillen » 16 Aug 2017, 14:10

That is incorrect since you will break out of the boot event with that timer call.

This is what I meant:

Code: Select all

On System#Boot do //When the ESP boots, do
 	delay 10 // wait for 10 seconds
	gpio,12,0 // Turn off GPIO-12
	delay 5 // wait for another 5 seconds
endon
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

onlize
Normal user
Posts: 44
Joined: 12 Aug 2017, 03:44

Re: How to press a button for Garage Door?

#21 Post by onlize » 16 Aug 2017, 14:20

It is on (1) and would not turn off.

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: How to press a button for Garage Door?

#22 Post by grovkillen » 16 Aug 2017, 14:27

I just typed that one out of memory, I might have forgotten the "," for the delay. Tired this?

Code: Select all

On System#Boot do //When the ESP boots, do
 	delay,10 // wait for 10 seconds
	gpio,12,0 // Turn off GPIO-12
	delay,5 // wait for another 5 seconds
endon
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

onlize
Normal user
Posts: 44
Joined: 12 Aug 2017, 03:44

Re: How to press a button for Garage Door?

#23 Post by onlize » 16 Aug 2017, 14:31

It stays on forever.

Sorry, have to go to work. Will not be able to reply quickly, but possible will be able to run remote tests where I do not hear relay, but can see 1 and 0.

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: How to press a button for Garage Door?

#24 Post by grovkillen » 16 Aug 2017, 14:34

Final(?) wild try of an solution:

Code: Select all

On System#Boot do //When the ESP boots, do
 	TaskValueSet,2,1,0
endon
Could maybe be used in conjunction with a delay?
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

onlize
Normal user
Posts: 44
Joined: 12 Aug 2017, 03:44

Re: How to press a button for Garage Door?

#25 Post by onlize » 16 Aug 2017, 15:39

The same. Stays forever.

I am going to try some dummy GPIO and try to play with this. Maybe I will be able to find the way around.

randytsuch
Normal user
Posts: 33
Joined: 05 Jun 2017, 05:32

Re: How to press a button for Garage Door?

#26 Post by randytsuch » 16 Aug 2017, 17:21

For a relay, 0 and 1 are somewhat arbitrary.

You really only care about when it is opened or closed.

So, if it is always closed at turn on, use the other contact, so it is always open at turn on.
If you are currently using the middle and left relay contacts, change to middle and right. Or vice versa.

Then you will need to change your pulse logic to do the opposite of what it does now
If you had to pulse high before, change it to pulse low.

Randy

onlize
Normal user
Posts: 44
Joined: 12 Aug 2017, 03:44

Re: How to press a button for Garage Door?

#27 Post by onlize » 16 Aug 2017, 17:26

I need relay not to change when the device is rebooted. If it changes position when device is coming online, it is the same as pressing the garage door button. The problem with this is that during the power failure, when the power will come back on, the button will be pressed and the door will open. If I am not home, it could be the serious issue.

randytsuch
Normal user
Posts: 33
Joined: 05 Jun 2017, 05:32

Re: How to press a button for Garage Door?

#28 Post by randytsuch » 16 Aug 2017, 19:30

onlize wrote: 16 Aug 2017, 17:26 I need relay not to change when the device is rebooted. If it changes position when device is coming online, it is the same as pressing the garage door button. The problem with this is that during the power failure, when the power will come back on, the button will be pressed and the door will open. If I am not home, it could be the serious issue.
I understand that.

But does it always come up in the same state?
If it does, then if you move the wires it will not open.
I'm not sure how to explain this any better.

onlize
Normal user
Posts: 44
Joined: 12 Aug 2017, 03:44

Re: How to press a button for Garage Door?

#29 Post by onlize » 17 Aug 2017, 22:33

Guys, thank you for your help. I found that my GPIO pin was bad. When I moved to another pin, everything works the way it has to.

Thank you very much for your help.

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: How to press a button for Garage Door?

#30 Post by grovkillen » 18 Aug 2017, 07:22

ARGH :evil: ( ;) )

This is the first step you take when trying to find the problem. :)
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

DanG
New user
Posts: 2
Joined: 21 Aug 2017, 19:31

Re: How to press a button for Garage Door?

#31 Post by DanG » 21 Aug 2017, 19:37

I don't know if this is the right place to point out other solutions ;-)

I started to use OpenGarage (Link) and it works fine (although I don't use the button function. But it reports the door status perfectly.

Bye,
Daniel

Ult1mat3X
New user
Posts: 3
Joined: 23 May 2019, 03:57
Location: Chicago
Contact:

Re: How to press a button for Garage Door?

#32 Post by Ult1mat3X » 23 May 2019, 04:08

Here tutorial how to set it up with Arduino. I hope it helps

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest