How to press a button for Garage Door?
Moderators: grovkillen, Stuntteam, TD-er
How to press a button for Garage Door?
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.
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.
Re: How to press a button for Garage Door?
Well, maybe you can try the wiki: https://www.letscontrolit.com/wiki/index.php/Devices
Re: How to press a button for Garage Door?
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.
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.
- 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?
That is done using rules. (Timers are the keyword here.)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.
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

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



-
- Normal user
- Posts: 33
- Joined: 05 Jun 2017, 05:32
Re: How to press a button for Garage Door?
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
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
- 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?
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

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



Re: How to press a button for Garage Door?
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:
- 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:
- 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?
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.
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

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



-
- Normal user
- Posts: 33
- Joined: 05 Jun 2017, 05:32
Re: How to press a button for Garage Door?
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.
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.
Re: How to press a button for Garage Door?
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?
There is no output for Switch. What should I use?
Re: How to press a button for Garage Door?
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?
-
- Normal user
- Posts: 33
- Joined: 05 Jun 2017, 05:32
Re: How to press a button for Garage Door?
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.
Switches are inputs, not outputs, and you need an output.
For Esp easy logs, you just go to tools then logs.
- 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?
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

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



Re: How to press a button for Garage Door?
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: GPIO-14 is my Garage Door Sensor and GPIO-12 is the Garage Door Button.
Can you help?
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: GPIO-14 is my Garage Door Sensor and GPIO-12 is the Garage Door Button.
Can you help?
- 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?
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

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



Re: How to press a button for Garage Door?
I tried every option under Hardware for GPIO-12.
- 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?
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

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



Re: How to press a button for Garage Door?
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.
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.
Re: How to press a button for Garage Door?
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
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
- 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?
That is incorrect since you will break out of the boot event with that timer call.
This is what I meant:
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

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



Re: How to press a button for Garage Door?
It is on (1) and would not turn off.
- 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?
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

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



Re: How to press a button for Garage Door?
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.
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.
- 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?
Final(?) wild try of an solution:
Could maybe be used in conjunction with a delay?
Code: Select all
On System#Boot do //When the ESP boots, do
TaskValueSet,2,1,0
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

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



Re: How to press a button for Garage Door?
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.
I am going to try some dummy GPIO and try to play with this. Maybe I will be able to find the way around.
-
- Normal user
- Posts: 33
- Joined: 05 Jun 2017, 05:32
Re: How to press a button for Garage Door?
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
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
Re: How to press a button for Garage Door?
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.
-
- Normal user
- Posts: 33
- Joined: 05 Jun 2017, 05:32
Re: How to press a button for Garage Door?
I understand that.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.
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.
Re: How to press a button for Garage Door?
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.
Thank you very much for your help.
- 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?
ARGH
(
)
This is the first step you take when trying to find the problem.


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

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



Re: How to press a button for Garage Door?
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

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
Re: How to press a button for Garage Door?
Here tutorial how to set it up with Arduino. I hope it helps
Who is online
Users browsing this forum: No registered users and 11 guests